commit: 699301515a1645745a66f4eb237677df4354abd6 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> AuthorDate: Sun Apr 29 12:37:02 2018 +0000 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> CommitDate: Sun Apr 29 13:06:40 2018 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69930151
games-emulation/zsnes: Stop using games.eclass Package-Manager: Portage-2.3.31, Repoman-2.3.9 games-emulation/zsnes/files/zsnes-1.51-arch.patch | 4 +- .../files/zsnes-1.51-archopt-july-23-update.patch | 4 +- .../zsnes/files/zsnes-1.51-buffer.patch | 12 +-- .../zsnes/files/zsnes-1.51-cross-compile.patch | 8 +- games-emulation/zsnes/files/zsnes-1.51-gcc47.patch | 4 +- .../zsnes/files/zsnes-1.51-libao-thread.patch | 4 +- .../zsnes/files/zsnes-1.51-libpng.patch | 4 +- .../zsnes/files/zsnes-1.51-stack-align.patch | 4 +- games-emulation/zsnes/zsnes-1.51-r6.ebuild | 117 +++++++++++++++++++++ 9 files changed, 139 insertions(+), 22 deletions(-) diff --git a/games-emulation/zsnes/files/zsnes-1.51-arch.patch b/games-emulation/zsnes/files/zsnes-1.51-arch.patch index 2c8b690587b..b39549871b7 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-arch.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-arch.patch @@ -1,5 +1,5 @@ ---- configure.in.orig -+++ configure.in +--- a/configure.in.orig ++++ b/configure.in @@ -233,72 +233,8 @@ debug=no) AC_MSG_CHECKING(if you want gdb friendly executable) diff --git a/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch b/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch index ba118878a2b..b3e466036f2 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-archopt-july-23-update.patch @@ -1,5 +1,5 @@ ---- tools/archopt.c.old -+++ tools/archopt.c +--- a/tools/archopt.c.old ++++ b/tools/archopt.c @@ -1,8 +1,30 @@ +/* +Copyright (C) 2005-2007 Nach, grinvader ( http://www.zsnes.com ) diff --git a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch index 5f3049b315e..eb463682196 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch @@ -1,5 +1,5 @@ ---- zsnes_1_51/src/initc.c.fortify -+++ zsnes_1_51/src/initc.c +--- src/initc.c.fortify ++++ src/initc.c @@ -1464,8 +1464,8 @@ clearmem2(); } @@ -38,8 +38,8 @@ if (yesoutofmemory) { asm_call(outofmemfix); } asm_call(GUIDoReset); ---- zsnes_1_51/src/zstate.c.fortify -+++ zsnes_1_51/src/zstate.c +--- src/zstate.c.fortify ++++ src/zstate.c @@ -99,15 +99,15 @@ copy_func(buffer, &cycpbl, 4); copy_func(buffer, &cycpblt, 4); @@ -68,8 +68,8 @@ } */ } ---- zsnes_1_51/src/gblvars.h.fortify -+++ zsnes_1_51/src/gblvars.h +--- src/gblvars.h.fortify ++++ src/gblvars.h @@ -33,9 +33,9 @@ extern unsigned int SfxR0, *setaramdata, ramsize, *sram, nmiprevaddrh; extern unsigned int tempesi, tempedi, tempedx, tempebp; diff --git a/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch b/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch index 5823c6aa6ad..5c412e3e649 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch @@ -1,5 +1,5 @@ ---- a/src/acinclude.m4 -+++ b/src/acinclude.m4 +--- src/acinclude.m4 ++++ src/acinclude.m4 @@ -107,7 +107,7 @@ int main (int argc, char *argv[]) with_zlib=yes, with_zlib=no, @@ -18,8 +18,8 @@ ZLIB_CFLAGS="" ZLIB_LIBS="" ZLIB_VERSION="" ---- a/src/Makefile.in -+++ b/src/Makefile.in +--- src/Makefile.in ++++ src/Makefile.in @@ -103,8 +103,10 @@ main: makefile.dep $(Z_OBJS) @ZC@ -o @ZSNESEXE@ $(Z_OBJS) @ZCFLAGS@ @LDFLAGS@ rm -f version.o diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch index e5810241521..b3250fee679 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch @@ -3,8 +3,8 @@ Bug #419635 https://bugs.gentoo.org/show_bug.cgi?id=419635 Submitted by Nikos Chantziaras ---- a/src/tools/depbuild.cpp -+++ b/src/tools/depbuild.cpp +--- src/tools/depbuild.cpp ++++ src/tools/depbuild.cpp @@ -25,6 +25,7 @@ #include <string> #include <cstdio> diff --git a/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch b/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch index 880e08c698f..1ae0a1467b3 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch @@ -1,5 +1,5 @@ ---- linux/audio.c.old 2007-01-09 20:19:12.000000000 -0500 -+++ linux/audio.c 2007-12-30 20:33:07.000000000 -0500 +--- a/linux/audio.c.old 2007-01-09 20:19:12.000000000 -0500 ++++ b/linux/audio.c 2007-12-30 20:33:07.000000000 -0500 @@ -177,11 +177,7 @@ } else diff --git a/games-emulation/zsnes/files/zsnes-1.51-libpng.patch b/games-emulation/zsnes/files/zsnes-1.51-libpng.patch index 4e49054c097..fd974e799e3 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-libpng.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-libpng.patch @@ -1,5 +1,5 @@ ---- acinclude.m4 -+++ acinclude.m4 +--- a/acinclude.m4 ++++ b/acinclude.m4 @@ -163,21 +163,21 @@ libpng_prefix="") diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch index 32136643cae..5dcbf3ad9eb 100644 --- a/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch +++ b/games-emulation/zsnes/files/zsnes-1.51-stack-align.patch @@ -1,5 +1,5 @@ ---- zsnes_1_51/src/linux/sdllink.c.old -+++ zsnes_1_51/src/linux/sdllink.c +--- src/linux/sdllink.c.old ++++ src/linux/sdllink.c @@ -773,11 +773,11 @@ BOOL InitInput() { InitJoystickInput(); diff --git a/games-emulation/zsnes/zsnes-1.51-r6.ebuild b/games-emulation/zsnes/zsnes-1.51-r6.ebuild new file mode 100644 index 00000000000..bf1934226ab --- /dev/null +++ b/games-emulation/zsnes/zsnes-1.51-r6.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit autotools desktop flag-o-matic toolchain-funcs pax-utils + +DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly" +HOMEPAGE="http://www.zsnes.com/ http://ipherswipsite.com/zsnes/" +SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="ao custom-cflags +debug opengl pax_kernel 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} + dev-lang/nasm + debug? ( virtual/pkgconfig ) +" + +S="${WORKDIR}/${PN}_${PV//./_}/src" + +src_prepare() { + default + + # Fixing compilation without libpng installed + # Fix bug #186111 + # Fix bug #214697 + # Fix bug #170108 + # Fix bug #260247 + # Fix compability with libpng15 wrt #378735 + # Fix buffer overwrite #257963 + # Fix gcc47 compile #419635 + # Fix stack alignment issue #503138 + eapply \ + "${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 \ + "${FILESDIR}"/${P}-gcc47.patch \ + "${FILESDIR}"/${P}-stack-align.patch \ + "${FILESDIR}"/${P}-cross-compile.patch \ + "${FILESDIR}"/${P}-arch.patch + + # 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() { + dobin zsnes + if use pax_kernel; then + pax-mark m "${D}""${GAMES_BINDIR}"/zsnes || die + fi + + 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 +}