Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/fbzx/files/, games-emulation/fbzx/
Date: Tue, 01 Jun 2021 23:44:42
Message-Id: 1622590675.b1c9ee73ff01e5be604733e6a49679d3afb1cb1d.ionen@gentoo
1 commit: b1c9ee73ff01e5be604733e6a49679d3afb1cb1d
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 1 12:00:08 2021 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 1 23:37:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1c9ee73
7
8 games-emulation/fbzx: add 4.6.0, EAPI-7
9
10 - update homepage/src_uri
11 - libsdl -> libsdl2
12 - add missing [joystick] (bug #733446)
13 - add prefix to runtime datadir
14 - use provided .desktop file
15 - rebased makefile patch with method to select alsa/pulseaudio
16 rather than always require both (sources have defines already)
17
18 gcc11 bug #789597 fixed upstream since v4.1.0 ('byte/word' removed)
19
20 Closes: https://bugs.gentoo.org/733446
21 Closes: https://bugs.gentoo.org/789597
22 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
23
24 games-emulation/fbzx/Manifest | 1 +
25 games-emulation/fbzx/fbzx-4.6.0.ebuild | 53 +++++++++++++++++++
26 .../fbzx/files/fbzx-4.6.0-joystick-invert.patch | 32 ++++++++++++
27 .../fbzx/files/fbzx-4.6.0-makefile.patch | 60 ++++++++++++++++++++++
28 4 files changed, 146 insertions(+)
29
30 diff --git a/games-emulation/fbzx/Manifest b/games-emulation/fbzx/Manifest
31 index 69f2780553a..fafb07a16f9 100644
32 --- a/games-emulation/fbzx/Manifest
33 +++ b/games-emulation/fbzx/Manifest
34 @@ -1 +1,2 @@
35 DIST fbzx-3.0.0.tar.gz 435239 BLAKE2B 5105995a7972c7310628c0e4d3af7f1a749192bc24ac312e493d8821edf5ec329a65eedcbfa6c8479a4f4d134ca730acef7ee27ef2f89253f2e179c7cf8c2bf1 SHA512 cf2a01a1dde62da03c1f04e91f226859ae4cf06d099597dc1a1554c4ff9782dd287f9d924083829eee40cf0450c053d818f963f68381f9e16e0e61ca1f3d3083
36 +DIST fbzx_4.6.0.tar.bz2 307308 BLAKE2B 0cf6e9bf3e01c5a03e0925707aab46829ed8e3f0e4c0791d362ab8972d5d0175e35635e5ad6f895db369b4cb543efc40561fa41ec1cfd739c7252762250bdb7e SHA512 4644038c615e2487361e8a7a72d69ae2e136945160d4cc8ed982365243a7e016edff6165ae86a3f50e3f0f4d45540bfd933353ca17596f9d8e10153c492f15d9
37
38 diff --git a/games-emulation/fbzx/fbzx-4.6.0.ebuild b/games-emulation/fbzx/fbzx-4.6.0.ebuild
39 new file mode 100644
40 index 00000000000..6b5e1d62f6b
41 --- /dev/null
42 +++ b/games-emulation/fbzx/fbzx-4.6.0.ebuild
43 @@ -0,0 +1,53 @@
44 +# Copyright 1999-2021 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=7
48 +
49 +inherit desktop toolchain-funcs
50 +
51 +DESCRIPTION="Full Screen Sinclair Spectrum emulator"
52 +HOMEPAGE="http://www.rastersoft.com/programas/fbzx.html"
53 +SRC_URI="http://www.rastersoft.com/descargas/fbzx/${PN}_${PV}.tar.bz2"
54 +S="${WORKDIR}/${PN}_${PV}"
55 +
56 +LICENSE="GPL-3+"
57 +SLOT="0"
58 +KEYWORDS="~amd64 ~x86"
59 +IUSE="alsa pulseaudio"
60 +
61 +RDEPEND="
62 + media-libs/libsdl2[joystick,video]
63 + alsa? ( media-libs/alsa-lib )
64 + pulseaudio? ( media-sound/pulseaudio )"
65 +DEPEND="${RDEPEND}"
66 +BDEPEND="virtual/pkgconfig"
67 +
68 +PATCHES=(
69 + "${FILESDIR}"/${P}-joystick-invert.patch
70 + "${FILESDIR}"/${P}-makefile.patch
71 +)
72 +
73 +src_prepare() {
74 + default
75 +
76 + sed -i "s|/usr/share|${EPREFIX}/usr/share/${PN}|" src/llscreen.cpp || die
77 +}
78 +
79 +src_compile() {
80 + tc-export CXX PKG_CONFIG
81 +
82 + emake ALSA=$(usex alsa) PULSE=$(usex pulseaudio)
83 +}
84 +
85 +src_install() {
86 + dobin src/${PN}
87 + dodoc AMSTRAD CAPABILITIES FAQ HISTORY.md README.{TZX,md} TODO
88 + doicon data/${PN}.svg
89 + domenu data/${PN}.desktop
90 +
91 + insinto /usr/share/${PN}
92 + doins -r data/spectrum-roms
93 +
94 + insinto /usr/share/${PN}/${PN}
95 + doins data/keymap.bmp
96 +}
97
98 diff --git a/games-emulation/fbzx/files/fbzx-4.6.0-joystick-invert.patch b/games-emulation/fbzx/files/fbzx-4.6.0-joystick-invert.patch
99 new file mode 100644
100 index 00000000000..c596a1efd65
101 --- /dev/null
102 +++ b/games-emulation/fbzx/files/fbzx-4.6.0-joystick-invert.patch
103 @@ -0,0 +1,32 @@
104 +Fixed in 4.7.0 but, while marked as released for some time,
105 +it hasn't been tagged nor given a tarball (yet), so backport
106 +fix to this troublesome issue for now.
107 +
108 +https://gitlab.com/rastersoft/fbzx/-/commit/7bd47e2
109 +From: Sergio Costas <raster@××××××××××.com>
110 +Date: Sat, 17 Apr 2021 14:15:32 +0200
111 +Subject: [PATCH] Fixed the SINCLAIR joystick emulation
112 +
113 +The horizontal movements were inverted.
114 +--- a/src/keyboard.cpp
115 ++++ b/src/keyboard.cpp
116 +@@ -386,3 +386,3 @@
117 + case 2: // sinclair 1
118 +- temporal_io = SDLK_1;
119 ++ temporal_io = SDLK_2;
120 + break;
121 +@@ -390,3 +390,3 @@
122 + case 3: // sinclair 2
123 +- temporal_io = SDLK_6;
124 ++ temporal_io = SDLK_7;
125 + break;
126 +@@ -406,3 +406,3 @@
127 + case 2: // sinclair 1
128 +- temporal_io = SDLK_2;
129 ++ temporal_io = SDLK_1;
130 + break;
131 +@@ -410,3 +410,3 @@
132 + case 3: // sinclair 2
133 +- temporal_io = SDLK_7;
134 ++ temporal_io = SDLK_6;
135 + break;
136
137 diff --git a/games-emulation/fbzx/files/fbzx-4.6.0-makefile.patch b/games-emulation/fbzx/files/fbzx-4.6.0-makefile.patch
138 new file mode 100644
139 index 00000000000..b6936ecb39e
140 --- /dev/null
141 +++ b/games-emulation/fbzx/files/fbzx-4.6.0-makefile.patch
142 @@ -0,0 +1,60 @@
143 +Respect CXX, CXXFLAGS, CPPFLAGS, and PKG_CONFIG.
144 +Add way to choose audio backend (alsa, pulse, or neither).
145 +
146 +Alternatively, cmake migration has been proposed upstream:
147 +https://gitlab.com/rastersoft/fbzx/-/merge_requests/10
148 +--- a/src/Makefile
149 ++++ b/src/Makefile
150 +@@ -3,8 +3,14 @@
151 + CC=g++ -c $(FLAGS)
152 +-CXX=g++ -c $(FLAGS)
153 +-LN=g++
154 ++LN=$(CXX)
155 +
156 +-CFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA
157 +-CXXFLAGS += `pkg-config --cflags sdl2 libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA
158 +-LDFLAGS += `pkg-config --libs sdl2 libpulse-simple alsa`
159 ++CXXFLAGS:=-c $(CXXFLAGS) $(CPPFLAGS) $(shell $(PKG_CONFIG) --cflags sdl2)
160 ++LDFLAGS:=$(LDFLAGS) $(shell $(PKG_CONFIG) --libs sdl2)
161 ++ifeq ($(ALSA),yes)
162 ++ CXXFLAGS+=$(shell $(PKG_CONFIG) --cflags alsa) -DD_SOUND_ALSA
163 ++ LDFLAGS+=$(shell $(PKG_CONFIG) --libs alsa)
164 ++endif
165 ++ifeq ($(PULSE),yes)
166 ++ CXXFLAGS+=$(shell $(PKG_CONFIG) --cflags libpulse-simple) -DD_SOUND_PULSE
167 ++ LDFLAGS+=$(shell $(PKG_CONFIG) --libs libpulse-simple)
168 ++endif
169 +
170 +@@ -15,24 +21,24 @@
171 + Z80free.o: z80free/Z80free.c z80free/Z80free.h
172 +- $(CXX) -o Z80free.o z80free/Z80free.c
173 ++ $(CXX) $(CXXFLAGS) -o Z80free.o z80free/Z80free.c
174 +
175 + Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
176 +- $(CXX) -o Z80free_codes.o z80free/Z80free_codes.c
177 ++ $(CXX) $(CXXFLAGS) -o Z80free_codes.o z80free/Z80free_codes.c
178 +
179 + Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
180 +- $(CXX) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
181 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesCB.o z80free/Z80free_codesCB.c
182 +
183 + Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
184 +- $(CXX) -o Z80free_codesED.o z80free/Z80free_codesED.c
185 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesED.o z80free/Z80free_codesED.c
186 +
187 + Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
188 +- $(CXX) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
189 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesDD.o z80free/Z80free_codesDD.c
190 +
191 + Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
192 +- $(CXX) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
193 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesFD.o z80free/Z80free_codesFD.c
194 +
195 + Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
196 +- $(CXX) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
197 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
198 +
199 + Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
200 +- $(CXX) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
201 ++ $(CXX) $(CXXFLAGS) -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
202 +