glide64 plugin fixes
authorDaniel Goller <morfic@gentoo.org>
Sat, 8 Jan 2005 00:49:56 +0000 (00:49 +0000)
committerDaniel Goller <morfic@gentoo.org>
Sat, 8 Jan 2005 00:49:56 +0000 (00:49 +0000)
games-emulation/mupen64-glide64/ChangeLog
games-emulation/mupen64-glide64/Manifest
games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch
games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch [new file with mode: 0644]
games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild

index 3cdac04c83a7b5e5d2055b117de0fe4d5cd218bd..c7dccbd890208a9d2280604d1c6838eb9cc98835 100644 (file)
@@ -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 <morfic@gentoo.org>
+  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 <morfic@gentoo.org> metadata.xml:
   Adding maintainer
index b982f039e05b2169ad4f88229ca9a680217047d1..0874110e2657280bb326ecaef07bb3af5fbaf687 100644 (file)
@@ -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-----
index 1939ac45d97cb753c1be3f53534e0116e9522c6e..1767be7bc2cd769b3afe3a4e8dd1ed2b73030652 100644 (file)
@@ -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)\r
- {\r
-    ConfigDialog *configDialog = (ConfigDialog*)data;\r
--   char *s;\r
-+   const gchar *s;\r
-    int i,n=0;\r
-    \r
-    s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(configDialog->windowResCombo)->entry));\r
---- 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)\r
+ {\r
+    ConfigDialog *configDialog = (ConfigDialog*)data;\r
+-   char *s;\r
++   const gchar *s;\r
+    int i,n=0;\r
+    \r
+    s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(configDialog->windowResCombo)->entry));\r
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 (file)
index 0000000..b9ebdcf
--- /dev/null
@@ -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 <stdlib.h>\r
+ #endif // _WIN32\r
+ \r
++#include <features.h>\r
++#include <dlfcn.h>\r
++#include <errno.h>\r
++#include <limits.h>\r
++\r
+ BOOL INI_Open ()\r
+ {\r
+       // Get the path of the dll, ex: C:\Games\Project64\Plugin\Glide64.dll\r
+-      char path[256];\r
+-#ifdef _WIN32\r
+-      GetModuleFileName (hInstance, path, 256);\r
+-#else // _WIN32\r
+-   int n = readlink("/proc/self/exe", path, 256);\r
+-   if (n == -1) strcpy(path, "./");\r
+-#endif // _WIN32\r
+-\r
+-      // Find the previous backslash\r
+-      int i;\r
+-      for (i=strlen(path)-1; i>0; i--)\r
++      char path[PATH_MAX];\r
++   \r
++      \r
++#ifdef __USE_GNU\r
++      Dl_info info;\r
++      void *addr = (void *)INI_Open;\r
++      //__asm__( "movl %%eip, %%eax" : "=a"(addr) );\r
++      if (dladdr( addr, &info ) != 0)\r
+       {\r
+-#ifdef _WIN32\r
+-              if (path[i] == '\\')\r
+-#else // _WIN32\r
+-              if (path[i] == '/')\r
+-#endif // _WIN32\r
+-                      break;\r
++              strncpy( path, info.dli_fname, PATH_MAX );\r
++              *(strrchr( path, '/' )) = '\0';\r
+       }\r
+-      if (path == 0) return FALSE;\r
+-      path[i+1] = 0;\r
+-\r
+-#ifndef _WIN32\r
+-   strcat(path, "plugins/");\r
+-#endif // _WIN32\r
+-   \r
+-      strcat (path, "Glide64.ini");\r
+-   \r
++      else\r
++      {\r
++              fprintf( stderr, "(WW) Couldn't get path of .so, trying to get emulator's path\n" );\r
++#endif // __USE_GNU\r
++              if (readlink( "/proc/self/exe", path, PATH_MAX ) == -1)\r
++              {\r
++                      fprintf( stderr, "(WW) readlink() /proc/self/exe failed: %s\n", strerror( errno ) );\r
++                      path[0] = '.';\r
++                      path[1] = '\0';\r
++              }\r
++              *(strrchr( path, '/' )) = '\0';\r
++              strncat( path, "/plugins", PATH_MAX );\r
++#ifdef __USE_GNU\r
++      }\r
++#endif\r
++      strncat( path, "/Glide64.ini", PATH_MAX );\r
+       // Open the file\r
+         ini = fopen (path, "r+b");\r
+       if (ini == NULL)\r
index 568c5f664423a798c0c0979093ec1142aac53e69..84a80c94c2163b921a8ea98f28f34e622e8572bb 100644 (file)
@@ -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"