public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2020-02-04 21:38 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2020-02-04 21:38 UTC (permalink / raw
  To: gentoo-commits

commit:     965d6c11b191c4729da99cdbb87ef07a67a9250a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  4 21:35:54 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Feb  4 21:37:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=965d6c11

games-emulation/zsnes: refetch upstream tarball

Original tarball was repackaged and includes
archopt-july-23-update.patch patch.

Reported-by: Plüss Roland
Closes: https://bugs.gentoo.org/675926
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 games-emulation/zsnes/Manifest                     |   1 +
 .../zsnes/files/zsnes-1.51-gcc43-20071031.patch    |  39 +++++++
 games-emulation/zsnes/zsnes-1.51-r8.ebuild         | 124 +++++++++++++++++++++
 3 files changed, 164 insertions(+)

diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
index 07968a9f42d..6846bebb8ae 100644
--- a/games-emulation/zsnes/Manifest
+++ b/games-emulation/zsnes/Manifest
@@ -1 +1,2 @@
+DIST zsnes-1.51-20071031.tar.bz2 1072340 BLAKE2B d67c92e382ca130d4138d21fbb2effc06539d1c7e3aabf0339c9b7e773521daf2d3cb0bcef75991e1a4453fcc86903d3dead48d90806489c8b4bf7677f8ebf3b SHA512 b10373cf81b201a33dc60c728431d4f69d36de31fcf6f137b623ea206a2998f722dcd6132daec1d0bf14a05ae52f3ee9ecee4334517039be554db85c9f7b8274
 DIST zsnes151src.tar.bz2 1071712 BLAKE2B e942c699bd227942563deb23b105339aa9ffd8a5623200ca142a777508b4ebaf47859170016490f53a3af2bfb15293c17a99a7658e1f3f0afd7df8cd63200b9a SHA512 2cec9ad7762fc7a257c6b1d3e190b0ed53565dbafe42e1dee9eb182644392b7dd2c57faa846f63cd30ac079e5c05354d26ce0612d20481a1f54d760d62d95353

diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch
new file mode 100644
index 00000000000..59fbb8fdbf1
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch
@@ -0,0 +1,39 @@
+--- src/parsegen.cpp
++++ src/parsegen.cpp
+@@ -31,6 +31,7 @@
+ #include <sstream>
+ #include <set>
+ #include <stack>
++#include <cstring>
+ using namespace std;
+ 
+ #include <errno.h>
+--- src/tools/depbuild.cpp
++++ src/tools/depbuild.cpp
+@@ -24,6 +24,7 @@
+ #include <iostream>
+ #include <string>
+ #include <cstdio>
++#include <cstdlib>
+ using namespace std;
+ 
+ #include "fileutil.h"
+@@ -183,7 +184,7 @@
+   }
+ }
+ 
+-int main(size_t argc, const char *const *const argv)
++int main(int argc, const char *const *const argv)
+ {
+   if (argc < 5)
+   {
+--- src/tools/strutil.h
++++ src/tools/strutil.h
+@@ -25,6 +25,7 @@
+ #include <string>
+ #include <vector>
+ #include <cctype>
++#include <cstring>
+ 
+ struct ci_char_traits : public std::char_traits<char>
+ {

diff --git a/games-emulation/zsnes/zsnes-1.51-r8.ebuild b/games-emulation/zsnes/zsnes-1.51-r8.ebuild
new file mode 100644
index 00000000000..1139717f6e2
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-1.51-r8.ebuild
@@ -0,0 +1,124 @@
+# 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="http://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
+)
+
+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
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2020-07-30  7:37 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2020-07-30  7:37 UTC (permalink / raw
  To: gentoo-commits

commit:     935f42dd7dff88e750666e37d2bbe98761cc0a77
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 30 07:36:37 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Jul 30 07:37:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=935f42dd

games-emulation/zsnes: tweak for gcc-11 (c++17 throw)

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 games-emulation/zsnes/files/zsnes-1.51-c++17.patch |  76 +++++++++++++
 games-emulation/zsnes/zsnes-1.51-r9.ebuild         | 125 +++++++++++++++++++++
 2 files changed, 201 insertions(+)

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 00000000000..537f32540c5
--- /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 00000000000..a56e1e85d8d
--- /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
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2021-05-11 22:57 Sergei Trofimovich
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Trofimovich @ 2021-05-11 22:57 UTC (permalink / raw
  To: gentoo-commits

commit:     8b2eebf5117453efbe1e62e6314ad58614c0d587
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue May 11 22:54:44 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue May 11 22:57:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b2eebf5

games-emulation/zsnes: fix more ao and stack alignment crashes

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../zsnes/files/zsnes-1.51-ao-crash.patch          |  30 +++++
 .../zsnes/files/zsnes-1.51-stack-align-v3.patch    |  40 +++++++
 games-emulation/zsnes/zsnes-1.51-r10.ebuild        | 128 +++++++++++++++++++++
 3 files changed, 198 insertions(+)

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 00000000000..6ce142d9c27
--- /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 00000000000..914c9afc449
--- /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/zsnes-1.51-r10.ebuild b/games-emulation/zsnes/zsnes-1.51-r10.ebuild
new file mode 100644
index 00000000000..ffa490ba20b
--- /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
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2021-12-22 18:15 Ionen Wolkens
  0 siblings, 0 replies; 6+ messages in thread
From: Ionen Wolkens @ 2021-12-22 18:15 UTC (permalink / raw
  To: gentoo-commits

commit:     aca2d57a854ca7ef3c2a1b8f12342c9929262493
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 22 15:26:24 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Dec 22 18:12:27 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aca2d57a

games-emulation/zsnes: drop 1.51-r11

This seemed unusable either way, should be no reason to keep.
Some of these patches may still be interesting, but they'll
be available in history.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-emulation/zsnes/Manifest                     |   1 -
 .../zsnes/files/zsnes-1.51-CC-quotes.patch         |  20 ----
 .../zsnes/files/zsnes-1.51-ao-crash.patch          |  30 -----
 games-emulation/zsnes/files/zsnes-1.51-arch.patch  |  77 ------------
 .../zsnes/files/zsnes-1.51-buffer.patch            |  85 --------------
 games-emulation/zsnes/files/zsnes-1.51-c++17.patch |  76 ------------
 .../zsnes/files/zsnes-1.51-cross-compile.patch     |  34 ------
 .../zsnes/files/zsnes-1.51-depbuild.patch          |  24 ----
 .../zsnes/files/zsnes-1.51-gcc-10.patch            |  11 --
 .../zsnes/files/zsnes-1.51-gcc43-20071031.patch    |  39 -------
 games-emulation/zsnes/files/zsnes-1.51-gcc47.patch |  15 ---
 .../zsnes/files/zsnes-1.51-libao-thread.patch      |  25 ----
 .../zsnes/files/zsnes-1.51-libpng.patch            |  33 ------
 .../zsnes/files/zsnes-1.51-libpng15.patch          |  12 --
 .../zsnes/files/zsnes-1.51-stack-align-v2.patch    |  56 ---------
 .../zsnes/files/zsnes-1.51-stack-align-v3.patch    |  40 -------
 .../zsnes/files/zsnes-1.51-stack-align-v4.patch    |  45 -------
 games-emulation/zsnes/metadata.xml                 |   3 -
 games-emulation/zsnes/zsnes-1.51-r11.ebuild        | 129 ---------------------
 19 files changed, 755 deletions(-)

diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
index 84c9a0519a79..eeb8097cf656 100644
--- a/games-emulation/zsnes/Manifest
+++ b/games-emulation/zsnes/Manifest
@@ -1,2 +1 @@
-DIST zsnes-1.51-20071031.tar.bz2 1072340 BLAKE2B d67c92e382ca130d4138d21fbb2effc06539d1c7e3aabf0339c9b7e773521daf2d3cb0bcef75991e1a4453fcc86903d3dead48d90806489c8b4bf7677f8ebf3b SHA512 b10373cf81b201a33dc60c728431d4f69d36de31fcf6f137b623ea206a2998f722dcd6132daec1d0bf14a05ae52f3ee9ecee4334517039be554db85c9f7b8274
 DIST zsnes-2.0.9.tar.gz 935183 BLAKE2B a9b72ed15b2ed6d9e4631b4f12b2291ddca76a7236da008eba0f8b3ee27c94b98f00ff16a4929929adf484bc16554474b942b9f8306f46ab713e8a40e1f64624 SHA512 ea9244e98a175db9bceddf14e8212b3474ddaba1f508d698d8cfc43270fa3dabf51dca43dd30255272aba3cd061bf450bef04e005ce8087d550400e66faea565

diff --git a/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch b/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch
deleted file mode 100644
index d3230d6d70d5..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-CC-quotes.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/Makefile.in.orig
-+++ src/Makefile.in
-@@ -95,7 +95,7 @@
- %.o: %.cpp
- 	@CXX@ @CXXFLAGS@ -o $@ -c $<
- %.o %.h: %.psr $(PSR)
--	./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
-+	./$(PSR) @PSRFLAGS@ -gcc "@CC@" -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
- 
- default: main
- all: main tools--- zsnes_1_51/src/Makefile.in.orig	2009-02-25 18:02:07.000000000 +0100
-@@ -133,7 +133,7 @@
- 
- include makefile.dep
- makefile.dep: $(TOOL_D)/depbuild Makefile
--	$(TOOL_D)/depbuild @CC@ "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
-+	$(TOOL_D)/depbuild "@CC@" "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
- 
- Makefile: Makefile.in config.status
- 	./config.status

diff --git a/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch b/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch
deleted file mode 100644
index 6ce142d9c27c..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-ao-crash.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-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-arch.patch b/games-emulation/zsnes/files/zsnes-1.51-arch.patch
deleted file mode 100644
index b39549871b7f..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-arch.patch
+++ /dev/null
@@ -1,77 +0,0 @@
---- a/configure.in.orig
-+++ b/configure.in
-@@ -233,72 +233,8 @@
-   debug=no)
- AC_MSG_CHECKING(if you want gdb friendly executable)
- AC_MSG_RESULT($debug)
--if test x$debug = xyes; then
--dnl - It is easier to debug zsnes with no optimization enabled.
--  ZSNESEXE="zsnesd"
--  PSR_TEMP=""
--  CFLAGS="$CFLAGS -Wall -W -DDEBUG -O0 -fno-omit-frame-pointer -gstabs3"
--  NFLAGS="$NFLAGS -DDEBUG -g -F stabs -s -O0"
--else
--  ZSNESEXE="zsnes"
--  PSR_TEMP="	rm -f t_\$*.c"
--
--  CFLAGSBAK="$CFLAGS"
--  AC_ARG_VAR(force_arch, [Force architecture to optimize GCC/G++ for])
--  AC_MSG_CHECKING(which cpu architecture to optimize for)
--  if test x$force_arch != x; then
--    CFLAGS="$CFLAGS -march=$force_arch"
--    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]])],
--    [AC_MSG_RESULT(forcing $force_arch)],
--    [AC_MSG_RESULT($force_arch ??)
--    AC_MSG_WARN(incorrect force_arch parameter)
--    force_arch=""
--    CFLAGS="$CFLAGSBAK"
--    AC_MSG_CHECKING(for autodetected architecture)])
--  else
--    if test x$ARCH_INFO = x; then
--      case x$target in
--        i686-*-*)
--          AC_MSG_RESULT(guessing i686)
--          CFLAGS="$CFLAGS -march=i686"
--          ;;
--        i586-*-*)
--          AC_MSG_RESULT(guessing i586)
--          CFLAGS="$CFLAGS -march=i586"
--          ;;
--        i486-*-*)
--          AC_MSG_RESULT(guessing i486)
--          CFLAGS="$CFLAGS -march=i486"
--          ;;
--        *)
--          AC_MSG_RESULT(guessing i386)
--          CFLAGS="$CFLAGS -march=i386"
--          AC_MSG_WARN([This is not what you want, use --target or force-arch])
--          ;;
--      esac
--    else
--      AC_MSG_RESULT($ARCH_INFO)
--      CFLAGS="$CFLAGS -march=$ARCH_INFO"
--    fi
--  fi
--
--  AC_ARG_ENABLE(release,
--    [  --enable-release        Build ultra-optimized release binary (zsnes)],
--    release=$enableval,
--    release=no)
--  AC_MSG_CHECKING(if you want crazy optimizations)
--  AC_MSG_RESULT($release)
--  if test x$release = xyes; then
--    if test x$force_arch = x; then
--      AC_MSG_WARN([If you intend to distribute this binary, make sure you use force_arch and set to i586 (or whichever CPU Arch you intend for)])
--    fi
--    CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr $STRIP -D__RELEASE__"
--    NFLAGS="$NFLAGS -O99999999 -D__RELEASE__"
--  else
--    CFLAGS="$CFLAGS -O3 -fomit-frame-pointer $STRIP"
--    NFLAGS="$NFLAGS -O1"
--  fi
--fi
-+ZSNESEXE="zsnes"
-+PSR_TEMP="	rm -f t_\$*.c"
- CXXFLAGS="$CFLAGS -fno-rtti"
- 
- if test x$enable_jma != xno; then

