From 5155f9c69dbe8b1919a1aaf6553fd0987484df91 Mon Sep 17 00:00:00 2001 From: Daniel Goller Date: Sat, 8 Jan 2005 00:49:56 +0000 Subject: [PATCH] glide64 plugin fixes --- games-emulation/mupen64-glide64/ChangeLog | 7 +- games-emulation/mupen64-glide64/Manifest | 13 ++-- .../files/mupen64-glide64-0.7-gtk2.patch | 40 +++++++---- .../files/mupen64-glide64-0.7-inifix.patch | 71 +++++++++++++++++++ .../mupen64-glide64-0.7.ebuild | 9 ++- 5 files changed, 115 insertions(+), 25 deletions(-) create mode 100644 games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch diff --git a/games-emulation/mupen64-glide64/ChangeLog b/games-emulation/mupen64-glide64/ChangeLog index 3cdac04c83a7..c7dccbd89020 100644 --- a/games-emulation/mupen64-glide64/ChangeLog +++ b/games-emulation/mupen64-glide64/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for games-emulation/mupen64-glide64 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64-glide64/ChangeLog,v 1.2 2005/01/07 22:51:44 morfic Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64-glide64/ChangeLog,v 1.3 2005/01/08 00:49:56 morfic Exp $ + + 07 Jan 2005; Daniel Goller + files/mupen64-glide64-0.7-gtk2.patch, + +files/mupen64-glide64-0.7-inifix.patch, mupen64-glide64-0.7.ebuild: + Updated gtk2 patch and added inifix patch, glide64 plugin now works properly 07 Jan 2005; Daniel Goller metadata.xml: Adding maintainer diff --git a/games-emulation/mupen64-glide64/Manifest b/games-emulation/mupen64-glide64/Manifest index b982f039e05b..0874110e2657 100644 --- a/games-emulation/mupen64-glide64/Manifest +++ b/games-emulation/mupen64-glide64/Manifest @@ -1,16 +1,17 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -MD5 48e2705e2f1ece236069e56cfd10e337 mupen64-glide64-0.7.ebuild 1004 -MD5 48ce878150dc3523192d810a2056aad7 ChangeLog 586 +MD5 081b8b081441a711e53f509e2279bcfe mupen64-glide64-0.7.ebuild 1162 +MD5 57a910be8dd6d508fae4f748cebb1b22 ChangeLog 826 MD5 a3e62bf537d9a02609601aa9ba76da7e metadata.xml 247 MD5 2f68b9e4d03102e87c1b845f4112b051 files/mupen64-glide64-0.7-compile.patch 4677 -MD5 42c247074d570fc3665a11d129a2e0d1 files/mupen64-glide64-0.7-gtk2.patch 1231 +MD5 791bcffd2d51c09bb816d5449bf5ca91 files/mupen64-glide64-0.7-gtk2.patch 1544 MD5 ea5cfac2f37f3bea3a5a9ac9b6c06854 files/digest-mupen64-glide64-0.7 67 +MD5 b64d5727662ec96a6a14bf92476c74a5 files/mupen64-glide64-0.7-inifix.patch 1801 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) -iD8DBQFB3xLHUpKYMelfdYERAijdAKCAu90iJR+lSo3tEJSpOKjxDGzj3gCghwbr -8zAhyMidpt1Bpf+iX87VMSM= -=ojA7 +iD8DBQFB3y55UpKYMelfdYERAqJWAJ4rDrCOiXLoCUh14YDxahIYBk9poACcDt5V +5Jw4f1Skmo4IEc8op/Fyjyw= +=Bh+p -----END PGP SIGNATURE----- diff --git a/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch b/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch index 1939ac45d97c..1767be7bc2cd 100644 --- a/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch +++ b/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch @@ -1,27 +1,37 @@ ---- glide64_0_7_ME/Config.cpp.old 2005-01-02 13:21:06.399041458 -0800 -+++ glide64_0_7_ME/Config.cpp 2005-01-02 13:21:09.975475355 -0800 -@@ -594,7 +594,7 @@ - static void okButtonCallback(GtkWidget *widget, void *data) - { - ConfigDialog *configDialog = (ConfigDialog*)data; -- char *s; -+ const gchar *s; - int i,n=0; - - s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(configDialog->windowResCombo)->entry)); ---- glide64_0_7_ME/Makefile.old 2005-01-02 13:17:39.755824013 -0800 -+++ glide64_0_7_ME/Makefile 2005-01-02 13:19:39.914670229 -0800 +--- glide64_0_7_ME/Makefile.old 2005-01-07 13:22:18.878299788 -0800 ++++ glide64_0_7_ME/Makefile 2005-01-07 13:23:09.289287824 -0800 @@ -1,11 +1,11 @@ CC = gcc #CFLAGS = -DUSE_GTK `sdl-config --cflags` `gtk-config --cflags` -Iwrapper/ -g -mmmx -msse #CFLAGS = -DUSE_GTK `sdl-config --cflags` `gtk-config --cflags` -Iwrapper/ -O3 -mcpu=athlon -ffast-math -funroll-loops -fomit-frame-pointer -msse -mmmx -CFLAGS = -DUSE_GTK -DGL_GLEXT_PROTOTYPES `sdl-config --cflags` `gtk-config --cflags` -Iwrapper/ -+CFLAGS = -DUSE_GTK -DGL_GLEXT_PROTOTYPES `sdl-config --cflags` `pkg-config --cflags gtk+-2.0` -D_GTK2 -Iwrapper/ ++CFLAGS = -DGL_GLEXT_PROTOTYPES `sdl-config --cflags` `pkg-config --cflags gtk+-2.0 glib-2.0` -D_GTK2 -Iwrapper/ CXX = g++ CPPFLAGS = $(CFLAGS) LD = g++ -LDFLAGS = -lGL -lGLU -L/usr/X11R6/lib -lSDL -+LDFLAGS = -lGL -lGLU -L/usr/X11R6/lib -lSDL `pkg-config --libs gtk+-2.0` ++LDFLAGS = -lGL -lGLU `sdl-config --libs` `pkg-config --libs gtk+-2.0 glib-2.0` OBJECTS = Main.o \ rdp.o \ +@@ -30,8 +30,7 @@ + all: Glide64.so instruction + + Glide64.so: font.h cursor.h $(OBJECTS) +- $(LD) -shared -Wl,-Bsymbolic `gtk-config --libs` $(LDFLAGS) -o $@ $(OBJECTS) +- strip --strip-all $@ ++ $(LD) -shared -Wl,-Bsymbolic $(LDFLAGS) -o $@ $(OBJECTS) + + font.h: compiletex + ./compiletex font.tex font.h font +--- glide64_0_7_ME/Config.cpp.old 2005-01-07 13:30:42.498170544 -0800 ++++ glide64_0_7_ME/Config.cpp 2005-01-07 13:31:07.818666816 -0800 +@@ -594,7 +594,7 @@ + static void okButtonCallback(GtkWidget *widget, void *data) + { + ConfigDialog *configDialog = (ConfigDialog*)data; +- char *s; ++ const gchar *s; + int i,n=0; + + s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(configDialog->windowResCombo)->entry)); diff --git a/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch b/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch new file mode 100644 index 000000000000..b9ebdcff536d --- /dev/null +++ b/games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch @@ -0,0 +1,71 @@ +--- glide64_0_7_ME/Ini.cpp.old 2005-01-07 15:50:22.232410116 -0800 ++++ glide64_0_7_ME/Ini.cpp 2005-01-07 15:58:03.491450616 -0800 +@@ -49,37 +49,42 @@ + #include + #endif // _WIN32 + ++#include ++#include ++#include ++#include ++ + BOOL INI_Open () + { + // Get the path of the dll, ex: C:\Games\Project64\Plugin\Glide64.dll +- char path[256]; +-#ifdef _WIN32 +- GetModuleFileName (hInstance, path, 256); +-#else // _WIN32 +- int n = readlink("/proc/self/exe", path, 256); +- if (n == -1) strcpy(path, "./"); +-#endif // _WIN32 +- +- // Find the previous backslash +- int i; +- for (i=strlen(path)-1; i>0; i--) ++ char path[PATH_MAX]; ++ ++ ++#ifdef __USE_GNU ++ Dl_info info; ++ void *addr = (void *)INI_Open; ++ //__asm__( "movl %%eip, %%eax" : "=a"(addr) ); ++ if (dladdr( addr, &info ) != 0) + { +-#ifdef _WIN32 +- if (path[i] == '\\') +-#else // _WIN32 +- if (path[i] == '/') +-#endif // _WIN32 +- break; ++ strncpy( path, info.dli_fname, PATH_MAX ); ++ *(strrchr( path, '/' )) = '\0'; + } +- if (path == 0) return FALSE; +- path[i+1] = 0; +- +-#ifndef _WIN32 +- strcat(path, "plugins/"); +-#endif // _WIN32 +- +- strcat (path, "Glide64.ini"); +- ++ else ++ { ++ fprintf( stderr, "(WW) Couldn't get path of .so, trying to get emulator's path\n" ); ++#endif // __USE_GNU ++ if (readlink( "/proc/self/exe", path, PATH_MAX ) == -1) ++ { ++ fprintf( stderr, "(WW) readlink() /proc/self/exe failed: %s\n", strerror( errno ) ); ++ path[0] = '.'; ++ path[1] = '\0'; ++ } ++ *(strrchr( path, '/' )) = '\0'; ++ strncat( path, "/plugins", PATH_MAX ); ++#ifdef __USE_GNU ++ } ++#endif ++ strncat( path, "/Glide64.ini", PATH_MAX ); + // Open the file + ini = fopen (path, "r+b"); + if (ini == NULL) diff --git a/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild b/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild index 568c5f664423..84a80c94c216 100644 --- a/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild +++ b/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild @@ -1,8 +1,8 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild,v 1.1 2005/01/03 15:36:18 morfic Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild,v 1.2 2005/01/08 00:49:56 morfic Exp $ -inherit games +inherit games flag-o-matic DESCRIPTION="An opengl graphics plugin for the mupen64 N64 emulator" HOMEPAGE="http://mupen64.emulation64.com/" @@ -11,14 +11,17 @@ SRC_URI="mirror://gentoo/glide64_0_7_ME.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" -IUSE="" +IUSE="gtk2" DEPEND="" S="${WORKDIR}/glide64_0_7_ME" src_compile() { + # gcc 3.4 at least has a problem with -O3 and inline asm + replace-flags -O3 -O2 epatch ${FILESDIR}/${P}-compile.patch || die "patch failed" + epatch ${FILESDIR}/${P}-inifix.patch || die "patch failed" use gtk2 && epatch ${FILESDIR}/${P}-gtk2.patch || die "patch failed" make clean || die "couldn't clean" -- 2.26.2