1 |
commit: ddce7324a0b8d698a544f489b1aa9d234657dfac |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 29 10:01:57 2018 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 29 11:25:53 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddce7324 |
7 |
|
8 |
games-emulation/gngb: Drop games.eclass, add Debian fixes |
9 |
|
10 |
Package-Manager: Portage-2.3.31, Repoman-2.3.9 |
11 |
|
12 |
games-emulation/gngb/Manifest | 1 + |
13 |
.../gngb/files/gngb-20060309-amd64.patch | 30 +++++++++ |
14 |
.../gngb/files/gngb-20060309-gcc34.patch | 22 +++++++ |
15 |
.../gngb/files/gngb-20060309-gcc5.patch | 35 +++++++++++ |
16 |
.../gngb/files/gngb-20060309-gcc7.patch | 73 ++++++++++++++++++++++ |
17 |
.../gngb/files/gngb-20060309-inline.patch | 24 +++++++ |
18 |
.../gngb/files/gngb-20060309-joystick.patch | 56 +++++++++++++++++ |
19 |
.../gngb/files/gngb-20060309-ovflfix.patch | 17 +++++ |
20 |
.../gngb/files/gngb-20060309-qwerty.patch | 24 +++++++ |
21 |
games-emulation/gngb/gngb-20060309-r1.ebuild | 44 +++++++++++++ |
22 |
10 files changed, 326 insertions(+) |
23 |
|
24 |
diff --git a/games-emulation/gngb/Manifest b/games-emulation/gngb/Manifest |
25 |
new file mode 100644 |
26 |
index 00000000000..644d1f023d4 |
27 |
--- /dev/null |
28 |
+++ b/games-emulation/gngb/Manifest |
29 |
@@ -0,0 +1 @@ |
30 |
+DIST gngb-20060309.tar.gz 168911 BLAKE2B 9377b107c3318041cf903de1661ec6a43078e1cade77b2899b6412616b2c5c32e217d5efc69fcc5324c75242f880493b1b3e678c5bc0a71a4a3ef2dbfd756b4c SHA512 169fdb94eac439240ff15fc2337908cb40e06259338d03c0193a0cb04acb9ee688832fc3157ec56e4e541a8889c4b1a4e7d0efb035b5829ffb856192b60d259f |
31 |
|
32 |
diff --git a/games-emulation/gngb/files/gngb-20060309-amd64.patch b/games-emulation/gngb/files/gngb-20060309-amd64.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..1e63ee00dd2 |
35 |
--- /dev/null |
36 |
+++ b/games-emulation/gngb/files/gngb-20060309-amd64.patch |
37 |
@@ -0,0 +1,30 @@ |
38 |
+From: Chris Lamb <lamby@××××××.org> |
39 |
+Date: Wed, 16 Aug 2017 22:53:10 +0200 |
40 |
+Subject: reproducible build |
41 |
+ |
42 |
+Bug-Debian: https://bugs.debian.org/831773 |
43 |
+--- |
44 |
+ configure.in | 3 ++- |
45 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
46 |
+ |
47 |
+diff --git a/configure.in b/configure.in |
48 |
+index 9b8aeec..145bd73 100644 |
49 |
+--- a/configure.in |
50 |
++++ b/configure.in |
51 |
+@@ -90,6 +90,7 @@ fi |
52 |
+ dnl Arch |
53 |
+ |
54 |
+ case `uname -m` in |
55 |
++*x86_64) arch_info=x86_64 ;; |
56 |
+ *686) arch_info=i686 ;; |
57 |
+ *i586) arch_info=i586 ;; |
58 |
+ *i486) arch_info=i486 ;; |
59 |
+@@ -107,7 +108,7 @@ sys_info=`uname -s` |
60 |
+ AC_MSG_RESULT(System: $sys_info) |
61 |
+ |
62 |
+ case $arch_info in |
63 |
+-i686|i586|i486|i386) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \ |
64 |
++x86_64|i686|i586|i486|i386) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \ |
65 |
+ -ffast-math -falign-functions=2 -falign-jumps=2 \ |
66 |
+ -falign-loops=2 -fomit-frame-pointer -Wall " ;; |
67 |
+ sun4u) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \ |
68 |
|
69 |
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc34.patch b/games-emulation/gngb/files/gngb-20060309-gcc34.patch |
70 |
new file mode 100644 |
71 |
index 00000000000..112569287fd |
72 |
--- /dev/null |
73 |
+++ b/games-emulation/gngb/files/gngb-20060309-gcc34.patch |
74 |
@@ -0,0 +1,22 @@ |
75 |
+From: Debian Games Team <pkg-games-devel@×××××××××××××××××××.org> |
76 |
+Date: Thu, 10 Aug 2017 19:06:35 +0000 |
77 |
+Subject: FTBFS_with_gcc-3.4_conflicting_types |
78 |
+ |
79 |
+=================================================================== |
80 |
+--- |
81 |
+ src/save.c | 2 ++ |
82 |
+ 1 file changed, 2 insertions(+) |
83 |
+ |
84 |
+diff --git a/src/save.c b/src/save.c |
85 |
+index c7e4395..bf50bdf 100644 |
86 |
+--- a/src/save.c |
87 |
++++ b/src/save.c |
88 |
+@@ -404,6 +404,8 @@ int save_load_rt_info(GNGB_FILE * stream,char op) { |
89 |
+ return 0; |
90 |
+ } |
91 |
+ |
92 |
++void movie_add_pad(Uint8 pad); |
93 |
++ |
94 |
+ int save_load_pad_movie(GNGB_FILE * stream,char op) { |
95 |
+ if (!op) { /* Write */ |
96 |
+ PAD_SAVE *p=gngb_movie.first_pad; |
97 |
|
98 |
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc5.patch b/games-emulation/gngb/files/gngb-20060309-gcc5.patch |
99 |
new file mode 100644 |
100 |
index 00000000000..72dd21a494f |
101 |
--- /dev/null |
102 |
+++ b/games-emulation/gngb/files/gngb-20060309-gcc5.patch |
103 |
@@ -0,0 +1,35 @@ |
104 |
+From: Debian Games Team <pkg-games-devel@×××××××××××××××××××.org> |
105 |
+Date: Thu, 10 Aug 2017 19:06:36 +0000 |
106 |
+Subject: gngb_fcc5_fix |
107 |
+ |
108 |
+--- |
109 |
+ src/cpu.c | 2 +- |
110 |
+ src/vram.c | 2 +- |
111 |
+ 2 files changed, 2 insertions(+), 2 deletions(-) |
112 |
+ |
113 |
+diff --git a/src/cpu.c b/src/cpu.c |
114 |
+index f03a811..57bc209 100644 |
115 |
+--- a/src/cpu.c |
116 |
++++ b/src/cpu.c |
117 |
+@@ -2826,7 +2826,7 @@ __inline__ void rom_timer_inc(void) { |
118 |
+ } |
119 |
+ } |
120 |
+ |
121 |
+-__inline__ void cpu_run(void) { |
122 |
++extern __inline__ void cpu_run(void) { |
123 |
+ static Uint32 divid_cycle; |
124 |
+ int v=0; |
125 |
+ Uint8 a; |
126 |
+diff --git a/src/vram.c b/src/vram.c |
127 |
+index 206b625..7213b4e 100644 |
128 |
+--- a/src/vram.c |
129 |
++++ b/src/vram.c |
130 |
+@@ -242,7 +242,7 @@ void switch_fullscreen(void) { |
131 |
+ conf.fs^=1; |
132 |
+ } |
133 |
+ |
134 |
+-__inline__ Uint8 get_nb_spr(void) |
135 |
++extern __inline__ Uint8 get_nb_spr(void) |
136 |
+ { |
137 |
+ Uint8 *sp=oam_space; |
138 |
+ Sint16 no_tile,x,y,att; |
139 |
|
140 |
diff --git a/games-emulation/gngb/files/gngb-20060309-gcc7.patch b/games-emulation/gngb/files/gngb-20060309-gcc7.patch |
141 |
new file mode 100644 |
142 |
index 00000000000..557e69501dc |
143 |
--- /dev/null |
144 |
+++ b/games-emulation/gngb/files/gngb-20060309-gcc7.patch |
145 |
@@ -0,0 +1,73 @@ |
146 |
+From: Markus Koschany <apo@××××××.org> |
147 |
+Date: Thu, 10 Aug 2017 19:39:05 +0000 |
148 |
+Subject: gcc7 |
149 |
+ |
150 |
+Bug-Debian: https://bugs.debian.org/853425 |
151 |
+Forwarded: no |
152 |
+--- |
153 |
+ src/cpu.c | 10 +++++----- |
154 |
+ src/memory.c | 2 +- |
155 |
+ 2 files changed, 6 insertions(+), 6 deletions(-) |
156 |
+ |
157 |
+diff --git a/src/cpu.c b/src/cpu.c |
158 |
+index 57bc209..5209548 100644 |
159 |
+--- a/src/cpu.c |
160 |
++++ b/src/cpu.c |
161 |
+@@ -61,7 +61,7 @@ static Uint8 a; |
162 |
+ #define H (gbcpu->hl.b.h) |
163 |
+ #define L (gbcpu->hl.b.l) |
164 |
+ |
165 |
+-__inline__ Uint16 get_word(void) |
166 |
++extern __inline__ Uint16 get_word(void) |
167 |
+ { |
168 |
+ //Uint16 v=((Uint16)(mem_read(PC))); |
169 |
+ Uint16 v1,v2; |
170 |
+@@ -74,7 +74,7 @@ __inline__ Uint16 get_word(void) |
171 |
+ //return v; |
172 |
+ } |
173 |
+ |
174 |
+-__inline__ Uint8 get_byte(void) |
175 |
++extern __inline__ Uint8 get_byte(void) |
176 |
+ { |
177 |
+ //Uint8 t=mem_read(PC); |
178 |
+ Uint8 t; |
179 |
+@@ -83,7 +83,7 @@ __inline__ Uint8 get_byte(void) |
180 |
+ return t; |
181 |
+ } |
182 |
+ |
183 |
+-__inline__ void push_r(REG *r) |
184 |
++extern __inline__ void push_r(REG *r) |
185 |
+ { |
186 |
+ //mem_write(--SP,(r)->b.h); |
187 |
+ //mem_write(--SP,(r)->b.l); |
188 |
+@@ -93,7 +93,7 @@ __inline__ void push_r(REG *r) |
189 |
+ mem_write_fast(SP,(r)->b.l); |
190 |
+ } |
191 |
+ |
192 |
+-__inline__ void pop_r(REG *r) |
193 |
++extern __inline__ void pop_r(REG *r) |
194 |
+ { |
195 |
+ //(r)->b.l=mem_read(SP); |
196 |
+ mem_read_fast(SP,(r)->b.l); |
197 |
+@@ -176,7 +176,7 @@ __inline__ Uint8 unknown(void){ |
198 |
+ |
199 |
+ |
200 |
+ |
201 |
+-__inline__ Uint8 gbcpu_exec_one(void) |
202 |
++extern __inline__ Uint8 gbcpu_exec_one(void) |
203 |
+ { |
204 |
+ static Uint8 opcode; |
205 |
+ if (gbcpu->ei_flag==1) { |
206 |
+diff --git a/src/memory.c b/src/memory.c |
207 |
+index 26e42d9..fd06738 100644 |
208 |
+--- a/src/memory.c |
209 |
++++ b/src/memory.c |
210 |
+@@ -737,7 +737,7 @@ Uint8 mem_read_default(Uint16 adr) |
211 |
+ return 0xFF; |
212 |
+ } |
213 |
+ |
214 |
+-__inline__ void update_gb_pad(void) { |
215 |
++extern __inline__ void update_gb_pad(void) { |
216 |
+ gb_pad=0; |
217 |
+ if (!conf.play_movie) { |
218 |
+ |
219 |
|
220 |
diff --git a/games-emulation/gngb/files/gngb-20060309-inline.patch b/games-emulation/gngb/files/gngb-20060309-inline.patch |
221 |
new file mode 100644 |
222 |
index 00000000000..d73ed4cb617 |
223 |
--- /dev/null |
224 |
+++ b/games-emulation/gngb/files/gngb-20060309-inline.patch |
225 |
@@ -0,0 +1,24 @@ |
226 |
+From: Arthur Marble <arthur@×××××.net> |
227 |
+Date: Wed, 16 Aug 2017 23:49:59 +0200 |
228 |
+Subject: clang-ftbfs |
229 |
+ |
230 |
+Bug-Debian: https://bugs.debian.org/757486 |
231 |
+--- |
232 |
+ src/global.h | 5 +++++ |
233 |
+ 1 file changed, 5 insertions(+) |
234 |
+ |
235 |
+diff --git a/src/global.h b/src/global.h |
236 |
+index bb46387..6a6d2b3 100644 |
237 |
+--- a/src/global.h |
238 |
++++ b/src/global.h |
239 |
+@@ -22,5 +22,10 @@ |
240 |
+ #include <config.h> |
241 |
+ #include <SDL.h> |
242 |
+ |
243 |
++#ifdef __clang__ |
244 |
++#define __inline__ |
245 |
++#else |
246 |
++#define __inline__ inline |
247 |
++#endif |
248 |
+ |
249 |
+ #endif |
250 |
|
251 |
diff --git a/games-emulation/gngb/files/gngb-20060309-joystick.patch b/games-emulation/gngb/files/gngb-20060309-joystick.patch |
252 |
new file mode 100644 |
253 |
index 00000000000..ec5003a52c6 |
254 |
--- /dev/null |
255 |
+++ b/games-emulation/gngb/files/gngb-20060309-joystick.patch |
256 |
@@ -0,0 +1,56 @@ |
257 |
+From: Markus Koschany <apo@××××××.org> |
258 |
+Date: Wed, 16 Aug 2017 23:25:30 +0200 |
259 |
+Subject: joystick axis |
260 |
+ |
261 |
+Bug-Debian: https://bugs.debian.org/592777 |
262 |
+Forwarded: http://m.peponas.free.fr/gngb/news.html |
263 |
+Origin: http://m.peponas.free.fr/gngb/download/memory.c.diff |
264 |
+--- |
265 |
+ src/memory.c | 17 +++++++++++++++++ |
266 |
+ 1 file changed, 17 insertions(+) |
267 |
+ |
268 |
+diff --git a/src/memory.c b/src/memory.c |
269 |
+index fd06738..9eaef1f 100644 |
270 |
+--- a/src/memory.c |
271 |
++++ b/src/memory.c |
272 |
+@@ -67,7 +67,11 @@ Uint8 ram_mask; |
273 |
+ MEM_READ_ENTRY mem_read_tab[0x10]; |
274 |
+ MEM_WRITE_ENTRY mem_write_tab[0x10]; |
275 |
+ |
276 |
++/* doesn't work for negative joy_?_min */ |
277 |
++/* |
278 |
+ Sint16 joy_x_min=0;joy_x_max=0;joy_y_min=0;joy_y_max=0; |
279 |
++*/ |
280 |
++Sint16 joy_x_min=-32767;joy_x_max=32767;joy_y_min=-32767;joy_y_max=32767; |
281 |
+ |
282 |
+ void (*select_rom_page)(Uint16 adr,Uint8 v); |
283 |
+ void (*select_ram_page)(Uint16 adr,Uint8 v); |
284 |
+@@ -755,15 +759,28 @@ extern __inline__ void update_gb_pad(void) { |
285 |
+ Sint16 joy_x_pos=joy_axis[jmap[PAD_LEFT]]; |
286 |
+ Sint16 joy_y_pos=joy_axis[jmap[PAD_UP]]; |
287 |
+ |
288 |
++ /* unnecessary if joy_?_min and joy_?_max are minimum and maximum |
289 |
++ * values of Sint16 |
290 |
+ if (joy_x_pos>joy_x_max) joy_x_max=joy_x_pos; |
291 |
+ if (joy_x_pos<joy_x_min) joy_x_min=joy_x_pos; |
292 |
+ if (joy_y_pos>joy_y_max) joy_y_max=joy_y_pos; |
293 |
+ if (joy_y_pos<joy_y_min) joy_y_min=joy_y_pos; |
294 |
++ */ |
295 |
+ |
296 |
++ /* this doesn't work when joy_x_min or joy_y_min < 0 (mid should be ~0), |
297 |
++ * because ((+max) - (-min)) / 2 = ((+max) + (+min)) / 2 |
298 |
+ Sint16 joy_x_mid=(joy_x_max-joy_x_min) / 2; |
299 |
+ Sint16 joy_y_mid=(joy_y_max-joy_y_min) / 2; |
300 |
++ */ |
301 |
++ Sint16 joy_x_mid=(joy_x_max+joy_x_min) >> 1; |
302 |
++ Sint16 joy_y_mid=(joy_y_max+joy_y_min) >> 1; |
303 |
++ /* this doesn't work as joy_x_mid or joy_y_mid approaches 0 |
304 |
+ Sint16 joy_x_qua=joy_x_mid / 2; |
305 |
+ Sint16 joy_y_qua=joy_y_mid / 2; |
306 |
++ */ |
307 |
++ /* (difference) / 100 = 1% of possible values */ |
308 |
++ Sint16 joy_x_qua=(joy_x_max - joy_x_min) / 100; |
309 |
++ Sint16 joy_y_qua=(joy_y_max - joy_y_min) / 100; |
310 |
+ |
311 |
+ if ((joy_x_pos<(joy_x_mid-joy_x_qua)) || (key[kmap[PAD_LEFT]])) gb_pad|=0x20; |
312 |
+ if ((joy_x_pos>(joy_x_mid+joy_x_qua)) || (key[kmap[PAD_RIGHT]])) gb_pad|=0x10; |
313 |
|
314 |
diff --git a/games-emulation/gngb/files/gngb-20060309-ovflfix.patch b/games-emulation/gngb/files/gngb-20060309-ovflfix.patch |
315 |
new file mode 100644 |
316 |
index 00000000000..0b638a1da9a |
317 |
--- /dev/null |
318 |
+++ b/games-emulation/gngb/files/gngb-20060309-ovflfix.patch |
319 |
@@ -0,0 +1,17 @@ |
320 |
+--- a/src/serial.c.old 2010-10-28 14:40:23.000000000 +0200 |
321 |
++++ b/src/serial.c 2010-10-28 14:41:07.000000000 +0200 |
322 |
+@@ -302,11 +302,11 @@ |
323 |
+ /* Gbserial_read: Read a byte on the serial |
324 |
+ This is a block function */ |
325 |
+ Uint8 gbserial_read(void) { |
326 |
+- Uint8 b; |
327 |
++ Uint8 b[2]; |
328 |
+ |
329 |
+ gbserial.ready2read=0; |
330 |
+- if ((read(dest_socket,&b,2))<=0) return 0xFF; |
331 |
+- return b; |
332 |
++ if ((read(dest_socket,b,2))<=0) return 0xFF; |
333 |
++ return b[0]; |
334 |
+ } |
335 |
+ |
336 |
+ /* Gbserial_write: Write a byte on the serial |
337 |
|
338 |
diff --git a/games-emulation/gngb/files/gngb-20060309-qwerty.patch b/games-emulation/gngb/files/gngb-20060309-qwerty.patch |
339 |
new file mode 100644 |
340 |
index 00000000000..29f563b749e |
341 |
--- /dev/null |
342 |
+++ b/games-emulation/gngb/files/gngb-20060309-qwerty.patch |
343 |
@@ -0,0 +1,24 @@ |
344 |
+From: Markus Koschany <apo@××××××.org> |
345 |
+Date: Thu, 17 Aug 2017 00:15:26 +0200 |
346 |
+Subject: sample_gngbrc |
347 |
+ |
348 |
+Bug-Debian: https://bugs.debian.org/597910 |
349 |
+Forwarded: no |
350 |
+--- |
351 |
+ sample_gngbrc | 3 +++ |
352 |
+ 1 file changed, 3 insertions(+) |
353 |
+ |
354 |
+diff --git a/sample_gngbrc b/sample_gngbrc |
355 |
+index a76b465..d0fdd3f 100644 |
356 |
+--- a/sample_gngbrc |
357 |
++++ b/sample_gngbrc |
358 |
+@@ -65,6 +65,9 @@ map_joy 1,1,0,0,3,2,0,1 |
359 |
+ |
360 |
+ map_key 273,274,276,275,120,119,13,303 |
361 |
+ |
362 |
++# Key configuration qwerty example |
363 |
++# map_key 273,274,276,275,122,120,13,303 |
364 |
++ |
365 |
+ |
366 |
+ # Normal GB palette (bright to dark) |
367 |
+ pal_1 0xB8A68D,0x917D5E,0x635030,0x211A10 |
368 |
|
369 |
diff --git a/games-emulation/gngb/gngb-20060309-r1.ebuild b/games-emulation/gngb/gngb-20060309-r1.ebuild |
370 |
new file mode 100644 |
371 |
index 00000000000..ebe0e3fb3b3 |
372 |
--- /dev/null |
373 |
+++ b/games-emulation/gngb/gngb-20060309-r1.ebuild |
374 |
@@ -0,0 +1,44 @@ |
375 |
+# Copyright 1999-2018 Gentoo Foundation |
376 |
+# Distributed under the terms of the GNU General Public License v2 |
377 |
+ |
378 |
+EAPI=6 |
379 |
+inherit autotools |
380 |
+ |
381 |
+DESCRIPTION="Gameboy / Gameboy Color emulator" |
382 |
+HOMEPAGE="http://m.peponas.free.fr/gngb/" |
383 |
+SRC_URI="http://m.peponas.free.fr/gngb/download/${P}.tar.gz" |
384 |
+ |
385 |
+LICENSE="GPL-2" |
386 |
+SLOT="0" |
387 |
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos" |
388 |
+IUSE="opengl" |
389 |
+ |
390 |
+RDEPEND=" |
391 |
+ media-libs/libsdl[sound,joystick,video] |
392 |
+ sys-libs/zlib |
393 |
+ app-arch/bzip2 |
394 |
+ opengl? ( virtual/opengl ) |
395 |
+" |
396 |
+DEPEND="${RDEPEND}" |
397 |
+ |
398 |
+PATCHES=( |
399 |
+ # From Debian |
400 |
+ "${FILESDIR}"/${P}-amd64.patch |
401 |
+ "${FILESDIR}"/${P}-gcc34.patch |
402 |
+ "${FILESDIR}"/${P}-gcc5.patch |
403 |
+ "${FILESDIR}"/${P}-gcc7.patch |
404 |
+ "${FILESDIR}"/${P}-inline.patch |
405 |
+ "${FILESDIR}"/${P}-joystick.patch |
406 |
+ "${FILESDIR}"/${P}-qwerty.patch |
407 |
+) |
408 |
+ |
409 |
+src_prepare() { |
410 |
+ default |
411 |
+ sed -i -e '70i#define OF(x) x' src/unzip.h || die |
412 |
+ mv configure.in configure.ac || die |
413 |
+ eautoreconf |
414 |
+} |
415 |
+ |
416 |
+src_configure() { |
417 |
+ econf $(use_enable opengl gl) |
418 |
+} |