summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2011-09-29 20:11:35 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2011-09-29 20:11:35 +0000
commitaca8943c257c80a9972482e31a5e8ab8ef3ef5f0 (patch)
tree9dfc49970532299d06d823d3bd2236eb426f6616 /games-emulation/zsnes
parentUSE="static-libs" and remove libtool files (diff)
downloadgentoo-2-aca8943c257c80a9972482e31a5e8ab8ef3ef5f0.tar.gz
gentoo-2-aca8943c257c80a9972482e31a5e8ab8ef3ef5f0.tar.bz2
gentoo-2-aca8943c257c80a9972482e31a5e8ab8ef3ef5f0.zip
fix building with newer zlib (bug #384473); add patch from rpmfusion (bug #257963)
(Portage version: 2.1.10.11/cvs/Linux i686)
Diffstat (limited to 'games-emulation/zsnes')
-rw-r--r--games-emulation/zsnes/ChangeLog7
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-buffer.patch85
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r2.ebuild42
3 files changed, 115 insertions, 19 deletions
diff --git a/games-emulation/zsnes/ChangeLog b/games-emulation/zsnes/ChangeLog
index 62a11c82543b..9f823f8504df 100644
--- a/games-emulation/zsnes/ChangeLog
+++ b/games-emulation/zsnes/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for games-emulation/zsnes
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/ChangeLog,v 1.47 2011/09/14 08:45:05 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/ChangeLog,v 1.48 2011/09/29 20:11:35 mr_bones_ Exp $
+
+ 29 Sep 2011; Michael Sterrett <mr_bones_@gentoo.org> zsnes-1.51-r2.ebuild,
+ +files/zsnes-1.51-buffer.patch:
+ fix building with newer zlib (bug #384473); add patch from rpmfusion (bug
+ #257963)
14 Sep 2011; Samuli Suominen <ssuominen@gentoo.org> zsnes-1.51-r2.ebuild,
+files/zsnes-1.51-libpng15.patch:
diff --git a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
new file mode 100644
index 000000000000..1f7754d7c16c
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
@@ -0,0 +1,85 @@
+--- zsnes_1_51/src/initc.c.fortify 2007-01-20 01:02:24.000000000 +0100
++++ zsnes_1_51/src/initc.c 2007-02-26 12:10:19.000000000 +0100
+@@ -1464,8 +1464,8 @@
+ clearmem2();
+ }
+
+-extern unsigned char BRRBuffer[32];
+-extern unsigned char echoon0;
++extern unsigned char BRRBuffer[];
++extern unsigned char echoon0[];
+ extern unsigned int PHdspsave;
+ extern unsigned int PHdspsave2;
+ unsigned char echobuf[90000];
+@@ -1479,7 +1479,7 @@
+ memset(vidmemch4, 0, 4096);
+ memset(vidmemch8, 0, 4096);
+ memset(BRRBuffer, 0, PHdspsave);
+- memset(&echoon0, 0, PHdspsave2);
++ memset(echoon0, 0, PHdspsave2);
+ memset(echobuf, 0, 90000);
+ memset(spcBuffera, 0, 65536*4+4096);
+ memset(DSPMem, 0, 256);
+@@ -1822,7 +1822,7 @@
+
+ extern unsigned int nmiprevaddrl, nmiprevaddrh, nmirept, nmiprevline, nmistatus;
+ extern unsigned char spcnumread, yesoutofmemory;
+-extern unsigned char NextLineCache, sramsavedis, sndrot, regsbackup[3019];
++extern unsigned char NextLineCache, sramsavedis, sndrot[], regsbackup[3019];
+ extern unsigned int Voice0Freq, Voice1Freq, Voice2Freq, Voice3Freq;
+ extern unsigned int Voice4Freq, Voice5Freq, Voice6Freq, Voice7Freq;
+ extern unsigned int dspPAdj;
+@@ -2621,7 +2621,7 @@
+ }
+
+ sramsavedis = 0;
+- memcpy(&sndrot, regsbackup, 3019);
++ memcpy(sndrot, regsbackup, 3019);
+
+ if (yesoutofmemory) { asm_call(outofmemfix); }
+ asm_call(GUIDoReset);
+--- zsnes_1_51/src/zstate.c.fortify 2007-02-26 12:14:30.000000000 +0100
++++ zsnes_1_51/src/zstate.c 2007-02-26 12:17:22.000000000 +0100
+@@ -99,15 +99,15 @@
+ copy_func(buffer, &cycpbl, 4);
+ copy_func(buffer, &cycpblt, 4);
+ //SNES PPU Register status
+- copy_func(buffer, &sndrot, 3019);
++ copy_func(buffer, sndrot, 3019);
+ }
+
+ static void copy_spc_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
+ {
+ //SPC stuff, DSP stuff
+ copy_func(buffer, SPCRAM, PHspcsave);
+- copy_func(buffer, &BRRBuffer, PHdspsave);
+- copy_func(buffer, &DSPMem, sizeof(DSPMem));
++ copy_func(buffer, BRRBuffer, PHdspsave);
++ copy_func(buffer, DSPMem, sizeof(DSPMem));
+ }
+
+ static void copy_extra_data(unsigned char **buffer, void (*copy_func)(unsigned char **, void *, size_t))
+@@ -156,7 +156,7 @@
+ /*
+ if (buffer) //Rewind stuff
+ {
+- copy_func(&buffer, &echoon0, PHdspsave2);
++ copy_func(&buffer, echoon0, PHdspsave2);
+ }
+ */
+ }
+--- zsnes_1_51/src/gblvars.h.fortify 2007-02-26 12:12:33.000000000 +0100
++++ zsnes_1_51/src/gblvars.h 2007-02-26 12:12:36.000000000 +0100
+@@ -33,9 +33,9 @@
+ extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh;
+ extern unsigned int tempesi, tempedi, tempedx, tempebp;
+ extern unsigned int SPCMultA, PHnum2writespc7110reg, PHdspsave2;
+-extern unsigned char sndrot, SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
+-extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[32], *romdata;
+-extern unsigned char curcyc, echoon0, spcnumread, NextLineCache, HIRQNextExe;
++extern unsigned char sndrot[], SPCRAM[65472], DSPMem[256], SA1Status, *SA1RAMArea;
++extern unsigned char DSP1Enable, DSP1COp, prevoamptr, BRRBuffer[], *romdata;
++extern unsigned char curcyc, echoon0[], spcnumread, NextLineCache, HIRQNextExe;
+ extern unsigned char vidmemch4[4096], vidmemch8[4096], vidmemch2[4096];
+
+ extern bool C4Enable, SFXEnable, SA1Enable, SPC7110Enable, SETAEnable, DSP4Enable, spcon;
diff --git a/games-emulation/zsnes/zsnes-1.51-r2.ebuild b/games-emulation/zsnes/zsnes-1.51-r2.ebuild
index 8853821544bf..ce337fd48112 100644
--- a/games-emulation/zsnes/zsnes-1.51-r2.ebuild
+++ b/games-emulation/zsnes/zsnes-1.51-r2.ebuild
@@ -1,7 +1,8 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/zsnes-1.51-r2.ebuild,v 1.8 2011/09/14 08:45:05 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-emulation/zsnes/zsnes-1.51-r2.ebuild,v 1.9 2011/09/29 20:11:35 mr_bones_ Exp $
+EAPI=2
inherit eutils autotools flag-o-matic toolchain-funcs multilib games
DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
@@ -13,7 +14,7 @@ SLOT="0"
KEYWORDS="-* amd64 x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
IUSE="ao custom-cflags opengl png"
-RDEPEND="media-libs/libsdl
+RDEPEND="media-libs/libsdl[audio,video]
>=sys-libs/zlib-1.2.3-r1
amd64? ( >=app-emulation/emul-linux-x86-sdl-10.1 )
ao? ( media-libs/libao )
@@ -25,23 +26,25 @@ DEPEND="${RDEPEND}
S=${WORKDIR}/${PN}_${PV//./_}/src
-src_unpack() {
- unpack ${A}
- cd "${S}"
-
+src_prepare() {
# Fixing compilation without libpng installed
- epatch "${FILESDIR}"/${P}-libpng.patch
# Fix bug #186111
- epatch "${FILESDIR}"/${P}-archopt-july-23-update.patch
- epatch "${FILESDIR}"/${P}-gcc43.patch
# Fix bug #214697
- epatch "${FILESDIR}"/${P}-libao-thread.patch
# Fix bug #170108
- epatch "${FILESDIR}"/${P}-depbuild.patch
# Fix bug #260247
- epatch "${FILESDIR}"/${P}-CC-quotes.patch
# Fix compability with libpng15 wrt #378735
- epatch "${FILESDIR}"/${P}-libpng15.patch
+ # Fix buffer overwrite #257963
+ epatch \
+ "${FILESDIR}"/${P}-libpng.patch \
+ "${FILESDIR}"/${P}-archopt-july-23-update.patch \
+ "${FILESDIR}"/${P}-gcc43.patch \
+ "${FILESDIR}"/${P}-libao-thread.patch \
+ "${FILESDIR}"/${P}-depbuild.patch \
+ "${FILESDIR}"/${P}-CC-quotes.patch \
+ "${FILESDIR}"/${P}-libpng15.patch \
+ "${FILESDIR}"/${P}-buffer.patch
+
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die
# Remove hardcoded CFLAGS and LDFLAGS
sed -i \
@@ -53,7 +56,7 @@ src_unpack() {
eautoreconf
}
-src_compile() {
+src_configure() {
tc-export CC
use amd64 && multilib_toolchain_setup x86
use custom-cflags || strip-flags
@@ -67,8 +70,10 @@ src_compile() {
--disable-debug \
--disable-cpucheck \
--enable-release \
- force_arch=no \
- || die
+ force_arch=no
+}
+
+src_compile() {
emake makefile.dep || die "emake makefile.dep failed"
emake || die "emake failed"
}
@@ -76,8 +81,9 @@ src_compile() {
src_install() {
dogamesbin zsnes || die "dogamesbin failed"
newman linux/zsnes.1 zsnes.6
- dodoc ../docs/{readme.1st,*.txt,README.LINUX}
- dodoc ../docs/readme.txt/*
+ dodoc \
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \
+ ../docs/readme.txt/*
dohtml -r ../docs/readme.htm/*
make_desktop_entry zsnes ZSNES
newicon icons/48x48x32.png ${PN}.png