summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-emulation')
-rw-r--r--games-emulation/mupen64/ChangeLog9
-rw-r--r--games-emulation/mupen64/files/digest-mupen64-0.5-r33
-rw-r--r--games-emulation/mupen64/files/mupen64-0.5-anisotropic.patch108
-rw-r--r--games-emulation/mupen64/files/mupen64-0.5-gentoo3.patch279
-rw-r--r--games-emulation/mupen64/mupen64-0.5-r3.ebuild89
5 files changed, 487 insertions, 1 deletions
diff --git a/games-emulation/mupen64/ChangeLog b/games-emulation/mupen64/ChangeLog
index 498be2dc14e1..fd89841f5ad2 100644
--- a/games-emulation/mupen64/ChangeLog
+++ b/games-emulation/mupen64/ChangeLog
@@ -1,6 +1,13 @@
# 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
diff --git a/games-emulation/mupen64/files/digest-mupen64-0.5-r3 b/games-emulation/mupen64/files/digest-mupen64-0.5-r3
new file mode 100644
index 000000000000..f5e4ac023a01
--- /dev/null
+++ b/games-emulation/mupen64/files/digest-mupen64-0.5-r3
@@ -0,0 +1,3 @@
+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
diff --git a/games-emulation/mupen64/files/mupen64-0.5-anisotropic.patch b/games-emulation/mupen64/files/mupen64-0.5-anisotropic.patch
new file mode 100644
index 000000000000..7291ff660300
--- /dev/null
+++ b/games-emulation/mupen64/files/mupen64-0.5-anisotropic.patch
@@ -0,0 +1,108 @@
+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;
diff --git a/games-emulation/mupen64/files/mupen64-0.5-gentoo3.patch b/games-emulation/mupen64/files/mupen64-0.5-gentoo3.patch
new file mode 100644
index 000000000000..047fe8c13119
--- /dev/null
+++ b/games-emulation/mupen64/files/mupen64-0.5-gentoo3.patch
@@ -0,0 +1,279 @@
+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);
+ }
diff --git a/games-emulation/mupen64/mupen64-0.5-r3.ebuild b/games-emulation/mupen64/mupen64-0.5-r3.ebuild
new file mode 100644
index 000000000000..eb450e56075a
--- /dev/null
+++ b/games-emulation/mupen64/mupen64-0.5-r3.ebuild
@@ -0,0 +1,89 @@
+# 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
+}