summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games-emulation/zsnes/files/zsnes-1.51-c++17.patch76
-rw-r--r--games-emulation/zsnes/zsnes-1.51-r9.ebuild125
2 files changed, 201 insertions, 0 deletions
diff --git a/games-emulation/zsnes/files/zsnes-1.51-c++17.patch b/games-emulation/zsnes/files/zsnes-1.51-c++17.patch
new file mode 100644
index 000000000000..537f32540c58
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-c++17.patch
@@ -0,0 +1,76 @@
+--- a/jma/jma.cpp
++++ b/jma/jma.cpp
+@@ -48,7 +48,7 @@ namespace JMA
+
+
+ //Retreive the file block, what else?
+- void jma_open::retrieve_file_block() throw(jma_errors)
++ void jma_open::retrieve_file_block()
+ {
+ unsigned char uint_buffer[UINT_SIZE];
+ unsigned char ushort_buffer[USHORT_SIZE];
+@@ -168,7 +168,7 @@ namespace JMA
+ }
+
+ //Constructor for opening JMA files for reading
+- jma_open::jma_open(const char *compressed_file_name) throw (jma_errors)
++ jma_open::jma_open(const char *compressed_file_name)
+ {
+ decompressed_buffer = 0;
+ compressed_buffer = 0;
+@@ -229,7 +229,7 @@ namespace JMA
+ }
+
+ //Skip forward a given number of chunks
+- void jma_open::chunk_seek(unsigned int chunk_num) throw(jma_errors)
++ void jma_open::chunk_seek(unsigned int chunk_num)
+ {
+ //Check the stream is open
+ if (!stream.is_open())
+@@ -257,7 +257,7 @@ namespace JMA
+
+ //Return a vector of pointers to each file in the JMA, the buffer to hold all the files
+ //must be initilized outside.
+- vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer) throw(jma_errors)
++ vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer)
+ {
+ //If there's no stream we can't read from it, so exit
+ if (!stream.is_open())
+@@ -396,7 +396,7 @@ namespace JMA
+ }
+
+ //Extracts the file with a given name found in the archive to the given buffer
+- void jma_open::extract_file(string& name, unsigned char *buffer) throw(jma_errors)
++ void jma_open::extract_file(string& name, unsigned char *buffer)
+ {
+ if (!stream.is_open())
+ {
+--- a/jma/jma.h
++++ b/jma/jma.h
+@@ -64,12 +64,12 @@ namespace JMA
+ class jma_open
+ {
+ public:
+- jma_open(const char *) throw(jma_errors);
++ jma_open(const char *);
+ ~jma_open();
+
+ std::vector<jma_public_file_info> get_files_info();
+- std::vector<unsigned char *> get_all_files(unsigned char *) throw(jma_errors);
+- void extract_file(std::string& name, unsigned char *) throw(jma_errors);
++ std::vector<unsigned char *> get_all_files(unsigned char *);
++ void extract_file(std::string& name, unsigned char *);
+ bool is_solid();
+
+ private:
+@@ -79,8 +79,8 @@ namespace JMA
+ unsigned char *decompressed_buffer;
+ unsigned char *compressed_buffer;
+
+- void chunk_seek(unsigned int) throw(jma_errors);
+- void retrieve_file_block() throw(jma_errors);
++ void chunk_seek(unsigned int);
++ void retrieve_file_block();
+ };
+
+ const char *jma_error_text(jma_errors);
diff --git a/games-emulation/zsnes/zsnes-1.51-r9.ebuild b/games-emulation/zsnes/zsnes-1.51-r9.ebuild
new file mode 100644
index 000000000000..a56e1e85d8de
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r9.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2020 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"
+
+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}
+ dev-lang/nasm
+ debug? ( virtual/pkgconfig )
+"
+
+S="${WORKDIR}/${PN}_${PV//./_}/src"
+
+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
+)
+
+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}${GAMES_BINDIR}"/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
+}