# ChangeLog for games-emulation/mupen64
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64/ChangeLog,v 1.23 2007/02/22 09:59:30 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64/ChangeLog,v 1.24 2007/03/27 15:17:01 joker Exp $
+
+*mupen64-0.5-r3 (27 Mar 2007)
+
+ 27 Mar 2007; Christian Birchinger <joker@gentoo.org>
+ +files/mupen64-0.5-anisotropic.patch, +files/mupen64-0.5-gentoo3.patch,
+ +mupen64-0.5-r3.ebuild:
+ New revision with better support for multilib installs.
22 Feb 2007; Simon Stelling <blubb@gentoo.org> mupen64-0.5-r2.ebuild:
depend on >=emul-sdl-10.0; bug 167202
+AUX mupen64-0.5-anisotropic.patch 5322 RMD160 7e3f27579118cf925611c8d2e892b2bc44a28ce3 SHA1 5af8d04739293e328c4de0e15fed0317d0427d57 SHA256 348b4dd68cd8408cec0f4293b9a0a6079098044029a20536561048c326c36c33
+MD5 6699bb75844089112962119f37641928 files/mupen64-0.5-anisotropic.patch 5322
+RMD160 7e3f27579118cf925611c8d2e892b2bc44a28ce3 files/mupen64-0.5-anisotropic.patch 5322
+SHA256 348b4dd68cd8408cec0f4293b9a0a6079098044029a20536561048c326c36c33 files/mupen64-0.5-anisotropic.patch 5322
+AUX mupen64-0.5-gentoo3.patch 9728 RMD160 97777a87ebf3f41391e46c1b5d9c685cbf455d90 SHA1 beab9d80f1bca57335a24f7ec40ebd65baa96bc4 SHA256 40134e02ddd5abf8fcfa6d62a63d14f059e8eafc76edea565d3d75458baa46d8
+MD5 4f9049dc56c46096e3ef5149884aed6d files/mupen64-0.5-gentoo3.patch 9728
+RMD160 97777a87ebf3f41391e46c1b5d9c685cbf455d90 files/mupen64-0.5-gentoo3.patch 9728
+SHA256 40134e02ddd5abf8fcfa6d62a63d14f059e8eafc76edea565d3d75458baa46d8 files/mupen64-0.5-gentoo3.patch 9728
AUX mupen64-0.5-paths.patch 3364 RMD160 5bb3d1480b57a39c72f738ab95bd41220c0a20a9 SHA1 1a5710ece08b3d50fdc3b765844abc1fda9bbb96 SHA256 d712ed85c1db3b27cf19edf8ca308c4f839273bcbb40fc1f61e05031556a7026
MD5 9d1f4aa5017f9c174204b7241fcb2abb files/mupen64-0.5-paths.patch 3364
RMD160 5bb3d1480b57a39c72f738ab95bd41220c0a20a9 files/mupen64-0.5-paths.patch 3364
MD5 4e95fc3a6c93c1f2a30adafe163b90aa mupen64-0.5-r2.ebuild 2315
RMD160 9db192afa0a5a19b54e63cbc80cbafc39877718e mupen64-0.5-r2.ebuild 2315
SHA256 7b2f95ead8bc3f1399556df3bbf4d0b252ff35916a317efae205a781d8c38ece mupen64-0.5-r2.ebuild 2315
-MISC ChangeLog 4166 RMD160 ba625893ed270e194c58263ab1f82369aad6b50a SHA1 67c827d5bd8de6d18b9a22f6df94bb360a6c382d SHA256 86273d7376cf0a6a405712f4760a958d4b2f5298ddbe6cb30cf9b34e61ff3b82
-MD5 85e81209407cf10de087b2e819846356 ChangeLog 4166
-RMD160 ba625893ed270e194c58263ab1f82369aad6b50a ChangeLog 4166
-SHA256 86273d7376cf0a6a405712f4760a958d4b2f5298ddbe6cb30cf9b34e61ff3b82 ChangeLog 4166
+EBUILD mupen64-0.5-r3.ebuild 2153 RMD160 f3c4d4ed79e70dda8f3eb95a7a20743d6620a631 SHA1 bf68a859cbda87f089570a5489f2554365334d18 SHA256 1faae6ea271ce1ddca3b5f11ad618ecc95c0c9b341154b333451c2fe7668cbb4
+MD5 beb26ec2933f73f52f3027d426c2e960 mupen64-0.5-r3.ebuild 2153
+RMD160 f3c4d4ed79e70dda8f3eb95a7a20743d6620a631 mupen64-0.5-r3.ebuild 2153
+SHA256 1faae6ea271ce1ddca3b5f11ad618ecc95c0c9b341154b333451c2fe7668cbb4 mupen64-0.5-r3.ebuild 2153
+MISC ChangeLog 4411 RMD160 ea2ce0bb966dee907643698cdd6d5e34d47432e0 SHA1 6276dc4d70b10b3be491b73f22ea9887ad4b1bee SHA256 959144cd1e832d3cc80e93f2091e34db5dd181f581491f43af58531d9db08d4e
+MD5 835c6dc17ef359fa1a28d5ebf6466c1e ChangeLog 4411
+RMD160 ea2ce0bb966dee907643698cdd6d5e34d47432e0 ChangeLog 4411
+SHA256 959144cd1e832d3cc80e93f2091e34db5dd181f581491f43af58531d9db08d4e ChangeLog 4411
MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3
MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158
RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea metadata.xml 158
MD5 0cdd256b3d2df86cac038aa9d538aedf files/digest-mupen64-0.5-r2 253
RMD160 f626935bb3e16eb360edde7e315583121ad7652c files/digest-mupen64-0.5-r2 253
SHA256 d3dbd70b6d9bca726be6e4b697f985cd7a83e1bd494f7074e11052da1f3b07d9 files/digest-mupen64-0.5-r2 253
+MD5 0cdd256b3d2df86cac038aa9d538aedf files/digest-mupen64-0.5-r3 253
+RMD160 f626935bb3e16eb360edde7e315583121ad7652c files/digest-mupen64-0.5-r3 253
+SHA256 d3dbd70b6d9bca726be6e4b697f985cd7a83e1bd494f7074e11052da1f3b07d9 files/digest-mupen64-0.5-r3 253
--- /dev/null
+MD5 11f994bed40e00fad5b82333b553e421 mupen64_src-0.5.tar.bz2 1981046
+RMD160 da916bc77f2f06ed92630332545dc3ee5ae1ff51 mupen64_src-0.5.tar.bz2 1981046
+SHA256 1b8e4188ab7a94d8125b77aed8725ee348c24818622b881adfe16be510487dfd mupen64_src-0.5.tar.bz2 1981046
--- /dev/null
+diff -u glN64/Config_linux.cpp /home/braddabug/mupen64/glN64/Config_linux.cpp
+--- glN64/Config_linux.cpp 2005-08-26 14:52:17.000000000 -0500
++++ /home/braddabug/mupen64/glN64/Config_linux.cpp 2006-12-24 21:56:05.000000000 -0600
+@@ -17,7 +17,7 @@
+ static GtkWidget *configWindow = NULL;
+ //static GtkWidget *bitdepthCombo[2], *resolutionCombo[2];
+ static GtkWidget *resolutionCombo;
+-static GtkWidget *enable2xSAICheck, *forceBilinearCheck, *enableFogCheck;
++static GtkWidget *enable2xSAICheck, *enableAnisotropicFilteringCheck, *forceBilinearCheck, *enableFogCheck;
+ static GtkWidget *enableHardwareFBCheck, *enablePolygonStippleCheck;
+ static GtkWidget *textureDepthCombo;
+ static GtkWidget *textureCacheEntry;
+@@ -109,6 +109,7 @@
+
+ OGL.forceBilinear = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(forceBilinearCheck) );
+ OGL.enable2xSaI = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enable2xSAICheck) );
++ OGL.enableAnisotropicFiltering = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableAnisotropicFilteringCheck));
+ OGL.fog = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableFogCheck) );
+ OGL.frameBufferTextures = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enableHardwareFBCheck) );
+ OGL.usePolygonStipple = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(enablePolygonStippleCheck) );
+@@ -143,6 +144,7 @@
+ /* fprintf( f, "width=%d\n", OGL.width );
+ fprintf( f, "height=%d\n", OGL.height );*/
+ fprintf( f, "force bilinear=%d\n", OGL.forceBilinear );
++ fprintf( f, "enable anisotropic=%d\n", OGL.enableAnisotropicFiltering );
+ fprintf( f, "enable 2xSAI=%d\n", OGL.enable2xSaI );
+ fprintf( f, "enable fog=%d\n", OGL.fog );
+ fprintf( f, "enable HardwareFB=%d\n", OGL.frameBufferTextures );
+@@ -182,6 +184,7 @@
+ gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(resolutionCombo)->entry), text );
+
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enable2xSAICheck), (OGL.enable2xSaI) );
++ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableAnisotropicFilteringCheck), (OGL.enableAnisotropicFiltering) );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(forceBilinearCheck), (OGL.forceBilinear) );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enableFogCheck), (OGL.fog) );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(enablePolygonStippleCheck), (OGL.usePolygonStipple) );
+@@ -235,7 +238,7 @@
+ gtk_container_set_border_width( GTK_CONTAINER(displayFrame), 7 );
+ gtk_container_add( GTK_CONTAINER(GTK_DIALOG(configWindow)->vbox), displayFrame );
+
+- displayTable = gtk_table_new( 5, 3, FALSE );
++ displayTable = gtk_table_new( 6, 3, FALSE );
+ gtk_container_set_border_width( GTK_CONTAINER(displayTable), 7 );
+ gtk_table_set_col_spacings( GTK_TABLE(displayTable), 3 );
+ gtk_table_set_row_spacings( GTK_TABLE(displayTable), 3 );
+@@ -301,7 +304,8 @@
+ resolutionCombo = gtk_combo_new();
+ gtk_combo_set_value_in_list( GTK_COMBO(resolutionCombo), TRUE, FALSE );
+ gtk_combo_set_popdown_strings( GTK_COMBO(resolutionCombo), resolutionList );
+-
++
++ enableAnisotropicFilteringCheck = gtk_check_button_new_with_label( "Enable anisotropic filtering" );
+ enable2xSAICheck = gtk_check_button_new_with_label( "Enable 2xSAI texture scaling" );
+ forceBilinearCheck = gtk_check_button_new_with_label( "Force bilinear filtering" );
+ enableFogCheck = gtk_check_button_new_with_label( "Enable fog" );
+@@ -335,6 +339,9 @@
+ // row 4
+ gtk_table_attach_defaults( GTK_TABLE(displayTable), enable2xSAICheck, 0, 1, 4, 5 );
+ gtk_table_attach_defaults( GTK_TABLE(displayTable), enablePolygonStippleCheck, 1, 2, 4, 5 );
++
++ // row 5
++ gtk_table_attach_defaults( GTK_TABLE(displayTable), enableAnisotropicFilteringCheck, 0, 1, 5, 6);
+
+ // textures frame
+ texturesFrame = gtk_frame_new( "Textures" );
+@@ -404,6 +411,7 @@
+ // OGL.windowedBits = 0;
+ OGL.forceBilinear = 0;
+ OGL.enable2xSaI = 0;
++ OGL.enableAnisotropicFiltering = 0;
+ OGL.fog = 1;
+ OGL.textureBitDepth = 1; // normal (16 & 32 bits)
+ OGL.frameBufferTextures = 0;
+@@ -472,6 +480,10 @@
+ {
+ OGL.enable2xSaI = atoi( val );
+ }
++ else if (!strcasecmp( line, "enable anisotropic"))
++ {
++ OGL.enableAnisotropicFiltering = atoi( val );
++ }
+ else if (!strcasecmp( line, "enable fog" ))
+ {
+ OGL.fog = atoi( val );
+diff -u glN64/OpenGL.h /home/braddabug/mupen64/glN64/OpenGL.h
+--- glN64/OpenGL.h 2005-08-26 14:52:17.000000000 -0500
++++ /home/braddabug/mupen64/glN64/OpenGL.h 2006-12-24 21:43:46.000000000 -0600
+@@ -72,6 +72,7 @@
+ int maxGeneralCombiners;
+
+ BOOL enable2xSaI;
++ BOOL enableAnisotropicFiltering;
+ BOOL frameBufferTextures;
+ int textureBitDepth;
+ float originAdjust;
+diff -u glN64/Textures.cpp /home/braddabug/mupen64/glN64/Textures.cpp
+--- glN64/Textures.cpp 2005-08-26 14:52:17.000000000 -0500
++++ /home/braddabug/mupen64/glN64/Textures.cpp 2006-12-24 21:57:42.000000000 -0600
+@@ -748,6 +748,10 @@
+ // Set clamping modes
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->clampS ? GL_CLAMP_TO_EDGE : GL_REPEAT );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->clampT ? GL_CLAMP_TO_EDGE : GL_REPEAT );
++
++ // Anisotropic filtering
++ if (OGL.enableAnisotropicFiltering)
++ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 4.0f);
+
+ texture->lastDList = RSP.DList;
--- /dev/null
+diff -ruN mupen64_src-0.5.orig/Makefile mupen64_src-0.5/Makefile
+--- mupen64_src-0.5.orig/Makefile 2005-08-26 21:52:13.000000000 +0200
++++ mupen64_src-0.5/Makefile 2007-03-21 19:24:30.000000000 +0100
+@@ -1,16 +1,19 @@
+ #Makefile MUPEN64 for Linux
+
+-CC =gcc
+-CXX =g++
++CC ?=gcc
++CXX ?=g++
+
+ #CFLAGS =-DX86 -O3 -mpentium -Wall -DEMU64_DEBUG
+-CFLAGS =-DX86 -O3 -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -ffast-math -fno-strict-aliasing -mcpu=athlon -Wall -pipe
++CFLAGS ?=-DX86 -O3 -fexpensive-optimizations -fomit-frame-pointer -funroll-loops -ffast-math -fno-strict-aliasing -mcpu=athlon -Wall -pipe
+ #CFLAGS =-DX86 -O3 -mcpu=pentium -Wall -g -pg
+ #CFLAGS =-DX86 -Wall -pipe -g3 -DEMU64_DEBUG
+ #CFLAGS =-DX86 -Wall -pipe -g -DEMU64_DEBUG -DCOMPARE_CORE
+ #CFLAGS =-DX86 -Wall -pipe -g
+
+-CXXFLAGS =$(CFLAGS)
++CFLAGS += -fPIC
++CXXFLAGS += -fPIC
++
++CXXFLAGS ?=$(CFLAGS)
+
+ GL_PATH =-I/usr/X11R6/include
+
+@@ -80,7 +83,6 @@
+ OBJ_INPUT =mupen64_input/main.o
+
+ OBJ_BLIGHT =blight_input/plugin.o \
+- blight_input/SDL_ttf.o \
+ blight_input/arial.ttf.o \
+ blight_input/configdialog_sdl.o \
+ blight_input/pad.o
+@@ -166,7 +168,12 @@
+ endif
+
+ PREFIX =$(shell grep WITH_HOME config.h | cut -d '"' -f 2)
+-SHARE ="$(PREFIX)share/mupen64/"
++SHARE =$(shell grep "define SHARE" config.h | cut -d '"' -f 2)
++
++ifeq ("$(SHARE)","")
++SHARE ="$(PREFIX)/share/mupen64/"
++CFLAGS += -DSHARE=\"$(SHARE)\"
++endif
+
+ PLUGINS =plugins/mupen64_input.so plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
+
+@@ -223,9 +230,6 @@
+ blight_input/plugin.o: blight_input/plugin.c
+ $(CC) $(CFLAGS) "-DPACKAGE=\"$(shell grep PACKAGE blight_input/package | cut -d "=" -f 2)\"" "-DVERSION=\"$(shell grep VERSION blight_input/package | cut -d "=" -f 2)\"" `sdl-config --cflags` -DGUI_SDL -c -o $@ $<
+
+-blight_input/SDL_ttf.o: blight_input/SDL_ttf.c
+- $(CC) $(CFLAGS) `freetype-config --cflags` `sdl-config --cflags` -c -o $@ $<
+-
+ blight_input/arial.ttf.o: blight_input/arial.ttf.c
+
+ blight_input/arial.ttf.c: blight_input/ttftoh
+@@ -234,7 +238,6 @@
+
+ blight_input/ttftoh: blight_input/ttftoh.o
+ $(CC) $^ -o $@
+- strip --strip-all $@
+
+ blight_input/configdialog_sdl.o: blight_input/configdialog_sdl.c
+ $(CC) $(CFLAGS) "-DPACKAGE=\"$(shell grep PACKAGE blight_input/package | cut -d "=" -f 2)\"" "-DVERSION=\"$(shell grep VERSION blight_input/package | cut -d "=" -f 2)\"" -DGUI_SDL `sdl-config --cflags` -c -o $@ $<
+@@ -343,56 +346,44 @@
+
+ mupen64_nogui: $(OBJ) $(OBJ_X86) main/main.o main/gui_gtk/config.o
+ $(CC) $^ $(LIB) -Wl,-export-dynamic -L/usr/X11R6/lib `sdl-config --libs` -lGL -lpthread -ldl -o $@
+- strip --strip-all $@
+
+ ifneq ("$(shell grep VCR config.h)","\#define VCR_SUPPORT 1")
+
+ mupen64: $(OBJ) $(OBJ_X86) $(OBJ_GTK_GUI)
+ $(CC) $^ $(CFLAGS) $(LIB) -Wl,-export-dynamic $(GTK_LIBS) -L/usr/X11R6/lib `sdl-config --libs` -lGL -lpthread -ldl -o $@
+- strip --strip-all $@
+
+ else
+
+ mupen64: $(OBJ) $(OBJ_X86) $(OBJ_GTK_GUI) $(OBJ_VCR)
+ $(CXX) $^ $(CFLAGS) $(LIB) -Wl,-export-dynamic $(GTK_LIBS) `avifile-config --libs` `sdl-config --libs` -L/usr/X11R6/lib -lGL -lpthread -ldl -o $@
+- strip --strip-all $@
+ endif
+
+ mupen64_oldgui: $(OBJ) $(OBJ_X86) main/main_gtk.o
+ $(CC) $^ $(LIB) -Wl,-export-dynamic $(GTK_LIBS) `sdl-config --libs` -L/usr/X11R6/lib -lGL -lpthread -ldl -o $@
+- strip --strip-all $@
+
+ plugins/mupen64_input.so: $(OBJ_INPUT)
+ $(CC) $^ -Wl,-Bsymbolic -shared $(GTK_LIBS) -o $@
+- strip --strip-all $@
+
+ plugins/blight_input.so: $(OBJ_BLIGHT)
+- $(CC) $^ -Wl,-Bsymbolic -shared `sdl-config --libs` `freetype-config --libs` -o $@
+- strip --strip-all $@
++ $(CC) $^ -Wl,-Bsymbolic -shared `sdl-config --libs` -lSDL_ttf -o $@
+
+ plugins/mupen64_hle_rsp_azimer.so: $(OBJ_RSPHLE)
+ $(CXX) $^ -Wl,-Bsymbolic -shared $(GTK_LIBS) -o $@
+- strip --strip-all $@
+
+ plugins/dummyaudio.so: $(OBJ_DUMMY)
+ $(CC) $^ -Wl,-Bsymbolic -shared -o $@
+- strip --strip-all $@
+
+ plugins/mupen64_audio.so: $(OBJ_AUDIO)
+ $(CC) $(GTK_LIBS) -lpthread $^ -Wl,-Bsymbolic -shared -o $@
+- strip --strip-all $@
+
+ plugins/jttl_audio.so: $(OBJ_JTTL)
+ $(CC) $^ -Wl,-Bsymbolic -shared `sdl-config --libs` $(GTK_LIBS) -o $@
+- strip --strip-all $@
+
+ plugins/mupen64_soft_gfx.so: $(OBJ_SOFT_GFX)
+ $(CXX) `sdl-config --libs` $^ -Wl,-Bsymbolic -shared -o $@
+- strip --strip-all $@
+
+ plugins/glN64.so: $(OBJ_GLN64)
+ $(CXX) $^ -Wl,-Bsymbolic -shared $(GTK_LIBS) $(GTHREAD_LIBS) `sdl-config --libs` -lGL -o $@
+- strip --strip-all $@
+
+ install:
+ cp mupen64 "$(PREFIX)bin"
+@@ -405,7 +396,7 @@
+
+ clean:
+ find . -name '*.o' -print0 | xargs -0r rm -f
+- rm mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
++ rm -f mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
+
+ clean_o:
+ find . -name '*.o' -print0 | xargs -0r rm -f
+File mupen64_src-0.5.orig/compare_pipe is a fifo while file mupen64_src-0.5/compare_pipe is a fifo
+diff -ruN mupen64_src-0.5.orig/config.h mupen64_src-0.5/config.h
+--- mupen64_src-0.5.orig/config.h 2005-08-26 21:52:14.000000000 +0200
++++ mupen64_src-0.5/config.h 2007-03-21 19:22:58.000000000 +0100
+@@ -2,6 +2,7 @@
+ #define CONFIG_H
+
+ #undef WITH_HOME
++#undef SHARE
+ #undef VCR_SUPPORT
+ #define GTK2_SUPPORT 1
+
+diff -ruN mupen64_src-0.5.orig/main/gui_gtk/main_gtk.c mupen64_src-0.5/main/gui_gtk/main_gtk.c
+--- mupen64_src-0.5.orig/main/gui_gtk/main_gtk.c 2005-08-26 22:08:13.000000000 +0200
++++ mupen64_src-0.5/main/gui_gtk/main_gtk.c 2007-03-21 19:22:58.000000000 +0100
+@@ -1880,8 +1880,8 @@
+ {
+ unsigned char byte;
+ dest = fopen(temp, "wb");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/mupen64.ini");
++ strcpy(orig, SHARE);
++ strcat(orig, "mupen64.ini");
+ src = fopen(orig, "rb");
+ while(fread(&byte, 1, 1, src))
+ fwrite(&byte, 1, 1, dest);
+@@ -1892,28 +1892,28 @@
+
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "lang");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/lang");
++ strcpy(orig, SHARE);
++ strcat(orig, "lang");
+ symlink(orig, temp);
+
+ /*strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins");
+ symlink(orig, temp);*/
+
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins");
+ mkdir(temp, 0700);
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins");
+ dir = opendir(orig);
+ while((entry = readdir(dir)) != NULL)
+ {
+ if(strcmp(entry->d_name + strlen(entry->d_name) - 3, ".so"))
+ {
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins/");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins/");
+ strcat(orig, entry->d_name);
+ src = fopen(orig, "rb");
+ if(src == NULL) continue;
+@@ -1938,8 +1938,8 @@
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins/");
+ strcat(temp, entry->d_name);
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins/");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins/");
+ strcat(orig, entry->d_name);
+ symlink(orig, temp);
+ }
+diff -ruN mupen64_src-0.5.orig/main/main.c mupen64_src-0.5/main/main.c
+--- mupen64_src-0.5.orig/main/main.c 2005-08-26 21:52:11.000000000 +0200
++++ mupen64_src-0.5/main/main.c 2007-03-21 19:22:58.000000000 +0100
+@@ -37,6 +37,8 @@
+
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <dirent.h>
++#include <sys/stat.h>
+
+ #include "main.h"
+ #include "guifuncs.h"
+@@ -262,8 +264,8 @@
+ {
+ unsigned char byte;
+ dest = fopen(temp, "wb");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/mupen64.ini");
++ strcpy(orig, SHARE);
++ strcat(orig, "mupen64.ini");
+ src = fopen(orig, "rb");
+ while(fread(&byte, 1, 1, src))
+ fwrite(&byte, 1, 1, dest);
+@@ -274,28 +276,28 @@
+
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "lang");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/lang");
++ strcpy(orig, SHARE);
++ strcat(orig, "lang");
+ symlink(orig, temp);
+
+ /*strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins");
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins");
+ symlink(orig, temp);*/
+
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins");
+ mkdir(temp, 0700);
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins");
+ dir = opendir(orig);
+ while((entry = readdir(dir)) != NULL)
+ {
+ if(strcmp(entry->d_name + strlen(entry->d_name) - 3, ".so"))
+ {
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins/");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins/");
+ strcat(orig, entry->d_name);
+ src = fopen(orig, "rb");
+ if(src == NULL) continue;
+@@ -320,8 +322,8 @@
+ strcpy(temp, g_WorkingDir);
+ strcat(temp, "plugins/");
+ strcat(temp, entry->d_name);
+- strcpy(orig, WITH_HOME);
+- strcat(orig, "share/mupen64/plugins/");
++ strcpy(orig, SHARE);
++ strcat(orig, "plugins/");
+ strcat(orig, entry->d_name);
+ symlink(orig, temp);
+ }
--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64/mupen64-0.5-r3.ebuild,v 1.1 2007/03/27 15:17:01 joker Exp $
+
+inherit eutils multilib games
+
+MY_P=${PN}_src-${PV}
+DESCRIPTION="A Nintendo 64 (N64) emulator"
+HOMEPAGE="http://mupen64.emulation64.com/"
+SRC_URI="http://mupen64.emulation64.com/files/${PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="virtual/opengl
+ >=x11-libs/gtk+-2
+ media-libs/libsdl
+ media-libs/sdl-ttf
+ amd64? (
+ app-emulation/emul-linux-x86-gtklibs
+ >=app-emulation/emul-linux-x86-sdl-10.0
+ )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ !games-emulation/mupen64-blight-input
+ !games-emulation/mupen64-glN64
+ !games-emulation/mupen64-jttl_sound"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ has_multilib_profile && multilib_toolchain_setup x86
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ rm -f plugins/empty blight_input/SDL_ttf*
+
+ epatch \
+ "${FILESDIR}"/${P}-anisotropic.patch \
+ "${FILESDIR}"/${P}-gentoo3.patch
+
+ sed -i \
+ -e "s:#undef WITH_HOME:#define WITH_HOME \"$(games_get_libdir)/\":" \
+ -e "s:#undef SHARE:#define SHARE \"$(games_get_libdir)/${PN}/\":" \
+ config.h \
+ || die "sed failed"
+}
+
+src_compile() {
+ local t
+ for t in \
+ mupen64 \
+ mupen64_nogui \
+ plugins/mupen64_input.so \
+ plugins/blight_input.so \
+ plugins/mupen64_hle_rsp_azimer.so \
+ plugins/dummyaudio.so \
+ plugins/mupen64_audio.so \
+ plugins/jttl_audio.so \
+ plugins/mupen64_soft_gfx.so \
+ plugins/glN64.so
+ do
+ emake ${t} || die "emake ${t} failed"
+ done
+}
+
+src_install() {
+ dogamesbin mupen64 mupen64_nogui || die "dogamesbin failed"
+
+ insinto "$(games_get_libdir)/${PN}"
+ doins -r mupen64.ini jttl_audio.conf lang roms plugins || die "doins failed"
+
+ dodoc *.txt doc/readme.pdf
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ echo
+ ewarn "If you are upgrading from a previous version of mupen64,"
+ ewarn "backup your saved games then run rm -rf on your"
+ ewarn ".mupen64 directory. After launching the new version, copy"
+ ewarn "your saved games to their original place."
+ echo
+}