1 |
commit: 935f42dd7dff88e750666e37d2bbe98761cc0a77 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 30 07:36:37 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 30 07:37:07 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=935f42dd |
7 |
|
8 |
games-emulation/zsnes: tweak for gcc-11 (c++17 throw) |
9 |
|
10 |
Package-Manager: Portage-3.0.1, Repoman-2.3.23 |
11 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
12 |
|
13 |
games-emulation/zsnes/files/zsnes-1.51-c++17.patch | 76 +++++++++++++ |
14 |
games-emulation/zsnes/zsnes-1.51-r9.ebuild | 125 +++++++++++++++++++++ |
15 |
2 files changed, 201 insertions(+) |
16 |
|
17 |
diff --git a/games-emulation/zsnes/files/zsnes-1.51-c++17.patch b/games-emulation/zsnes/files/zsnes-1.51-c++17.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..537f32540c5 |
20 |
--- /dev/null |
21 |
+++ b/games-emulation/zsnes/files/zsnes-1.51-c++17.patch |
22 |
@@ -0,0 +1,76 @@ |
23 |
+--- a/jma/jma.cpp |
24 |
++++ b/jma/jma.cpp |
25 |
+@@ -48,7 +48,7 @@ namespace JMA |
26 |
+ |
27 |
+ |
28 |
+ //Retreive the file block, what else? |
29 |
+- void jma_open::retrieve_file_block() throw(jma_errors) |
30 |
++ void jma_open::retrieve_file_block() |
31 |
+ { |
32 |
+ unsigned char uint_buffer[UINT_SIZE]; |
33 |
+ unsigned char ushort_buffer[USHORT_SIZE]; |
34 |
+@@ -168,7 +168,7 @@ namespace JMA |
35 |
+ } |
36 |
+ |
37 |
+ //Constructor for opening JMA files for reading |
38 |
+- jma_open::jma_open(const char *compressed_file_name) throw (jma_errors) |
39 |
++ jma_open::jma_open(const char *compressed_file_name) |
40 |
+ { |
41 |
+ decompressed_buffer = 0; |
42 |
+ compressed_buffer = 0; |
43 |
+@@ -229,7 +229,7 @@ namespace JMA |
44 |
+ } |
45 |
+ |
46 |
+ //Skip forward a given number of chunks |
47 |
+- void jma_open::chunk_seek(unsigned int chunk_num) throw(jma_errors) |
48 |
++ void jma_open::chunk_seek(unsigned int chunk_num) |
49 |
+ { |
50 |
+ //Check the stream is open |
51 |
+ if (!stream.is_open()) |
52 |
+@@ -257,7 +257,7 @@ namespace JMA |
53 |
+ |
54 |
+ //Return a vector of pointers to each file in the JMA, the buffer to hold all the files |
55 |
+ //must be initilized outside. |
56 |
+- vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer) throw(jma_errors) |
57 |
++ vector<unsigned char *> jma_open::get_all_files(unsigned char *buffer) |
58 |
+ { |
59 |
+ //If there's no stream we can't read from it, so exit |
60 |
+ if (!stream.is_open()) |
61 |
+@@ -396,7 +396,7 @@ namespace JMA |
62 |
+ } |
63 |
+ |
64 |
+ //Extracts the file with a given name found in the archive to the given buffer |
65 |
+- void jma_open::extract_file(string& name, unsigned char *buffer) throw(jma_errors) |
66 |
++ void jma_open::extract_file(string& name, unsigned char *buffer) |
67 |
+ { |
68 |
+ if (!stream.is_open()) |
69 |
+ { |
70 |
+--- a/jma/jma.h |
71 |
++++ b/jma/jma.h |
72 |
+@@ -64,12 +64,12 @@ namespace JMA |
73 |
+ class jma_open |
74 |
+ { |
75 |
+ public: |
76 |
+- jma_open(const char *) throw(jma_errors); |
77 |
++ jma_open(const char *); |
78 |
+ ~jma_open(); |
79 |
+ |
80 |
+ std::vector<jma_public_file_info> get_files_info(); |
81 |
+- std::vector<unsigned char *> get_all_files(unsigned char *) throw(jma_errors); |
82 |
+- void extract_file(std::string& name, unsigned char *) throw(jma_errors); |
83 |
++ std::vector<unsigned char *> get_all_files(unsigned char *); |
84 |
++ void extract_file(std::string& name, unsigned char *); |
85 |
+ bool is_solid(); |
86 |
+ |
87 |
+ private: |
88 |
+@@ -79,8 +79,8 @@ namespace JMA |
89 |
+ unsigned char *decompressed_buffer; |
90 |
+ unsigned char *compressed_buffer; |
91 |
+ |
92 |
+- void chunk_seek(unsigned int) throw(jma_errors); |
93 |
+- void retrieve_file_block() throw(jma_errors); |
94 |
++ void chunk_seek(unsigned int); |
95 |
++ void retrieve_file_block(); |
96 |
+ }; |
97 |
+ |
98 |
+ const char *jma_error_text(jma_errors); |
99 |
|
100 |
diff --git a/games-emulation/zsnes/zsnes-1.51-r9.ebuild b/games-emulation/zsnes/zsnes-1.51-r9.ebuild |
101 |
new file mode 100644 |
102 |
index 00000000000..a56e1e85d8d |
103 |
--- /dev/null |
104 |
+++ b/games-emulation/zsnes/zsnes-1.51-r9.ebuild |
105 |
@@ -0,0 +1,125 @@ |
106 |
+# Copyright 1999-2020 Gentoo Authors |
107 |
+# Distributed under the terms of the GNU General Public License v2 |
108 |
+ |
109 |
+EAPI=7 |
110 |
+inherit autotools desktop flag-o-matic toolchain-funcs pax-utils |
111 |
+ |
112 |
+DESCRIPTION="SNES (Super Nintendo) emulator that uses x86 assembly" |
113 |
+HOMEPAGE="https://www.zsnes.com/ http://ipherswipsite.com/zsnes/" |
114 |
+SRC_URI="mirror://sourceforge/zsnes/${PN}${PV//./}src.tar.bz2 -> ${P}-20071031.tar.bz2" |
115 |
+ |
116 |
+LICENSE="GPL-2" |
117 |
+SLOT="0" |
118 |
+KEYWORDS="-* ~amd64 ~x86 ~amd64-linux ~x86-linux" |
119 |
+IUSE="ao custom-cflags +debug opengl png" |
120 |
+ |
121 |
+RDEPEND=" |
122 |
+ media-libs/libsdl[sound,video,abi_x86_32(-)] |
123 |
+ >=sys-libs/zlib-1.2.3-r1[abi_x86_32(-)] |
124 |
+ ao? ( media-libs/libao[abi_x86_32(-)] ) |
125 |
+ debug? ( sys-libs/ncurses:0=[abi_x86_32(-)] ) |
126 |
+ opengl? ( virtual/opengl[abi_x86_32(-)] ) |
127 |
+ png? ( media-libs/libpng:0=[abi_x86_32(-)] ) |
128 |
+" |
129 |
+DEPEND="${RDEPEND} |
130 |
+ dev-lang/nasm |
131 |
+ debug? ( virtual/pkgconfig ) |
132 |
+" |
133 |
+ |
134 |
+S="${WORKDIR}/${PN}_${PV//./_}/src" |
135 |
+ |
136 |
+PATCHES=( |
137 |
+ # Fixing compilation without libpng installed |
138 |
+ "${FILESDIR}"/${P}-libpng.patch |
139 |
+ |
140 |
+ # Fix bug #186111 |
141 |
+ # Fix bug #214697 |
142 |
+ # Fix bug #170108 |
143 |
+ # Fix bug #260247 |
144 |
+ "${FILESDIR}"/${P}-gcc43-20071031.patch |
145 |
+ "${FILESDIR}"/${P}-libao-thread.patch |
146 |
+ "${FILESDIR}"/${P}-depbuild.patch |
147 |
+ "${FILESDIR}"/${P}-CC-quotes.patch |
148 |
+ |
149 |
+ # Fix compability with libpng15 wrt #378735 |
150 |
+ "${FILESDIR}"/${P}-libpng15.patch |
151 |
+ |
152 |
+ # Fix buffer overwrite #257963 |
153 |
+ "${FILESDIR}"/${P}-buffer.patch |
154 |
+ # Fix gcc47 compile #419635 |
155 |
+ "${FILESDIR}"/${P}-gcc47.patch |
156 |
+ # Fix stack alignment issue #503138 |
157 |
+ "${FILESDIR}"/${P}-stack-align-v2.patch |
158 |
+ |
159 |
+ "${FILESDIR}"/${P}-cross-compile.patch |
160 |
+ "${FILESDIR}"/${P}-arch.patch |
161 |
+ |
162 |
+ "${FILESDIR}"/${P}-gcc-10.patch |
163 |
+ "${FILESDIR}"/${P}-c++17.patch |
164 |
+) |
165 |
+ |
166 |
+src_prepare() { |
167 |
+ default |
168 |
+ |
169 |
+ # The sdl detection logic uses AC_PROG_PATH instead of |
170 |
+ # AC_PROG_TOOL, so force the var to get set the way we |
171 |
+ # need for things to work correctly. |
172 |
+ tc-is-cross-compiler && export ac_cv_path_SDL_CONFIG=${CHOST}-sdl-config |
173 |
+ |
174 |
+ sed -i -e '67i#define OF(x) x' zip/zunzip.h || die |
175 |
+ |
176 |
+ # Remove hardcoded CFLAGS and LDFLAGS |
177 |
+ sed -i \ |
178 |
+ -e '/^CFLAGS=.*local/s:-pipe.*:-Wall -I.":' \ |
179 |
+ -e '/^LDFLAGS=.*local/d' \ |
180 |
+ -e '/\w*CFLAGS=.*fomit/s:-O3.*$STRIP::' \ |
181 |
+ -e '/lncurses/s:-lncurses:`pkg-config ncurses --libs`:' \ |
182 |
+ -e '/lcurses/s:-lcurses:`pkg-config ncurses --libs`:' \ |
183 |
+ configure.in || die |
184 |
+ sed -i \ |
185 |
+ -e 's/configure.in/configure.ac/' \ |
186 |
+ Makefile.in || die |
187 |
+ mv configure.in configure.ac || die |
188 |
+ eautoreconf |
189 |
+} |
190 |
+ |
191 |
+src_configure() { |
192 |
+ tc-export CC |
193 |
+ export BUILD_CXX=$(tc-getBUILD_CXX) |
194 |
+ export NFLAGS=-O1 |
195 |
+ use amd64 && multilib_toolchain_setup x86 |
196 |
+ use custom-cflags || strip-flags |
197 |
+ |
198 |
+ append-cppflags -U_FORTIFY_SOURCE #257963 |
199 |
+ |
200 |
+ econf \ |
201 |
+ $(use_enable ao libao) \ |
202 |
+ $(use_enable debug debugger) \ |
203 |
+ $(use_enable png libpng) \ |
204 |
+ $(use_enable opengl) \ |
205 |
+ --disable-debug \ |
206 |
+ --disable-cpucheck |
207 |
+} |
208 |
+ |
209 |
+src_compile() { |
210 |
+ emake makefile.dep |
211 |
+ emake |
212 |
+} |
213 |
+ |
214 |
+src_install() { |
215 |
+ # Uses pic-unfriendly assembly code, bug #427104 |
216 |
+ QA_TEXTRELS="usr/bin/zsnes" |
217 |
+ |
218 |
+ dobin zsnes |
219 |
+ pax-mark m "${ED}${GAMES_BINDIR}"/zsnes |
220 |
+ |
221 |
+ newman linux/zsnes.1 zsnes.6 |
222 |
+ |
223 |
+ dodoc \ |
224 |
+ ../docs/{readme.1st,authors.txt,srcinfo.txt,stdards.txt,support.txt,thanks.txt,todo.txt,README.LINUX} \ |
225 |
+ ../docs/readme.txt/* |
226 |
+ HTML_DOCS="../docs/readme.htm/*" einstalldocs |
227 |
+ |
228 |
+ make_desktop_entry zsnes ZSNES |
229 |
+ newicon icons/48x48x32.png ${PN}.png |
230 |
+} |