diff --git a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch b/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
deleted file mode 100644
index eb463682196d..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-buffer.patch
+++ /dev/null
@@ -1,85 +0,0 @@
---- src/initc.c.fortify
-+++ src/initc.c
-@@ -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);
---- src/zstate.c.fortify
-+++ src/zstate.c
-@@ -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);
-     }
-     */
-   }
---- 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;
- 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/files/zsnes-1.51-c++17.patch b/games-emulation/zsnes/files/zsnes-1.51-c++17.patch
deleted file mode 100644
index 537f32540c58..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-c++17.patch
+++ /dev/null
@@ -1,76 +0,0 @@
---- 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/files/zsnes-1.51-cross-compile.patch b/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch
deleted file mode 100644
index 5c412e3e649b..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-cross-compile.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- src/acinclude.m4
-+++ src/acinclude.m4
-@@ -107,7 +107,7 @@ int main (int argc, char *argv[])
-   with_zlib=yes,
-   with_zlib=no,
-   [AC_MSG_RESULT(cross-compiling)
--  with_zlib=""
-+  with_zlib="cross"
-   AC_MSG_WARN(Assuming zlib is available)])
- 
- if test x$with_zlib != x; then
-@@ -116,7 +116,7 @@ fi
- if test x$with_zlib = xyes; then
-   ZLIB_VERSION=$(<conf.zlibtest)
-   ifelse([$2], , :, [$2])
--else
-+elif test x$with_zlib != xcross; then
-   ZLIB_CFLAGS=""
-   ZLIB_LIBS=""
-   ZLIB_VERSION=""
---- 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
- 
-+BUILD_CXX ?= g++
-+BUILD_CXXFLAGS ?= -O2 -pipe
- $(PSR): parsegen.cpp
--	@CXX@ @CXXFLAGS@ -o $@ $< -lz
-+	$(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $< -lz
- 
- TOOLSEXE=$(TOOL_D)/archopt $(TOOL_D)/cutrtype $(TOOL_D)/extraext\
- 	$(TOOL_D)/macroll $(TOOL_D)/minwhite $(TOOL_D)/nreplace\

diff --git a/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch b/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch
deleted file mode 100644
index 2dbb5f558a46..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-depbuild.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- src/tools/depbuild.cpp.orig
-+++ src/tools/depbuild.cpp
-@@ -130,7 +130,20 @@
- void dependency_calculate_asm(const char *filename)
- {
-   string command = nasm + " " + nflags + " -M " + filename;
--  system(command.c_str());
-+  FILE *fp = popen(command.c_str(), "r");
-+  if (fp)
-+  {
-+    char line[256];
-+    while (fgets(line, sizeof(line), fp)) //Process all lines of output
-+    {
-+      cout << line;
-+    }
-+    pclose(fp);
-+  }
-+  else
-+  {
-+    cerr << "Failed on: " << filename << "\n";
-+  }
- }
- 
- void dependency_calculate_psr(const char *filename)

diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc-10.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc-10.patch
deleted file mode 100644
index 71a1392e6a4e..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-gcc-10.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/initc.c
-+++ b/initc.c
-@@ -1495,7 +1495,7 @@ Would be nice to trash this section in the future
- extern unsigned char ENVDisable, cycpb268, cycpb358, cycpbl2, cycpblt2, cycpbl;
- extern unsigned char cycpblt, opexec268, opexec358, opexec268b, opexec358b;
- extern unsigned char opexec268cph, opexec358cph, opexec268cphb, opexec358cphb;
--bool HacksDisable;
-+extern bool HacksDisable;
- 
- void headerhack()
- {

diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch
deleted file mode 100644
index 59fbb8fdbf19..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-gcc43-20071031.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- src/parsegen.cpp
-+++ src/parsegen.cpp
-@@ -31,6 +31,7 @@
- #include <sstream>
- #include <set>
- #include <stack>
-+#include <cstring>
- using namespace std;
- 
- #include <errno.h>
---- src/tools/depbuild.cpp
-+++ src/tools/depbuild.cpp
-@@ -24,6 +24,7 @@
- #include <iostream>
- #include <string>
- #include <cstdio>
-+#include <cstdlib>
- using namespace std;
- 
- #include "fileutil.h"
-@@ -183,7 +184,7 @@
-   }
- }
- 
--int main(size_t argc, const char *const *const argv)
-+int main(int argc, const char *const *const argv)
- {
-   if (argc < 5)
-   {
---- src/tools/strutil.h
-+++ src/tools/strutil.h
-@@ -25,6 +25,7 @@
- #include <string>
- #include <vector>
- #include <cctype>
-+#include <cstring>
- 
- struct ci_char_traits : public std::char_traits<char>
- {

diff --git a/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch b/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch
deleted file mode 100644
index b3250fee679b..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-gcc47.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Fix compile with gcc47
-Bug #419635
-https://bugs.gentoo.org/show_bug.cgi?id=419635
-Submitted by Nikos Chantziaras
-
---- src/tools/depbuild.cpp
-+++ src/tools/depbuild.cpp
-@@ -25,6 +25,7 @@
- #include <string>
- #include <cstdio>
- #include <cstdlib>
-+#include <unistd.h>
- using namespace std;
- 
- #include "fileutil.h"

diff --git a/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch b/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch
deleted file mode 100644
index 1ae0a1467b3e..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-libao-thread.patch
+++ /dev/null
@@ -1,25 +0,0 @@
---- 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
-   {
--    if (pthread_create(&audio_thread, 0, SoundThread_ao, 0))
--    {
--      puts("pthread_create() failed.");
--    }
--    else if (pthread_mutex_init(&audio_mutex, 0))
-+    if (pthread_mutex_init(&audio_mutex, 0))
-     {
-       puts("pthread_mutex_init() failed.");
-     }
-@@ -189,6 +185,10 @@
-     {
-       puts("pthread_cond_init() failed.");
-     }
-+    else if (pthread_create(&audio_thread, 0, SoundThread_ao, 0))
-+    {
-+      puts("pthread_create() failed.");
-+    }
-     InitSampleControl();
-   }

diff --git a/games-emulation/zsnes/files/zsnes-1.51-libpng.patch b/games-emulation/zsnes/files/zsnes-1.51-libpng.patch
deleted file mode 100644
index fd974e799e30..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-libpng.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -163,21 +163,21 @@
-   libpng_prefix="")
- 
- min_libpng_version=ifelse([$1], ,1.2.0,$1)
--tempLIBS="$LIBS"
--tempCFLAGS="$CFLAGS"
--if test x$libpng_prefix != x ; then
--  LIBPNG_LIBS="-L$libpng_prefix"
--  LIBPNG_CFLAGS="-I$libpng_prefix"
--fi
--LIBPNG_LIBS="$LIBPNG_LIBS -lpng -lm"
--LIBS="$LIBS $LIBPNG_LIBS"
--CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
- 
- AC_MSG_CHECKING(for libpng - version >= $min_libpng_version)
- 
- dnl <--- disable for no user choice part #2
- if test x$enable_libpng != xno; then
- dnl --->
-+  tempLIBS="$LIBS"
-+  tempCFLAGS="$CFLAGS"
-+  if test x$libpng_prefix != x ; then
-+    LIBPNG_LIBS="-L$libpng_prefix"
-+    LIBPNG_CFLAGS="-I$libpng_prefix"
-+  fi
-+  LIBPNG_LIBS="$LIBPNG_LIBS -lpng -lm"
-+  LIBS="$LIBS $LIBPNG_LIBS"
-+  CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
- 
-   AC_RUN_IFELSE([AC_LANG_SOURCE([[
- #include <png.h>

diff --git a/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch b/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch
deleted file mode 100644
index b32c30967547..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-libpng15.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Use existing png_set_IHDR() and stop accessing PNG structure members directly
-
---- src/zip/zpng.c
-+++ src/zip/zpng.c
-@@ -129,7 +129,6 @@
-         png_set_IHDR(png_ptr, info_ptr, width, height, 8,
-                      PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
-                      PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
--        info_ptr->color_type = PNG_COLOR_TYPE_RGB;
- 
-         //Allocate an array of scanline pointers
-         row_pointers = (png_bytep*)malloc(height*sizeof(png_bytep));

diff --git a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch b/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch
deleted file mode 100644
index 35613a953596..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v2.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-zsnes call C initialization code from assembler.
-
-Example backtrace:
-
-    Thread 1 "zsnes" received signal SIGSEGV, Segmentation fault.
-    => 0xf7550275 <+37>:    vmovdqa (%esp),%xmm1
-    ...
-    #13 0x5699ef82 in InitSound () at linux/audio.c:336
-    #14 0x569a25af in initwinvideo () at linux/sdllink.c:1080
-    #15 0x5699fc13 in initvideo () at linux/sdllink.c:1298
-    #16 0x56f9d5bc in regptwa ()
-    #17 0x56a34b50 in SA1tableG ()
-    #18 0x56f84788 in selcB800 ()
-    ...
-
-Call to 'initwinvideo' (first C function) looks like that:
-  NEWSYM InitPreGame   ; Executes before starting/continuing a game
-      mov byte[pressed+1],2
-      pushad
-      call Start60HZ
-  %ifdef __OPENGL__
-      call drawscreenwin
-  %endif
-      call initwinvideo
-
-Note: pushad / call does not 16-byte maintain stack alignment
-and breaks i386 ABI.
-
-We apply realignment attribute to all functions noticed by users.
-Bug: https://bugs.gentoo.org/503138
---- src/linux/sdllink.c.old
-+++ src/linux/sdllink.c
-@@ -773,11 +773,11 @@ BOOL InitInput()
- {
-   InitJoystickInput();
-   return TRUE;
- }
- 
--int startgame()
-+int __attribute__((force_align_arg_pointer)) startgame()
- {
-   static bool ranonce = false;
-   int status;
- 
-   if (!ranonce)
---- a/linux/sdllink.c
-+++ b/linux/sdllink.c
-@@ -897,7 +897,7 @@ bool OGLModeCheck()
-    return(cvidmode > 4);
- }
- 
--void initwinvideo(void)
-+void __attribute__((force_align_arg_pointer)) initwinvideo(void)
- {
-   DWORD newmode = 0;
- 

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
deleted file mode 100644
index 914c9afc4495..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v3.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- 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
deleted file mode 100644
index 7e015d53ebd9..000000000000
--- a/games-emulation/zsnes/files/zsnes-1.51-stack-align-v4.patch
+++ /dev/null
@@ -1,45 +0,0 @@
---- 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/metadata.xml b/games-emulation/zsnes/metadata.xml
index b9c0479894ce..a775a3d1ea84 100644
--- a/games-emulation/zsnes/metadata.xml
+++ b/games-emulation/zsnes/metadata.xml
@@ -5,9 +5,6 @@
 		<email>games@gentoo.org</email>
 		<name>Gentoo Games Project</name>
 	</maintainer>
-	<use>
-		<flag name="debug">Enable the builtin debugger</flag>
-	</use>
 	<upstream>
 		<remote-id type="github">xyproto/zsnes</remote-id>
 		<remote-id type="sourceforge">zsnes</remote-id>

diff --git a/games-emulation/zsnes/zsnes-1.51-r11.ebuild b/games-emulation/zsnes/zsnes-1.51-r11.ebuild
deleted file mode 100644
index 204a33f3892c..000000000000
--- a/games-emulation/zsnes/zsnes-1.51-r11.ebuild
+++ /dev/null
@@ -1,129 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools desktop flag-o-matic multilib 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
-}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2021-12-22 18:15 Ionen Wolkens
  0 siblings, 0 replies; 6+ messages in thread
From: Ionen Wolkens @ 2021-12-22 18:15 UTC (permalink / raw
  To: gentoo-commits

commit:     484cf796cfa38577842783be53a79346b65a8dcf
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 22 10:53:17 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Dec 22 18:12:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=484cf796

games-emulation/zsnes: add 2.0.9 (fork) with new dumbed down ebuild

zsnes is very fragile, and supporting many configurations/flags
doesn't seem worth it anymore. So this uses current upstream
defaults for safety (no libao+debugger, and enable sdl+png+opengl).

May possibly have some new issues / regressions to iron out, notably
given doesn't use autoconf anymore which shifted many things around.

Unsure if this fork will be maintained on the long term, if not
then this package may be better off last-rited.

bug 817395: fork uses FORTIFY_SOURCE=0 which combined with -U should
            ensure it's unused even if our gcc enables it by default
(issue does exist still, was able to reproduce if letting it use it)
bug 829785: cause is unknown but can't reproduce when using the fork

Closes: https://bugs.gentoo.org/817395
Closes: https://bugs.gentoo.org/829785
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-emulation/zsnes/Manifest                     |  1 +
 .../zsnes/files/zsnes-2.0.9-cc-quotes.patch        |  8 +++
 .../zsnes/files/zsnes-2.0.9-gentoo-zlib.patch      | 12 +++++
 games-emulation/zsnes/zsnes-2.0.9.ebuild           | 62 ++++++++++++++++++++++
 4 files changed, 83 insertions(+)

diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
index 23bb4c0f0963..84c9a0519a79 100644
--- a/games-emulation/zsnes/Manifest
+++ b/games-emulation/zsnes/Manifest
@@ -1 +1,2 @@
 DIST zsnes-1.51-20071031.tar.bz2 1072340 BLAKE2B d67c92e382ca130d4138d21fbb2effc06539d1c7e3aabf0339c9b7e773521daf2d3cb0bcef75991e1a4453fcc86903d3dead48d90806489c8b4bf7677f8ebf3b SHA512 b10373cf81b201a33dc60c728431d4f69d36de31fcf6f137b623ea206a2998f722dcd6132daec1d0bf14a05ae52f3ee9ecee4334517039be554db85c9f7b8274
+DIST zsnes-2.0.9.tar.gz 935183 BLAKE2B a9b72ed15b2ed6d9e4631b4f12b2291ddca76a7236da008eba0f8b3ee27c94b98f00ff16a4929929adf484bc16554474b942b9f8306f46ab713e8a40e1f64624 SHA512 ea9244e98a175db9bceddf14e8212b3474ddaba1f508d698d8cfc43270fa3dabf51dca43dd30255272aba3cd061bf450bef04e005ce8087d550400e66faea565

diff --git a/games-emulation/zsnes/files/zsnes-2.0.9-cc-quotes.patch b/games-emulation/zsnes/files/zsnes-2.0.9-cc-quotes.patch
new file mode 100644
index 000000000000..d2615149601b
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-2.0.9-cc-quotes.patch
@@ -0,0 +1,8 @@
+Does not expect CC may have arguments rather than being in CFLAGS, e.g. -m32
+--- a/Makefile
++++ b/Makefile
+@@ -355,3 +355,3 @@
+ 	@echo '===> PSR $@'
+-	$(Q)./$(PSR) $(CFGDEFS) -gcc $(CC_TARGET) -compile -flags '$(CFLAGS)' -cheader $@ -fname $(*F) $(@:.h=.o) $<
++	$(Q)./$(PSR) $(CFGDEFS) -gcc '$(CC_TARGET)' -compile -flags '$(CFLAGS)' -cheader $@ -fname $(*F) $(@:.h=.o) $<
+ 

diff --git a/games-emulation/zsnes/files/zsnes-2.0.9-gentoo-zlib.patch b/games-emulation/zsnes/files/zsnes-2.0.9-gentoo-zlib.patch
new file mode 100644
index 000000000000..a5b5f584e177
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-2.0.9-gentoo-zlib.patch
@@ -0,0 +1,12 @@
+Gentoo-specific workaround due to https://bugs.gentoo.org/383179
+--- a/zip/zunzip.h
++++ b/zip/zunzip.h
+@@ -48,4 +48,8 @@
+ #include <zlib.h>
+ 
++#ifndef OF
++#define OF _Z_OF
++#endif
++
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted

diff --git a/games-emulation/zsnes/zsnes-2.0.9.ebuild b/games-emulation/zsnes/zsnes-2.0.9.ebuild
new file mode 100644
index 000000000000..a948fb8c0346
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-2.0.9.ebuild
@@ -0,0 +1,62 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Fork of the classic Super Nintendo emulator"
+HOMEPAGE="https://github.com/xyproto/zsnes/ https://www.zsnes.com/"
+SRC_URI="https://github.com/xyproto/zsnes/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="custom-cflags"
+
+RDEPEND="
+	media-libs/libpng:=[abi_x86_32(-)]
+	media-libs/libsdl[abi_x86_32(-),joystick,opengl,sound,video]
+	sys-libs/zlib:=[abi_x86_32(-)]
+	virtual/opengl[abi_x86_32(-)]
+	x11-libs/libX11[abi_x86_32(-)]"
+DEPEND="
+	${RDEPEND}
+	x11-base/xorg-proto"
+BDEPEND="
+	dev-lang/nasm
+	sys-libs/zlib
+	virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.9-cc-quotes.patch
+	"${FILESDIR}"/${PN}-2.0.9-gentoo-zlib.patch
+)
+
+src_compile() {
+	# config.linux forces many CFLAGS that are questionable, but zsnes'
+	# ancient x86 asm is very fragile, not pic safe (bug #427104), broken
+	# by FORTIFY_SOURCE (bug #257963), and can be affected by -march=* and
+	# similar. Stick to upstream's choices, this is non-portable either way.
+	use custom-cflags || strip-flags
+	append-cppflags -U_FORTIFY_SOURCE
+
+	# used to build and run parsegen at build time (uses zlib wrt BDEPEND)
+	local buildcxx="$(tc-getBUILD_CXX) ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+
+	use amd64 && multilib_toolchain_setup x86
+	tc-export CC CXX
+	append-cflags "${CPPFLAGS}"
+	append-cxxflags "${CPPFLAGS}"
+
+	emake CXX_HOST="${buildcxx}"
+}
+
+src_install() {
+	emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+
+	dodoc README.md TODO.md
+
+	newicon icons/64x64x32.png ${PN}.png
+	make_desktop_entry ${PN} ${PN^^}
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/
@ 2024-07-29 20:53 James Le Cuirot
  0 siblings, 0 replies; 6+ messages in thread
From: James Le Cuirot @ 2024-07-29 20:53 UTC (permalink / raw
  To: gentoo-commits

commit:     be00b65f35f0589bd71763a747f13d3f366e67de
Author:     Aliaksei Urbanski <aliaksei.urbanski <AT> gmail <DOT> com>
AuthorDate: Mon Jul 29 06:54:26 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Mon Jul 29 20:52:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be00b65f

games-emulation/zsnes: add 2.0.12

Tag:
  - https://github.com/xyproto/zsnes/releases/tag/2.0.12

Changes in comparison to 2.0.10:
  - fix missing XDG updates

Signed-off-by: Aliaksei Urbanski <aliaksei.urbanski <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/37767
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 games-emulation/zsnes/Manifest                     |  1 +
 .../zsnes/files/zsnes-2.0.12-initc.patch           | 28 +++++++++
 games-emulation/zsnes/zsnes-2.0.12.ebuild          | 66 ++++++++++++++++++++++
 3 files changed, 95 insertions(+)

diff --git a/games-emulation/zsnes/Manifest b/games-emulation/zsnes/Manifest
index 721d02267537..a10397ee99a5 100644
--- a/games-emulation/zsnes/Manifest
+++ b/games-emulation/zsnes/Manifest
@@ -1 +1,2 @@
 DIST zsnes-2.0.10.tar.gz 926347 BLAKE2B b9ab4701290ae802cb35045e0a3d4ff5268f96f7dc84614f39e950a6273a8477d5e2dca0598e3448744486de31caf692d44d36fe284f6f20697a5b4e92c908f8 SHA512 513e350198a944af47accedc6d3c14405898c753bb8168871d323c11f8c1253d8d7e247759a13e40a3b5eda195824e4862bb1fc093a3db9a75c8bb2e0bef728e
+DIST zsnes-2.0.12.tar.gz 963569 BLAKE2B c11496cb5f08930dac23598ade337d9ab5d41f484b8f0ad68b1f01832d3d5ef078d65b3d639719b23eaaaf4406248eb47959b582ab7b96b142993ff532c1f3d2 SHA512 f321582a32a334cb32d9276c88c03db7d99c7ccce67a73a777bea6d66f3551a3013d1cfd38fda37867fb2424cde79ca4220894b27615f0f5c5a6de8ffaef037a

diff --git a/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch b/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch
new file mode 100644
index 000000000000..d6ce00b93db0
--- /dev/null
+++ b/games-emulation/zsnes/files/zsnes-2.0.12-initc.patch
@@ -0,0 +1,28 @@
+# https://github.com/xyproto/zsnes/issues/19#issuecomment-1710906677
+# https://github.com/TrashRaccoonSnuffy/zsnes/commit/f77ec1a0
+
+Author: Sneed <127693805+TrashRaccoonSnuffy@users.noreply.github.com>
+Date: Thu, 7 Sep 2023 21:06:10 -0300
+
+    Fix a buffer overflow
+
+--- a/initc.c
++++ b/initc.c
+@@ -1364,7 +1364,7 @@ void clearmem(void)
+ }
+ 
+ extern uint8_t BRRBuffer[];
+-extern uint8_t echoon0;
++extern uint8_t echoon0[];
+ extern uint32_t PHdspsave;
+ extern uint32_t PHdspsave2;
+ s4 echobuf[22500];
+@@ -1373,7 +1373,7 @@ extern uint8_t DSPMem[256];
+ void clearvidsound()
+ {
+     memset(BRRBuffer, 0, PHdspsave);
+-    memset(&echoon0, 0, PHdspsave2);
++    memset(echoon0, 0, PHdspsave2);
+     memset(&echobuf, 0, sizeof(echobuf));
+     memset(spcBuffera, 0, 65536 * 4 + 4096);
+     memset(DSPMem, 0, 256);

diff --git a/games-emulation/zsnes/zsnes-2.0.12.ebuild b/games-emulation/zsnes/zsnes-2.0.12.ebuild
new file mode 100644
index 000000000000..db3d40f511b3
--- /dev/null
+++ b/games-emulation/zsnes/zsnes-2.0.12.ebuild
@@ -0,0 +1,66 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic multilib toolchain-funcs xdg
+
+DESCRIPTION="Fork of the classic Super Nintendo emulator"
+HOMEPAGE="https://github.com/xyproto/zsnes/ https://www.zsnes.com/"
+SRC_URI="https://github.com/xyproto/zsnes/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="custom-cflags"
+
+RDEPEND="
+	media-libs/libglvnd[X,abi_x86_32(-)]
+	media-libs/libpng:=[abi_x86_32(-)]
+	media-libs/libsdl[abi_x86_32(-),joystick,opengl,sound,video]
+	sys-libs/zlib:=[abi_x86_32(-)]
+	x11-libs/libX11[abi_x86_32(-)]"
+DEPEND="
+	${RDEPEND}
+	x11-base/xorg-proto"
+BDEPEND="
+	dev-lang/nasm
+	sys-libs/zlib
+	virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.9-cc-quotes.patch
+	"${FILESDIR}"/${PN}-2.0.9-gentoo-zlib.patch
+	"${FILESDIR}"/${P}-initc.patch
+)
+
+src_compile() {
+	# Makefile forces many CFLAGS that are questionable, but zsnes' ancient x86
+	# asm is fragile, not pic safe (bug #427104), broken by F_S=3 (formerly
+	# broken with =2 as well), and can be affected by -march=* and similar.
+	# Stick to upstream's choices, this is non-portable either way.
+	if use !custom-cflags; then
+		strip-flags
+		append-cppflags -U_FORTIFY_SOURCE # to disable =3, Makefile enables =2
+	fi
+
+	# used to build and run parsegen at build time (uses zlib wrt BDEPEND)
+	tc-export_build_env BUILD_CXX
+	local buildcxx="${BUILD_CXX} ${BUILD_CXXFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS}"
+
+	use amd64 && multilib_toolchain_setup x86
+	tc-export CC CXX
+	append-cflags "${CPPFLAGS}"
+	append-cxxflags "${CPPFLAGS}"
+
+	emake CXX_HOST="${buildcxx}"
+}
+
+src_install() {
+	emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+
+	dodoc README.md TODO.md
+
+	newicon icons/64x64x32.png ${PN}.png
+	make_desktop_entry ${PN} ${PN^^}
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-07-29 20:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 20:53 [gentoo-commits] repo/gentoo:master commit in: games-emulation/zsnes/, games-emulation/zsnes/files/ James Le Cuirot
  -- strict thread matches above, loose matches on Subject: below --
2021-12-22 18:15 Ionen Wolkens
2021-12-22 18:15 Ionen Wolkens
2021-05-11 22:57 Sergei Trofimovich
2020-07-30  7:37 Sergei Trofimovich
2020-02-04 21:38 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox