diff options
author | Michael Sterrett <mr_bones_@gentoo.org> | 2008-02-09 06:18:35 +0000 |
---|---|---|
committer | Michael Sterrett <mr_bones_@gentoo.org> | 2008-02-09 06:18:35 +0000 |
commit | 69e426a0ff929afc5edd90ae89e24976c97c650a (patch) | |
tree | e1bc606e91fba6f9ef4e01b8b6322381595d163a /games-emulation | |
parent | Fix libcaca to work with slang 2.1.3. (diff) | |
download | gentoo-2-69e426a0ff929afc5edd90ae89e24976c97c650a.tar.gz gentoo-2-69e426a0ff929afc5edd90ae89e24976c97c650a.tar.bz2 gentoo-2-69e426a0ff929afc5edd90ae89e24976c97c650a.zip |
version bump (bug #139347) with lots of patch work from Justin Blanchard
(Portage version: 2.1.3.19)
Diffstat (limited to 'games-emulation')
-rw-r--r-- | games-emulation/snes9x/ChangeLog | 12 | ||||
-rw-r--r-- | games-emulation/snes9x/files/snes9x-1.51-build.patch | 18 | ||||
-rw-r--r-- | games-emulation/snes9x/files/snes9x-1.51-config.patch | 13 | ||||
-rw-r--r-- | games-emulation/snes9x/files/snes9x-1.51-opengl.patch | 103 | ||||
-rw-r--r-- | games-emulation/snes9x/files/snes9x-1.51-x11.patch | 176 | ||||
-rw-r--r-- | games-emulation/snes9x/snes9x-1.51.ebuild (renamed from games-emulation/snes9x/snes9x-1.43-r1.ebuild) | 69 |
6 files changed, 354 insertions, 37 deletions
diff --git a/games-emulation/snes9x/ChangeLog b/games-emulation/snes9x/ChangeLog index 380eb55a00ac..45127847f764 100644 --- a/games-emulation/snes9x/ChangeLog +++ b/games-emulation/snes9x/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for games-emulation/snes9x -# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/ChangeLog,v 1.29 2007/10/09 14:40:41 angelos Exp $ +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/ChangeLog,v 1.30 2008/02/09 06:18:35 mr_bones_ Exp $ + +*snes9x-1.51 (09 Feb 2008) + + 09 Feb 2008; Michael Sterrett <mr_bones_@gentoo.org> + +files/snes9x-1.51-build.patch, +files/snes9x-1.51-config.patch, + +files/snes9x-1.51-opengl.patch, +files/snes9x-1.51-x11.patch, + -snes9x-1.43-r1.ebuild, +snes9x-1.51.ebuild: + version bump (bug #139347) with lots of patch work from Justin Blanchard 09 Oct 2007; Christoph Mende <angelos@gentoo.org> snes9x-1.43-r2.ebuild: Stable on amd64 wrt bug #193120 diff --git a/games-emulation/snes9x/files/snes9x-1.51-build.patch b/games-emulation/snes9x/files/snes9x-1.51-build.patch new file mode 100644 index 000000000000..d3bde6661559 --- /dev/null +++ b/games-emulation/snes9x/files/snes9x-1.51-build.patch @@ -0,0 +1,18 @@ +Make sure the build process respects our LDFLAGS (so we can slip in -m32) +and that the stupid custom OPTIMIZE flags arent used in favor of our own +CFLAGS (so we can slip in -m32). + +--- snes9x-1.51-src/Makefile.in ++++ snes9x-1.51-src/Makefile.in +@@ -17,4 +17,5 @@ + CHEATS=1 + 2XSAI=1 ++EXTRALIBS=@LDFLAGS@ + + #Fairly good and special-char-safe descriptor of the os being built on. +@@ -183,5 +184,5 @@ + CPUFLAGS=-ml -m4-single-only + else +-OPTIMISE = @OPTIMIZE@ ++OPTIMISE = @OPTIMIZE@ @CFLAGS@ + endif diff --git a/games-emulation/snes9x/files/snes9x-1.51-config.patch b/games-emulation/snes9x/files/snes9x-1.51-config.patch new file mode 100644 index 000000000000..1dd18a5446da --- /dev/null +++ b/games-emulation/snes9x/files/snes9x-1.51-config.patch @@ -0,0 +1,13 @@ +--- configure.in.old ++++ configure.in +@@ -506,9 +506,9 @@ + fi + ]) + ++AC_CHECK_HEADERS(zlib.h) + if test x$with_zlib = xyes ; then + SNES9X_FEATURE_NODEP(Gz) +- AC_CHECK_HEADERS(zlib.h) + if test $ac_cv_header_zlib_h = yes ; then + AC_MSG_CHECKING([if zlib.h is new enough]) + AC_TRY_LINK([ diff --git a/games-emulation/snes9x/files/snes9x-1.51-opengl.patch b/games-emulation/snes9x/files/snes9x-1.51-opengl.patch new file mode 100644 index 000000000000..d451f34a544e --- /dev/null +++ b/games-emulation/snes9x/files/snes9x-1.51-opengl.patch @@ -0,0 +1,103 @@ +--- snes9x-1.51-src/gfx.h ++++ snes9x-1.51-src/gfx.h +@@ -331,7 +331,7 @@ + + inline uint16 COLOR_SUB(uint16 C1, uint16 C2) + { +- uint16 mC1, mC2, v = 0; ++ uint16 mC1, mC2, v = ALPHA_BITS_MASK; + + mC1 = C1 & FIRST_COLOR_MASK; + mC2 = C2 & FIRST_COLOR_MASK; +--- snes9x-1.51-src/unix/opengl.cpp ++++ snes9x-1.51-src/unix/opengl.cpp +@@ -233,14 +233,14 @@ + + // Strip dots from the version string + char *ptr; +- while (ptr = strchr (ver, '.')) ++ while ( (ptr = strchr (ver, '.')) != 0) + memmove (ptr, ptr + 1, strlen (ptr + 1) + 1); + +- // Pad the string with zeros to 4 digits +- while (strlen (ver) < 4) +- strcat (ver, "0"); +- + OpenGL.version = atoi (ver); ++ ++ // Pad the number with zeros to 4 digits ++ while (OpenGL.version < 1000) ++ OpenGL.version *= 10; + } + else + OpenGL.version = 1100; +@@ -400,7 +400,7 @@ + int i = 0; + for (uint32 y = 0; y < pheight; y++) + { +- uint16 *ptr = (uint16 *) (GFX.Screen + (y + startl) * GFX.Pitch) + startx; ++ uint16 *ptr = (uint16 *) (GFX.Screen + (y + startl) * GFX.Pitch/2) + startx; + for (uint32 x = 0; x < pwidth; x++) + { + int color = *ptr++; +@@ -418,7 +418,7 @@ + for (uint32 y = 0; y < pheight; y++) + { + memmove (basetexbuffer + sizeof (uint16) * texture_size * y, +- (GFX.Screen + (y + startl) * GFX.Pitch) + startx, ++ (GFX.Screen + (y + startl) * GFX.Pitch/2) + startx, + sizeof (uint16) * texture_size); + } + data = basetexbuffer; +--- snes9x-1.51-src/unix/x11.cpp ++++ snes9x-1.51-src/unix/x11.cpp +@@ -572,15 +572,29 @@ + } + delete[] color_diff; + ++ GUI.cmap = XCreateColormap (GUI.display, RootWindowOfScreen (GUI.screen), ++ GUI.visual, GUI.pseudo ? AllocAll : AllocNone); ++ if (GUI.pseudo) ++ { ++ for (i = 0; i < 256; i++) ++ { ++ GUI.colors[i].red = GUI.colors[i].green = GUI.colors[i].blue = 0; ++ GUI.colors[i].pixel = i; ++ GUI.colors[i].flags = DoRed | DoGreen | DoBlue; ++ } ++ XStoreColors (GUI.display, GUI.cmap, GUI.colors, 256); ++ } ++ + XSetWindowAttributes attrib; + + attrib.background_pixel = BlackPixelOfScreen (GUI.screen); ++ attrib.colormap = GUI.cmap; + GUI.window = XCreateWindow (GUI.display, RootWindowOfScreen (GUI.screen), + (WidthOfScreen(GUI.screen) - GUI.window_width) / 2, + (HeightOfScreen(GUI.screen) - GUI.window_height) / 2, + GUI.window_width, GUI.window_height, 0, + GUI.depth, InputOutput, GUI.visual, +- CWBackPixel, &attrib); ++ CWBackPixel | CWColormap, &attrib); + + #ifdef USE_DGA_EXTENSION + CreateFullScreenWindow (); +@@ -625,18 +639,6 @@ + ButtonPressMask | ButtonReleaseMask); + #endif + +- if (GUI.pseudo) +- { +- GUI.cmap = XCreateColormap (GUI.display, GUI.window, GUI.visual, True); +- XSetWindowColormap (GUI.display, GUI.window, GUI.cmap); +- for (i = 0; i < 256; i++) +- { +- GUI.colors[i].red = GUI.colors[i].green = GUI.colors[i].blue = 0; +- GUI.colors[i].pixel = i; +- GUI.colors[i].flags = DoRed | DoGreen | DoBlue; +- } +- XStoreColors (GUI.display, GUI.cmap, GUI.colors, 256); +- } + XMapRaised (GUI.display, GUI.window); + XClearWindow (GUI.display, GUI.window); + SetupImage (); diff --git a/games-emulation/snes9x/files/snes9x-1.51-x11.patch b/games-emulation/snes9x/files/snes9x-1.51-x11.patch new file mode 100644 index 000000000000..5dae40cf4594 --- /dev/null +++ b/games-emulation/snes9x/files/snes9x-1.51-x11.patch @@ -0,0 +1,176 @@ +diff -Naur snes9x-1.51-src/unix/unix.cpp snes9x-1.51-src/unix/unix.cpp +--- snes9x-1.51-src/unix/unix.cpp 2007-05-11 01:51:58.000000000 -0700 ++++ snes9x-1.51-src/unix/unix.cpp 2007-05-11 01:52:09.000000000 -0700 +@@ -574,8 +574,6 @@ + S9xInitInputDevices (); + + S9xInitDisplay (argc, argv); +- if (!S9xGraphicsInit ()) +- OutOfMemory (); + S9xSetupDefaultKeymap(); + + S9xTextMode (); +@@ -748,6 +746,7 @@ + (*CleanUp7110)(); + + S9xSetSoundMute (TRUE); ++ S9xUnmapAllControls (); + S9xDeinitDisplay (); + Memory.SaveSRAM (S9xGetFilename (".srm", SRAM_DIR)); + S9xSaveCheatFile (S9xGetFilename (".cht", PATCH_DIR)); +diff -Naur snes9x-1.51-src/unix/x11.cpp snes9x-1.51-src/unix/x11.cpp +--- snes9x-1.51-src/unix/x11.cpp 2007-05-11 02:10:22.000000000 -0700 ++++ snes9x-1.51-src/unix/x11.cpp 2007-05-11 02:10:31.000000000 -0700 +@@ -275,6 +275,7 @@ + void Convert16To24 (int width, int height); + void Convert16To24Packed (int width, int height); + void SetupImage (); ++void TakedownImage (); + int ErrorHandler (Display *, XErrorEvent *); + void TVMode (int width, int height); + +@@ -314,36 +315,7 @@ + #endif + + S9xTextMode (); +- uint32 i; +- +- for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) +- if (GUI.to_free [i]) +- { +- free (GUI.to_free [i]); +- GUI.to_free [i] = NULL; +- } +- +- if (GUI.image) +- { +-#ifdef MITSHM +- if (GUI.use_shared_memory) +- { +- XShmDetach (GUI.display, &GUI.sm_info); +- GUI.image->data = NULL; +- XDestroyImage (GUI.image); +- if (GUI.sm_info.shmaddr) +- shmdt (GUI.sm_info.shmaddr); +- if (GUI.sm_info.shmid >= 0) +- shmctl (GUI.sm_info.shmid, IPC_RMID, 0); +- GUI.image = NULL; +- } +- else +-#endif +- { +- XDestroyImage (GUI.image); +- GUI.image = NULL; +- } +- } ++ TakedownImage (); + XSync (GUI.display, False); + XCloseDisplay (GUI.display); + } +@@ -715,36 +687,7 @@ + ; + } + +- uint32 i; +- +- for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) +- if (GUI.to_free [i]) +- { +- free (GUI.to_free [i]); +- GUI.to_free [i] = NULL; +- } +- +- if (GUI.image) +- { +-#ifdef MITSHM +- if (GUI.use_shared_memory) +- { +- XShmDetach (GUI.display, &GUI.sm_info); +- GUI.image->data = NULL; +- XDestroyImage (GUI.image); +- if (GUI.sm_info.shmaddr) +- shmdt (GUI.sm_info.shmaddr); +- if (GUI.sm_info.shmid >= 0) +- shmctl (GUI.sm_info.shmid, IPC_RMID, 0); +- GUI.image = NULL; +- } +- else +-#endif +- { +- XDestroyImage (GUI.image); +- GUI.image = NULL; +- } +- } ++ TakedownImage (); + + #ifdef MITSHM + GUI.use_shared_memory = 1; +@@ -884,8 +827,47 @@ + } + GUI.image_date = (uint8 *) GUI.image->data; + GUI.bytes_per_line = GUI.image->bytes_per_line; ++ ++ S9xGraphicsInit (); ++} ++ ++void TakedownImage () ++{ ++ uint32 i; ++ ++ for (i = 0; i < sizeof (GUI.to_free) / sizeof (GUI.to_free [0]); i++) ++ if (GUI.to_free [i]) ++ { ++ free (GUI.to_free [i]); ++ GUI.to_free [i] = NULL; ++ } ++ ++ if (GUI.image) ++ { ++#ifdef MITSHM ++ if (GUI.use_shared_memory) ++ { ++ XShmDetach (GUI.display, &GUI.sm_info); ++ GUI.image->data = NULL; ++ XDestroyImage (GUI.image); ++ if (GUI.sm_info.shmaddr) ++ shmdt (GUI.sm_info.shmaddr); ++ if (GUI.sm_info.shmid >= 0) ++ shmctl (GUI.sm_info.shmid, IPC_RMID, 0); ++ GUI.image = NULL; ++ } ++ else ++#endif ++ { ++ XDestroyImage (GUI.image); ++ GUI.image = NULL; ++ } ++ } ++ ++ S9xGraphicsDeinit (); + } + ++ + int ErrorHandler (Display *, XErrorEvent *) + { + #ifdef MITSHM +@@ -1002,6 +984,8 @@ + IPPU.RenderThisFrame = TRUE; + IPPU.FrameSkip = Settings.SkipFrames; + SetupImage (); ++ extern void S9xReRefresh(); ++ S9xReRefresh (); + } + #ifdef USE_DGA_EXTENSION + if (XF86.start_full_screen) +diff -Naur snes9x-1.51-src/unix/xf86.cpp snes9x-1.51-src/unix/xf86.cpp +--- snes9x-1.51-src/unix/xf86.cpp 2007-05-11 01:51:58.000000000 -0700 ++++ snes9x-1.51-src/unix/xf86.cpp 2007-05-11 01:52:09.000000000 -0700 +@@ -404,6 +404,8 @@ + break; + } + ourvideo.scrnBegin = ourvideo.vidMemBegin + (320 - IMAGE_WIDTH) * ourvideo.screendepth / 2 + ourvideo.width * ourvideo.screendepth * 8; ++ ++ S9xGraphicsInit (); + } + + void S9xGraphicsMode () diff --git a/games-emulation/snes9x/snes9x-1.43-r1.ebuild b/games-emulation/snes9x/snes9x-1.51.ebuild index afd819811a62..5101d98964c1 100644 --- a/games-emulation/snes9x/snes9x-1.43-r1.ebuild +++ b/games-emulation/snes9x/snes9x-1.51.ebuild @@ -1,26 +1,26 @@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/snes9x-1.43-r1.ebuild,v 1.11 2006/11/01 22:50:44 nyhm Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-emulation/snes9x/snes9x-1.51.ebuild,v 1.1 2008/02/09 06:18:35 mr_bones_ Exp $ # 3dfx support (glide) is disabled because it requires # glide-v2 while we only provide glide-v3 in portage # http://bugs.gentoo.org/show_bug.cgi?id=93097 -WANT_AUTOCONF=latest inherit autotools eutils flag-o-matic multilib games DESCRIPTION="Super Nintendo Entertainment System (SNES) emulator" HOMEPAGE="http://www.snes9x.com/" -SRC_URI="http://www.lysator.liu.se/snes9x/${PV}/snes9x-${PV}-src.tar.gz" +SRC_URI="http://files.ipherswipsite.com/snes9x/${P}-src.tar.bz2 + http://vincent.grigorieff.free.fr/snes9x/${P}-src.tar.bz2" LICENSE="as-is" SLOT="0" -KEYWORDS="amd64 ppc x86" -IUSE="debug dga joystick opengl zlib" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="debug dga joystick netplay opengl zlib" RDEPEND="x11-libs/libXext dga? ( x11-libs/libXxf86dga - x11-libs/libXxf86vm ) + x11-libs/libXxf86vm ) media-libs/libpng amd64? ( app-emulation/emul-linux-x86-xlibs ) opengl? ( virtual/opengl @@ -34,52 +34,49 @@ DEPEND="${RDEPEND} S=${WORKDIR}/${P}-src +pkg_setup() { + use amd64 && [[ -z ${NATIVE_AMD64_BUILD_PLZ} ]] && has_multilib_profile && ABI=x86 + games_pkg_setup +} + src_unpack() { unpack ${A} - cd "${S}"/snes9x - rm offsets # stupid prebuilt file + cd "${S}" sed -i \ -e 's:-lXext -lX11::' Makefile.in \ || die "sed failed" epatch \ - "${FILESDIR}"/nojoy.patch \ - "${FILESDIR}"/${P}-porting.patch \ - "${FILESDIR}"/${P}-key-bindings-fix.patch \ "${FILESDIR}"/${P}-build.patch \ - "${FILESDIR}"/${P}-config.patch - - sed -i \ - -e 's:png_jmpbuf:png_write_info:g' \ - -e '/X_LDFLAGS=/d' \ - configure.in || die "sed failed" + "${FILESDIR}"/${P}-config.patch \ + "${FILESDIR}"/${P}-opengl.patch \ + "${FILESDIR}"/${P}-x11.patch eautoconf } src_compile() { - [[ -z ${NATIVE_AMD64_BUILD_PLZ} ]] && use amd64 && multilib_toolchain_setup x86 - - local vidconf= - local target= - local vid= + local vidconf + local target + local vid + local nooffset append-ldflags -Wl,-z,noexecstack - mkdir mybins + mkdir "${WORKDIR}"/mybins for vid in opengl fallback ; do if [[ ${vid} != "fallback" ]] ; then use ${vid} || continue fi - cd "${S}"/snes9x + cd "${S}" case ${vid} in # 3dfx) -# vidconf="--with-glide --without-opengl --without-x" +# vidconf="--with-glide --without-opengl" # target=gsnes9x;; opengl) - vidconf="--with-opengl --without-glide --without-x" + vidconf="--with-opengl --without-glide" target=osnes9x;; fallback) - vidconf="--with-x --without-glide --without-opengl" + vidconf="--without-glide --without-opengl" target=snes9x;; esac # this stuff is ugly but hey the build process sucks ;) @@ -89,21 +86,23 @@ src_compile() { $(use_with joystick) \ $(use_with debug debugger) \ $(use_with zlib) \ - --with-screenshot \ $(use_with dga extensions) \ + $(use_with netplay) \ || die - # Makefile doesnt quite support parallel builds - emake -j1 offsets || die "making offsets" + # Makefile doesn't quite support parallel builds emake ${target} || die "making ${target}" - mv ${target} "${S}"/mybins/ + mv ${target} "${WORKDIR}"/mybins/ cd "${WORKDIR}" - rm -r "${S}"/snes9x + rm -r "${S}" src_unpack done } src_install() { - dogamesbin mybins/* || die "dogamesbin failed" - dodoc faqs.txt readme.txt readme.unix snes9x/*.txt + dogamesbin "${WORKDIR}"/mybins/* || die "dogamesbin failed" + dodoc doc/* unix/docs/* prepgamesdirs + elog "Starting with version 1.50, snes9x's behavior is determined by a" + elog "configuration file. See readme_unix.txt and snes9x.conf.default" + elog "in /usr/share/doc/${PF} for details." } |