--- /dev/null
+diff -ur gmemusage-0.2/gmemusage.h gmemusage-0.2-patched/gmemusage.h
+--- gmemusage-0.2/gmemusage.h 1999-08-25 21:23:52.000000000 -0600
++++ gmemusage-0.2-patched/gmemusage.h 2005-09-16 02:43:19.000000000 -0600
+@@ -30,8 +30,8 @@
+ void list (void);
+ void drawstring (int x, int y, char *str);
+ void drawstringfixed (int x, int y, char *str);
+-void drawstringright (int x, int y, char *str, float width);
+-void drawstringcenter (int x, int y, char *str, float width);
++void drawstringright (int x, int y, const char *str, float width);
++void drawstringcenter (int x, int y, const char *str, float width);
+ void refresh (int );
+ void display (void);
+ void mouseClick (int button, int state, int x, int y);
+diff -ur gmemusage-0.2/util.c gmemusage-0.2-patched/util.c
+--- gmemusage-0.2/util.c 1999-08-25 21:23:52.000000000 -0600
++++ gmemusage-0.2-patched/util.c 2005-09-16 02:43:55.000000000 -0600
+@@ -26,11 +26,15 @@
+ */
+
+ #include <GL/glut.h>
++#include <string.h>
+
+ #include "TexFont.h"
+
+ #include "enum.h"
+ #include "extern.h"
++#include <string.h>
++#include <stdlib.h>
++
+
+ /*--------------------------------------------------------*/
+ void drawstring (int x, int y, char *str)
+@@ -89,17 +93,18 @@
+ }
+
+ /*--------------------------------------------------------*/
+-void drawstringright (int x, int y, char *str, float width)
++void drawstringright (int x, int y, const char *str, float width)
+ {
+ int len, i;
+
+
+ len = strlen(str);
++ char *str_ = strdup(str);
+
+ switch(g_drawText)
+ {
+ case BitmapText:
+- glRasterPos2f(x+(width-glutBitmapLength(GLUT_BITMAP_HELVETICA_12, str)), y);
++ glRasterPos2f(x+(width-glutBitmapLength(GLUT_BITMAP_HELVETICA_12, (const unsigned char*)str)), y);
+ for (i=0; i<len; i++)
+ glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]);
+ break;
+@@ -107,28 +112,31 @@
+ glEnable(GL_TEXTURE_2D);
+ glPushMatrix();
+ glTranslatef((float)x, (float)y, 0);
+- txfRenderStringRightJustify(helv_txf, str, len, width);
++ txfRenderStringRightJustify(helv_txf, str_, len, width);
+ glPopMatrix();
+ glDisable(GL_TEXTURE_2D);
+ break;
+ default:
+ break;
+ }
++
++ free(str_);
+ }
+
+
+ /*--------------------------------------------------------*/
+-void drawstringcenter (int x, int y, char *str, float width)
++void drawstringcenter (int x, int y, const char *str, float width)
+ {
+ int len, i;
+
+
+ len = strlen(str);
++ char *str_ = strdup(str);
+
+ switch(g_drawText)
+ {
+ case BitmapText:
+- glRasterPos2f(x+(width-glutBitmapLength(GLUT_BITMAP_HELVETICA_12, str))/2, y);
++ glRasterPos2f(x+(width-glutBitmapLength(GLUT_BITMAP_HELVETICA_12, (const unsigned char*)str))/2, y);
+ for (i=0; i<len; i++)
+ glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]);
+ break;
+@@ -136,12 +144,14 @@
+ glEnable(GL_TEXTURE_2D);
+ glPushMatrix();
+ glTranslatef(x, y, 0);
+- txfRenderStringCenterJustify(helv_txf, str, len, width);
++ txfRenderStringCenterJustify(helv_txf, str_, len, width);
+ glPopMatrix();
+ glDisable(GL_TEXTURE_2D);
+ break;
+ default:
+ break;
+ }
++
++ free(str_);
+ }
+
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/gmemusage/gmemusage-0.2-old.ebuild,v 1.1.1.1 2005/11/30 09:56:01 chriswhite Exp $
+
+# I need to get md5s from the author.
+# I have personally audited this code for malicious crap and will
+# state that there is nothing obvious. RiverRat (small program)
+
+DESCRIPTION="gmemusage is based on the very useful SGI IRIX utility of the same name."
+HOMEPAGE="http://www.reptilelabour.com/software/gmemusage/index.htm"
+SRC_URI="http://www.reptilelabour.com/software/files/${PN}/${P}-082599.tgz"
+
+inherit eutils
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="${RDEPEND}"
+
+RDEPEND="virtual/x11
+ virtual/opengl"
+
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ epatch ${FILESDIR}/${P}-gentoo.patch || die "patch failed"
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ dobin gmemusage
+ dodoc README COPYING
+}
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/gmemusage/gmemusage-0.2.ebuild,v 1.1.1.1 2005/11/30 09:56:01 chriswhite Exp $
+
+# I need to get md5s from the author.
+# I have personally audited this code for malicious crap and will
+# state that there is nothing obvious. RiverRat (small program)
+
+DESCRIPTION="gmemusage is based on the very useful SGI IRIX utility of the same name."
+HOMEPAGE="http://www.reptilelabour.com/software/gmemusage/index.htm"
+SRC_URI="http://www.reptilelabour.com/software/files/${PN}/${P}-082599.tgz"
+
+inherit eutils
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="${RDEPEND}"
+
+RDEPEND="media-libs/glut
+ virtual/x11
+ virtual/opengl"
+
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch ${FILESDIR}/${P}-gentoo.patch || die "patch failed"
+
+ # custom cflags...
+ # multi-lib fix...
+ sed -i \
+ -e "s:^CFLAGS.*:CFLAGS = ${CFLAGS} -DLINUX:g" \
+ -e "s:^LIBS = -L/usr/X11R6/lib:LIBS = -L/usr/X11R6/$(get_libdir):g" \
+ Makefile || die "sed-ing failed"
+}
+
+src_compile() {
+ emake || die "make failed"
+}
+
+src_install() {
+ dobin gmemusage
+ dodoc README
+}