summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Goller <morfic@gentoo.org>2005-01-08 00:49:56 +0000
committerDaniel Goller <morfic@gentoo.org>2005-01-08 00:49:56 +0000
commitd3248c5b26756c4307446b8013c7b5cb1c62c87c (patch)
treee8f8cf92ad3c2414e047bad000761a88e5a1eef4 /games-emulation
parent Initial import as per bug #76941 (Manifest recommit) (diff)
downloadgentoo-2-d3248c5b26756c4307446b8013c7b5cb1c62c87c.tar.gz
gentoo-2-d3248c5b26756c4307446b8013c7b5cb1c62c87c.tar.bz2
gentoo-2-d3248c5b26756c4307446b8013c7b5cb1c62c87c.zip
glide64 plugin fixes
Diffstat (limited to 'games-emulation')
-rw-r--r--games-emulation/mupen64-glide64/ChangeLog7
-rw-r--r--games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-gtk2.patch40
-rw-r--r--games-emulation/mupen64-glide64/files/mupen64-glide64-0.7-inifix.patch71
-rw-r--r--games-emulation/mupen64-glide64/mupen64-glide64-0.7.ebuild9
4 files changed, 108 insertions, 19 deletions
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 <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
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 <stdlib.h>
+ #endif // _WIN32
+
++#include <features.h>
++#include <dlfcn.h>
++#include <errno.h>
++#include <limits.h>
++
+ 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"