summaryrefslogtreecommitdiff
path: root/games-emulation/zsnes
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
commit908778078736bd36f7a60a2d576d415cb8e000fa (patch)
treec6a4796c48b608c14dc7e9674cdbd38f905e3c15 /games-emulation/zsnes
parent185fa19bbf68a4d4dca534d2b46729207a177f16 (diff)
gentoo resync : 22.05.2021
Diffstat (limited to 'games-emulation/zsnes')
-rw-r--r--games-emulation/zsnes/Manifest5
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch30
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch40
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-stack-align-v4.patch45
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r10.ebuild128
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r11.ebuild129
6 files changed, 377 insertions, 0 deletions
diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
index cd7b9e6742ed..151c542ccfb9 100644
--- a/games-emulation/zsnes/Manifest
+++ b/games-emulation/zsnes/Manifest
@@ -1,4 +1,5 @@
AUX zsnes-1.51-CC-quotes.patch 740 BLAKE2B f41e66a5d2f9b54c8ed4f17fafc7afdd73e35202c083d1db375b26b89f03b991d36d279d10c7c17076f31b87d1fbad276e5c5c4ce333d2cb0f0fc7641b562845 SHA512 2347910158934a7c8b90a6739f923d7a1f94e963515dca42d45eb97e6165c5f80c30d28fd151537a7a80bba16d2462568ff1c1dac93a855990f0418aaf059776
+AUX zsnes-1.51-ao-crash.patch 1769 BLAKE2B f5b9c43c6c5c6eb0c211c60890fa11aa1e1fcc3f327f4a8a0864c494f0b9badadd287620001efb8d174865fb4449684b770aa10563229221980e424d4e112faa SHA512 a7a4a71bac72cd467ea2c0c98effb704f86817209dc9fbd034c35ca205270e5651d9223559a95523a91a2d9b17e61afac12d8d0375810e971b37d73c248c16f9
AUX zsnes-1.51-arch.patch 2484 BLAKE2B 036f749d832efc976a7225e47d6b7ac5e1b69af235a4196e9706fe46d447793a1e3f88e49fe34229cd71353b987b7ef123bbebf7c822ca32025c60b0c9813b57 SHA512 cc75584780e442d7fbcd4e26a9395d8e85570883f93f63b1fcb604d601acde88295861e15a6cee1d50bca836fc52efd4f5df9c84fb73fbe04fa76ec34ae3b4a1
AUX zsnes-1.51-buffer.patch 3091 BLAKE2B a87e0b6547aeaa9f585d76a8ee080895573015fe42b0df2161268754ff01c046fd234997000ef484f66710dfd30e145d9d4db2f373a568e99deec2a8637db285 SHA512 0faf34338ff3fd85985dc16d2a58aa9e2ac1887db8d26bc210fc6965f6cc743c6c56b8b58bea72341d8ee1fed59c438db801000be5ae6bf4e26789e9bed89d25
AUX zsnes-1.51-c++17.patch 2520 BLAKE2B 0295b0e211e2ec8f4988f42299a78d477ba29128519fdb6542f3495d7770b44c245d76264d3dbf97008a9a857da270ce753b90974b705af4b6a319f3389b47dd SHA512 abb9dd3cbc24ace02f132e44a44c3454402c34dcbcf40b2d3118befbe7553e71111382bd48ce281f05ecf2832ce814001f17b1598d155b9abb20943500ab5e99
@@ -11,6 +12,10 @@ AUX zsnes-1.51-libao-thread.patch 667 BLAKE2B 76bc0abf16f68c9752a727817cff209daa
AUX zsnes-1.51-libpng.patch 858 BLAKE2B f0ad46176cf5729d0a5be9e4307a28628e38c3d18043f0ff897dfd1cf901f0f9fb7ff80d25095fdaa9b6b1be52fe3c95f4e28b65042b4c4aad33a27125c7eb02 SHA512 2c25fb3294357a38ed8e119d4b4d60f7bd6f28724b2274a620465962e96e008f2a29273f46d4813e91b9128879218f401bb91b1a6df4c156b9ff7856b26657b0
AUX zsnes-1.51-libpng15.patch 510 BLAKE2B 6281a27c6029ee94947b282fe5c06a67e7670d3168d5f4ae90573d12e8e6d5c467a9691cdd161158f117e341466bc7a3e99d516b95624534773027279aba4f7a SHA512 4191987cad2f8dd7d7fd1d4f8f0c60de07059f18a60cb9bb94f1e5c35c06122032de9887762ebcf2d255f24c3e90aa5b4f6a7540a8e4dbdc4ce5f7d3b3e3b532
AUX zsnes-1.51-stack-align-v2.patch 1451 BLAKE2B b4570fa9d614d516375f1b7d2a9b3b7c9bf432f453425d2ee3035e78d8d946355551044d712528907c3a1f29b3531034b5949224398801e04270df85ada5ab00 SHA512 c3be01f36973615c55c643d1d916742f8e3a34e9957b42d1d7224a99790713025bb154e5e8c2833fd1e8d26240c6251a70c8a9f36fefe661480077b1b06871c8
+AUX zsnes-1.51-stack-align-v3.patch 1015 BLAKE2B 65e23f78a801f8633847ece88fe49471cd7244795c1eacfe16310790a7b8f7270368573b2fe73df124504f6792e993895c697d9a04c5338e7f9759fd14bda56c SHA512 b93c28f7ada13fe30497ab32ca35c6ad2fa52aa1a34cceb87c911abf76f1cb5f1ecf73350da03a2333ffc0f0747ab013d25a7822e00833db71ea3a4e1ab10540
+AUX zsnes-1.51-stack-align-v4.patch 1072 BLAKE2B bea28efa6092244ab5bc8cfd21b37d694dc9aab8ad998cced361a4187f41102c00df2fb24b63f495be2b24e83e848023dbf1dee025738f92b89ec84fbfa5e602 SHA512 405963bc84026289001bb375af81879f80716015af774f4c5f9ff185763f489e9982efabdd9fb1146706e5be4bc20d847179ffc5fc6a56564498aa9400e942c2
DIST zsnes-1.51-20071031.tar.bz2 1072340 BLAKE2B d67c92e382ca130d4138d21fbb2effc06539d1c7e3aabf0339c9b7e773521daf2d3cb0bcef75991e1a4453fcc86903d3dead48d90806489c8b4bf7677f8ebf3b SHA512 b10373cf81b201a33dc60c728431d4f69d36de31fcf6f137b623ea206a2998f722dcd6132daec1d0bf14a05ae52f3ee9ecee4334517039be554db85c9f7b8274
+EBUILD zsnes-1.51-r10.ebuild 3323 BLAKE2B 5083bf26565f8b50e6335e82d5a5b8286ecff1728bb0f4b199ea433c3a05825c45a55f0d0c902d0cd885c4e42857ce3479b824f0815316fe157f553ac91a938a SHA512 d690600169200e3a5c9550b3568f6426cfca189f91474ae3dc1670b26360851b3e54f053ffa9474c4a3cda67dce6d30a4da2bcc04d3b97d634fbe96749fccf04
+EBUILD zsnes-1.51-r11.ebuild 3364 BLAKE2B a8cc8df1c570182888f6e9846657b35026ed82d17ec70afeb478509c0a2d54bc7fe6cf4509119b99db882638480ea5e14efab80419ec0fa70fc0aae6e7cfbfc5 SHA512 3862f1754a1079a568b7c2e9ef0d07af6832d500e11151fc89ed95eb407365ceb10ad1de31b153a5c655aad2b5b482f6739675d10f83b31e77c8ef1b43e3ebfe
EBUILD zsnes-1.51-r9.ebuild 3247 BLAKE2B cd48b00ec6f809ad88ec73588207cac1a1c0a1d9610eb14acc1684c30ad581e7711b3aaf9891ac4ef2032fc42429cff5ab4339bf8205411b5294aed47d76f5b3 SHA512 94f7571ab21978188da7808c126f2f572136f3c9851a95d8ded6758dd8cc608b1635b431354d0d3f8bf7ddfb3f0eda7e8f9c6a0610682a4db361e6da77f33510
MISC metadata.xml 413 BLAKE2B 4e4199d8263368534eb4e2971fd30f0ef32af1537a7131ff150c6aee178c6a804083536c3ec249547f0826064ffe476e6c777b8c0aa519fc99d9d3d6284052c0 SHA512 235a3739eb5641eb444fb9ae47c661f05140c3b348173b65b342971850c2e0e7e32c416315904e48fcd8fa9241c93b0e0cc030851b61074c78566d3603f41973
diff --git a/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch b/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch
new file mode 100644
index 000000000000..6ce142d9c27c
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch
@@ -0,0 +1,30 @@
+Fix frash in uninitialized driver_format.matrix.
+
+Thread 1 "zsnes" received signal SIGSEGV, Segmentation fault.
+__strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50
+50 ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Нет такого файла или каталога.
+(gdb) bt
+#0 __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50
+#1 0xf7e3c491 in _sanitize_matrix (maxchannels=2, matrix=0x1c00200 <error: Cannot access memory at address 0x1c00200>, device=device@entry=0x57057100)
+ at ../../libao-1.2.2/src/audio_out.c:634
+#2 0xf7e3e9bc in _open_device (driver_id=<optimized out>, format=format@entry=0xffffc638, options=options@entry=0x0, file=0x0) at ../../libao-1.2.2/src/audio_out.c:991
+#3 0xf7e3f579 in ao_open_live (driver_id=<optimized out>, format=0xffffc638, options=0x0) at ../../libao-1.2.2/src/audio_out.c:1337
+#4 0x5699fbb5 in SoundInit_ao () at linux/audio.c:197
+#5 InitSound () at linux/audio.c:338
+#6 0x569a2f7f in initwinvideo () at linux/sdllink.c:1080
+#7 0x569a07d3 in initvideo ()
+#8 0x56ad59bc in regptwa ()
+#9 0x56a3c490 in SA1tableG ()
+#10 0xffffc808 in ?? ()
+#11 0xf78619b5 in __libc_start_main (main=0x1, argc=1450015920, argv=0x0, init=0x566d7ce1 <_start+49>, fini=0x566d7c00 <main>, rtld_fini=0x1, stack_end=0xffffc8c4) at ../csu/libc-start.c:332
+#12 0x569cd000 in ?? ()
+--- a/linux/audio.c
++++ b/linux/audio.c
+@@ -166,6 +166,7 @@ static int SoundInit_ao()
+ if (driver_id < 0) { driver_id = ao_default_driver_id(); }
+
+ ao_sample_format driver_format;
++ memset(&driver_format, 0, sizeof(driver_format));
+ driver_format.bits = 16;
+ driver_format.channels = StereoSound+1;
+ driver_format.rate = freqtab[SoundQuality = ((SoundQuality > 6) ? 1 : SoundQuality)];
diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch
new file mode 100644
index 000000000000..914c9afc4495
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch
@@ -0,0 +1,40 @@
+--- a/linux/sdllink.c
++++ b/linux/sdllink.c
+@@ -133,7 +133,7 @@ extern unsigned char romispal;
+
+ /* FUNCTION DECLARATIONS */
+ void clearwin (void);
+-void drawscreenwin(void);
++void __attribute__((force_align_arg_pointer)) drawscreenwin(void);
+ void initwinvideo();
+ unsigned int sdl_keysym_to_pc_scancode(int);
+ void ProcessKeyBuf(int);
+--- a/ztimec.c
++++ b/ztimec.c
+@@ -25,7 +25,7 @@ short SystemTimewHour;
+ short SystemTimewMinute;
+ short SystemTimewSecond;
+
+-void GetLocalTime()
++void __attribute__((force_align_arg_pointer)) GetLocalTime()
+ {
+ time_t current;
+ struct tm *timeptr;
+@@ -37,7 +37,7 @@ void GetLocalTime()
+ SystemTimewSecond = timeptr->tm_sec;
+ }
+
+-unsigned int GetTime()
++unsigned __attribute__((force_align_arg_pointer)) int GetTime()
+ {
+ unsigned int value;
+ struct tm *newtime;
+@@ -52,7 +52,7 @@ unsigned int GetTime()
+ return(value);
+ }
+
+-unsigned int GetDate()
++unsigned __attribute__((force_align_arg_pointer)) int GetDate()
+ {
+ unsigned int value;
+ struct tm *newtime;
diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v4.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v4.patch
new file mode 100644
index 000000000000..7e015d53ebd9
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v4.patch
@@ -0,0 +1,45 @@
+--- a/linux/sdllink.c
++++ b/linux/sdllink.c
+@@ -1170,7 +1170,7 @@ void sem_sleep_die(void)
+ }
+ }
+
+-void UpdateVFrame(void)
++void __attribute__((force_align_arg_pointer)) UpdateVFrame(void)
+ {
+ //Quick fix for GUI CPU usage
+ if (GUIOn || GUIOn2 || EMUPause) { usleep(6000); }
+@@ -1237,16 +1237,16 @@ void UnloadSDL()
+ SDL_Quit();
+ }
+
+-int GetMouseX(void)
++int __attribute__((force_align_arg_pointer)) GetMouseX(void)
+ {
+ return ((int) MouseX);
+ }
+-int GetMouseY(void)
++int __attribute__((force_align_arg_pointer)) GetMouseY(void)
+ {
+ return ((int) MouseY);
+ }
+
+-int GetMouseMoveX(void)
++int __attribute__((force_align_arg_pointer)) GetMouseMoveX(void)
+ {
+ // InputRead();
+ //SDL_GetRelativeMouseState(&MouseMove2X, NULL);
+@@ -1254,11 +1254,11 @@ int GetMouseMoveX(void)
+ return (MouseMove2X);
+ }
+
+-int GetMouseMoveY(void)
++int __attribute__((force_align_arg_pointer)) GetMouseMoveY(void)
+ {
+ return (MouseMove2Y);
+ }
+-int GetMouseButton(void)
++int __attribute__((force_align_arg_pointer)) GetMouseButton(void)
+ {
+ return ((int) MouseButton);
+ }
diff --git a/games-emulation/zsnes/zsnes-1.51-r10.ebuild b/games-emulation/zsnes/zsnes-1.51-r10.ebuild
new file mode 100644
index 000000000000..ffa490ba20b5
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r10.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools desktop flag-o-matic toolchain-funcs pax-utils
+
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
+HOMEPAGE="https://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
+SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2 -> ${P}-20071031.tar.bz2"
+S="${WORKDIR}/${PN}_${PV//./_}/src"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="ao custom-cflags +debug opengl png"
+
+RDEPEND="
+ media-libs/libsdl[sound,video,abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)]
+ ao? ( media-libs/libao[abi_x86_32(-)] )
+ debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] )
+ opengl? ( virtual/opengl[abi_x86_32(-)] )
+ png? ( media-libs/libpng:0=[abi_x86_32(-)] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-lang/nasm
+ debug? ( virtual/pkgconfig )
+"
+
+PATCHES=(
+ # Fixing compilation without libpng installed
+ "${FILESDIR}"/${P}-libpng.patch
+
+ # Fix bug #186111
+ # Fix bug #214697
+ # Fix bug #170108
+ # Fix bug #260247
+ "${FILESDIR}"/${P}-gcc43-20071031.patch
+ "${FILESDIR}"/${P}-libao-thread.patch
+ "${FILESDIR}"/${P}-depbuild.patch
+ "${FILESDIR}"/${P}-CC-quotes.patch
+
+ # Fix compability with libpng15 wrt #378735
+ "${FILESDIR}"/${P}-libpng15.patch
+
+ # Fix buffer overwrite #257963
+ "${FILESDIR}"/${P}-buffer.patch
+ # Fix gcc47 compile #419635
+ "${FILESDIR}"/${P}-gcc47.patch
+ # Fix stack alignment issue #503138
+ "${FILESDIR}"/${P}-stack-align-v2.patch
+
+ "${FILESDIR}"/${P}-cross-compile.patch
+ "${FILESDIR}"/${P}-arch.patch
+
+ "${FILESDIR}"/${P}-gcc-10.patch
+ "${FILESDIR}"/${P}-c++17.patch
+ "${FILESDIR}"/${P}-ao-crash.patch
+ "${FILESDIR}"/${P}-stack-align-v3.patch
+)
+
+src_prepare() {
+ default
+
+ # The sdl detection logic uses AC_PROG_PATH instead of
+ # AC_PROG_TOOL, so force the var to get set the way we
+ # need for things to work correctly.
+ tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config
+
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die
+
+ # Remove hardcoded CFLAGS and LDFLAGS
+ sed -i \
+ -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \
+ -e '/^LDFLAGS=.*local/d' \
+ -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \
+ -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \
+ -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \
+ configure.in || die
+ sed -i \
+ -e 's/configure.in/configure.ac/' \
+ Makefile.in || die
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ export BUILD_CXX=$(tc-getBUILD_CXX)
+ export NFLAGS=-O1
+ use amd64 && multilib_toolchain_setup x86
+ use custom-cflags || strip-flags
+
+ append-cppflags -U_FORTIFY_SOURCE #257963
+
+ econf \
+ $(use_enable ao libao) \
+ $(use_enable debug debugger) \
+ $(use_enable png libpng) \
+ $(use_enable opengl) \
+ --disable-debug \
+ --disable-cpucheck
+}
+
+src_compile() {
+ emake makefile.dep
+ emake
+}
+
+src_install() {
+ # Uses pic-unfriendly assembly code, bug #427104
+ QA_TEXTRELS="usr/bin/zsnes"
+
+ dobin zsnes
+ pax-mark m "${ED}"/usr/bin/zsnes
+
+ newman linux/zsnes.1 zsnes.6
+
+ dodoc \
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \
+ ../docs/readme.txt/*
+ HTML_DOCS="../docs/readme.htm/*" einstalldocs
+
+ make_desktop_entry zsnes ZSNES
+ newicon icons/48x48x32.png ${PN}.png
+}
diff --git a/games-emulation/zsnes/zsnes-1.51-r11.ebuild b/games-emulation/zsnes/zsnes-1.51-r11.ebuild
new file mode 100644
index 000000000000..f5956fa938c4
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r11.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools desktop flag-o-matic toolchain-funcs pax-utils
+
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly"
+HOMEPAGE="https://www.zsnes.com/ http://ipherswipsite.com/zsnes/"
+SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2 -> ${P}-20071031.tar.bz2"
+S="${WORKDIR}/${PN}_${PV//./_}/src"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="ao custom-cflags +debug opengl png"
+
+RDEPEND="
+ media-libs/libsdl[sound,video,abi_x86_32(-)]
+ >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)]
+ ao? ( media-libs/libao[abi_x86_32(-)] )
+ debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] )
+ opengl? ( virtual/opengl[abi_x86_32(-)] )
+ png? ( media-libs/libpng:0=[abi_x86_32(-)] )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-lang/nasm
+ debug? ( virtual/pkgconfig )
+"
+
+PATCHES=(
+ # Fixing compilation without libpng installed
+ "${FILESDIR}"/${P}-libpng.patch
+
+ # Fix bug #186111
+ # Fix bug #214697
+ # Fix bug #170108
+ # Fix bug #260247
+ "${FILESDIR}"/${P}-gcc43-20071031.patch
+ "${FILESDIR}"/${P}-libao-thread.patch
+ "${FILESDIR}"/${P}-depbuild.patch
+ "${FILESDIR}"/${P}-CC-quotes.patch
+
+ # Fix compability with libpng15 wrt #378735
+ "${FILESDIR}"/${P}-libpng15.patch
+
+ # Fix buffer overwrite #257963
+ "${FILESDIR}"/${P}-buffer.patch
+ # Fix gcc47 compile #419635
+ "${FILESDIR}"/${P}-gcc47.patch
+ # Fix stack alignment issue #503138
+ "${FILESDIR}"/${P}-stack-align-v2.patch
+
+ "${FILESDIR}"/${P}-cross-compile.patch
+ "${FILESDIR}"/${P}-arch.patch
+
+ "${FILESDIR}"/${P}-gcc-10.patch
+ "${FILESDIR}"/${P}-c++17.patch
+ "${FILESDIR}"/${P}-ao-crash.patch
+ "${FILESDIR}"/${P}-stack-align-v3.patch
+ "${FILESDIR}"/${P}-stack-align-v4.patch
+)
+
+src_prepare() {
+ default
+
+ # The sdl detection logic uses AC_PROG_PATH instead of
+ # AC_PROG_TOOL, so force the var to get set the way we
+ # need for things to work correctly.
+ tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config
+
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die
+
+ # Remove hardcoded CFLAGS and LDFLAGS
+ sed -i \
+ -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \
+ -e '/^LDFLAGS=.*local/d' \
+ -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \
+ -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \
+ -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \
+ configure.in || die
+ sed -i \
+ -e 's/configure.in/configure.ac/' \
+ Makefile.in || die
+ mv configure.in configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC
+ export BUILD_CXX=$(tc-getBUILD_CXX)
+ export NFLAGS=-O1
+ use amd64 && multilib_toolchain_setup x86
+ use custom-cflags || strip-flags
+
+ append-cppflags -U_FORTIFY_SOURCE #257963
+
+ econf \
+ $(use_enable ao libao) \
+ $(use_enable debug debugger) \
+ $(use_enable png libpng) \
+ $(use_enable opengl) \
+ --disable-debug \
+ --disable-cpucheck
+}
+
+src_compile() {
+ emake makefile.dep
+ emake
+}
+
+src_install() {
+ # Uses pic-unfriendly assembly code, bug #427104
+ QA_TEXTRELS="usr/bin/zsnes"
+
+ dobin zsnes
+ pax-mark m "${ED}"/usr/bin/zsnes
+
+ newman linux/zsnes.1 zsnes.6
+
+ dodoc \
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \
+ ../docs/readme.txt/*
+ HTML_DOCS="../docs/readme.htm/*" einstalldocs
+
+ make_desktop_entry zsnes ZSNES
+ newicon icons/48x48x32.png ${PN}.png
+}