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/snes9x/files/, games-emulation/snes9x/
Date: Sat, 05 Mar 2022 07:00:14
Message-Id: 1646463427.068201997e59cd47afce4fda21b12cd0841532ed.ionen@gentoo
1 commit: 068201997e59cd47afce4fda21b12cd0841532ed
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 5 06:30:23 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 5 06:57:07 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06820199
7
8 games-emulation/snes9x: add 1.61
9
10 Various changes, but for some notable ones:
11 - IUSE=gtk->gui, now uses gtkmm
12 - RESTRICT=test, has no tests but fails if -gui/-gtk (bug #737044)
13 - clean libretro objects to fix USE="netplay libretro" (bug #791475)
14 - respect flags for libretro, also don't use CXXFLAGS for CFLAGS
15 - install libretro core in libretro/ like libretro-snes9x
16 - tentatively remove noexecstack, not seeing QA notices
17 - remove html docs, they are not relevant for users
18
19 This bundles glslang/spriv-cross but upstream is concerned about API
20 and seems likely this will break if unbundled, leaving alone for now.
21
22 bug #766782 was caused by CFLAGS = $(CXXFLAGS) without := leading
23 to -fno-rtti being used for CC and seemingly being refusedby distcc.
24 1.61 corrected this.
25
26 Closes: https://bugs.gentoo.org/737044
27 Closes: https://bugs.gentoo.org/766782
28 Closes: https://bugs.gentoo.org/791475
29 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
30
31 games-emulation/snes9x/Manifest | 3 +
32 .../snes9x/files/snes9x-1.61-libretro-flags.patch | 25 ++++
33 games-emulation/snes9x/metadata.xml | 3 +-
34 games-emulation/snes9x/snes9x-1.61.ebuild | 152 +++++++++++++++++++++
35 4 files changed, 182 insertions(+), 1 deletion(-)
36
37 diff --git a/games-emulation/snes9x/Manifest b/games-emulation/snes9x/Manifest
38 index c477123ee770..67367eddc376 100644
39 --- a/games-emulation/snes9x/Manifest
40 +++ b/games-emulation/snes9x/Manifest
41 @@ -1 +1,4 @@
42 DIST snes9x-1.60.tar.gz 2863228 BLAKE2B 0ac3bdd2403221f1013e2b5438aacc4e7d361e943ac7edc56f8ef22827d81484e0b162b84f739ce0f68fe58021124275fd908ccdde99e1e1d6d6c9c0a6e3d17b SHA512 840b006a8fbd479fd5ceb2d94af4ef6470c5e27a3e6c8ddb0dffc8d3e51f465669144cd428bfce28b2ed4f68e70d8f252f2d8a2cae602ba797791d7e483c14c9
43 +DIST snes9x-1.61-glslang.tar.gz 3188787 BLAKE2B 36ed327fbb2aec3657fe300b98f2e45cfe039596a64bca3076ecb079f7c33aa14ac09a96e5a174ad51faf0c4d585d82aaadec3d8209cf8d3ca55d70e316b1642 SHA512 de2ebc0cd89d22582c079006ac45a812e3aaaad9a44c77c68530aa1468fbc840c6ae25a4356d4e9fc697524cd721d26506d85bc35eac98452eabce0bc098b5a4
44 +DIST snes9x-1.61-spirv.tar.gz 676662 BLAKE2B ab18406c99e4e04c6c497b5f447dcaccb7d5a60f42bf1cea31afee04ee664e74916b32736c1aea1e7106494154e48e5cbe9b5d6a0652667c4d0e2020814cd9bd SHA512 bfa3cc944450db59a57a685eea12b0ed0b5059d55a092ac5cdf6f4dc03c1e2d2e62fa5a576156c772340e12136b10d7ed790bb35b4aece2ee8405e64f826e31b
45 +DIST snes9x-1.61.tar.gz 3016890 BLAKE2B 3e94dee5172bf48d2461a3a1403fc7e7fc8069df6dddf5b5e1da59ee140297bd0b7cee6948b5eb154c1eec38aebe3ab29a9fae3dfb4abdce41769d2ace43dee1 SHA512 8b644f5b7136e89fd222bcb430fc736c74a3e383d7e6c7f0880235f6fa4c0f77abbf02493f8d654a12e87701111643e33877bc21bb3dfcc9b82a056fa1b1d880
46
47 diff --git a/games-emulation/snes9x/files/snes9x-1.61-libretro-flags.patch b/games-emulation/snes9x/files/snes9x-1.61-libretro-flags.patch
48 new file mode 100644
49 index 000000000000..297c7d78257d
50 --- /dev/null
51 +++ b/games-emulation/snes9x/files/snes9x-1.61-libretro-flags.patch
52 @@ -0,0 +1,25 @@
53 +CXXFLAGS is used as a "common" flags variable and passed to CFLAGS,
54 +but want to use user's CFLAGS for CC rather than CXXFLAGS. Workaround
55 +with a temporary variable and also drop -O3/lto from defaults.
56 +--- a/libretro/Makefile
57 ++++ b/libretro/Makefile
58 +@@ -4,3 +4,5 @@
59 +
60 +-LTO ?= -flto
61 ++LTO :=
62 ++ORIG_CXXFLAGS := $(CXXFLAGS)
63 ++CXXFLAGS :=
64 + SPACE :=
65 +@@ -580,4 +582,4 @@
66 + else
67 +- CFLAGS += -O3 -DNDEBUG
68 +- CXXFLAGS += -O3 -DNDEBUG
69 ++ CFLAGS += -DNDEBUG
70 ++ CXXFLAGS += -DNDEBUG
71 + endif
72 +@@ -612,3 +614,4 @@
73 + CXXFLAGS += -DRIGHTSHIFT_IS_SAR -D__LIBRETRO__ -DALLOW_CPU_OVERCLOCK
74 +-CFLAGS := $(CXXFLAGS)
75 ++CFLAGS := $(CXXFLAGS) $(CFLAGS)
76 ++CXXFLAGS += $(ORIG_CXXFLAGS)
77 + CFLAGS += -DHAVE_STDINT_H
78
79 diff --git a/games-emulation/snes9x/metadata.xml b/games-emulation/snes9x/metadata.xml
80 index 2d24d25eb987..8f63c2fe45fa 100644
81 --- a/games-emulation/snes9x/metadata.xml
82 +++ b/games-emulation/snes9x/metadata.xml
83 @@ -6,8 +6,9 @@
84 <name>Gentoo Games Project</name>
85 </maintainer>
86 <use>
87 - <flag name="netplay">Enable playing ROMs over the network (not recommended)</flag>
88 + <flag name="glslang">Build support for slang-type shaders</flag>
89 <flag name="libretro">Build libretro port</flag>
90 + <flag name="netplay">Enable playing ROMs over the network (not recommended)</flag>
91 </use>
92 <upstream>
93 <remote-id type="google-code">snes9x-gtk</remote-id>
94
95 diff --git a/games-emulation/snes9x/snes9x-1.61.ebuild b/games-emulation/snes9x/snes9x-1.61.ebuild
96 new file mode 100644
97 index 000000000000..0442b30335df
98 --- /dev/null
99 +++ b/games-emulation/snes9x/snes9x-1.61.ebuild
100 @@ -0,0 +1,152 @@
101 +# Copyright 1999-2022 Gentoo Authors
102 +# Distributed under the terms of the GNU General Public License v2
103 +
104 +EAPI=8
105 +
106 +inherit autotools meson toolchain-funcs xdg
107 +
108 +GLSLANG_COMMIT="bcf6a2430e99e8fc24f9f266e99316905e6d5134"
109 +SPIRV_COMMIT="1458bae62ec67ea7d12c5a13b740e23ed4bb226c"
110 +
111 +DESCRIPTION="Super Nintendo Entertainment System (SNES) emulator"
112 +HOMEPAGE="https://github.com/snes9xgit/snes9x/"
113 +SRC_URI="
114 + https://github.com/snes9xgit/snes9x/archive/${PV}.tar.gz -> ${P}.tar.gz
115 + gui? ( glslang? (
116 + https://github.com/KhronosGroup/glslang/archive/${GLSLANG_COMMIT}.tar.gz -> ${P}-glslang.tar.gz
117 + https://github.com/KhronosGroup/SPIRV-Cross/archive/${SPIRV_COMMIT}.tar.gz -> ${P}-spirv.tar.gz
118 + ) )"
119 +
120 +LICENSE="
121 + Snes9x GPL-2 GPL-2+ LGPL-2.1 LGPL-2.1+ ISC MIT ZLIB
122 + gui? ( glslang? ( Apache-2.0 BSD ) )"
123 +SLOT="0"
124 +KEYWORDS="~amd64 ~ppc64 ~x86"
125 +IUSE="alsa debug glslang gui libretro netplay opengl oss png portaudio pulseaudio wayland xinerama +xv"
126 +RESTRICT="bindist test" # has no tests but can lead to bug #737044
127 +
128 +RDEPEND="
129 + sys-libs/zlib:=[minizip]
130 + x11-libs/libX11
131 + x11-libs/libXext
132 + alsa? ( media-libs/alsa-lib )
133 + gui? (
134 + dev-cpp/cairomm:0
135 + dev-cpp/glibmm:2
136 + dev-cpp/gtkmm:3.0[wayland?]
137 + dev-libs/glib:2
138 + dev-libs/libsigc++:2
139 + media-libs/libsdl2[joystick]
140 + x11-libs/cairo
141 + x11-libs/gdk-pixbuf:2
142 + x11-libs/gtk+:3[wayland?]
143 + x11-libs/libXrandr
144 + x11-misc/xdg-utils
145 + opengl? ( media-libs/libepoxy )
146 + portaudio? ( media-libs/portaudio )
147 + pulseaudio? ( media-sound/pulseaudio )
148 + wayland? ( dev-libs/wayland )
149 + )
150 + libretro? ( !games-emulation/libretro-snes9x )
151 + png? ( media-libs/libpng:= )
152 + xinerama? ( x11-libs/libXinerama )
153 + xv? ( x11-libs/libXv )"
154 +DEPEND="
155 + ${RDEPEND}
156 + x11-base/xorg-proto
157 + opengl? ( media-libs/libglvnd )"
158 +BDEPEND="virtual/pkgconfig"
159 +
160 +PATCHES=(
161 + "${FILESDIR}"/${PN}-1.53-cross-compile.patch
162 + "${FILESDIR}"/${PN}-1.59-build-system.patch
163 + "${FILESDIR}"/${PN}-1.61-libretro-flags.patch
164 +)
165 +
166 +src_prepare() {
167 + if use gui && use glslang; then
168 + rmdir shaders/{glslang,SPIRV-Cross} || die
169 + mv ../glslang-${GLSLANG_COMMIT} shaders/glslang || die
170 + mv ../SPIRV-Cross-${SPIRV_COMMIT} shaders/SPIRV-Cross || die
171 + fi
172 +
173 + default
174 +
175 + rm -r unzip || die
176 +
177 + cd unix || die
178 + eautoreconf
179 +}
180 +
181 +src_configure() {
182 + tc-export CC CXX # for libretro
183 +
184 + local econfargs=(
185 + $(use_enable alsa sound-alsa)
186 + $(use_enable debug debugger)
187 + $(use_enable netplay)
188 + $(use_enable png screenshot)
189 + $(use_enable xinerama)
190 + $(use_enable xv xvideo)
191 + --enable-gamepad
192 + --enable-gzip
193 + --enable-zip
194 + --with-system-zip
195 + )
196 +
197 + cd unix || die
198 + econf "${econfargs[@]}"
199 +
200 + if use gui; then
201 + local emesonargs=(
202 + $(meson_use alsa)
203 + $(meson_use debug debugger)
204 + $(meson_use glslang slang) # TODO?: unbundle
205 + $(meson_use opengl)
206 + $(meson_use oss)
207 + $(meson_use png screenshot)
208 + $(meson_use portaudio)
209 + $(meson_use pulseaudio)
210 + $(meson_use wayland)
211 + $(meson_use xv)
212 + -Dsystem-zip=true
213 + -Dzlib=true
214 + )
215 +
216 + EMESON_SOURCE=${S}/gtk
217 + meson_src_configure
218 + fi
219 +}
220 +
221 +src_compile() {
222 + if use libretro; then
223 + emake -C libretro
224 + # rebuild objects given libretro uses different defines (bug #791475)
225 + rm *.o || die
226 + fi
227 +
228 + emake -C unix
229 +
230 + use gui && meson_src_compile
231 +}
232 +
233 +src_install() {
234 + if use libretro; then
235 + exeinto /usr/$(get_libdir)/libretro
236 + doexe libretro/snes9x_libretro.so
237 + fi
238 +
239 + dobin unix/${PN}
240 +
241 + local DOCS=(
242 + README.md
243 + docs/{changes,control-inputs,controls,snapshots}.txt
244 + unix/snes9x.conf.default
245 + )
246 + einstalldocs
247 +
248 + if use gui; then
249 + meson_src_install
250 + dodoc gtk/AUTHORS
251 + fi
252 +}