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/higan/, games-emulation/higan/files/
Date: Mon, 03 Jan 2022 12:13:53
Message-Id: 1641211974.f3cb59332d973d7cabe4c3eb10da86cfedc49044.ionen@gentoo
1 commit: f3cb59332d973d7cabe4c3eb10da86cfedc49044
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 3 11:35:52 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 3 12:12:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3cb5933
7
8 games-emulation/higan: add 116_pre20210818, use system paths
9
10 Closes: https://bugs.gentoo.org/828108
11 Thanks-to: Nathan Zachary
12 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
13
14 games-emulation/higan/Manifest | 1 +
15 .../higan/files/higan-116_pre20210818-paths.patch | 44 ++++++++
16 games-emulation/higan/higan-116_pre20210818.ebuild | 122 +++++++++++++++++++++
17 3 files changed, 167 insertions(+)
18
19 diff --git a/games-emulation/higan/Manifest b/games-emulation/higan/Manifest
20 index b6fe03d83b0d..8c4d29547d09 100644
21 --- a/games-emulation/higan/Manifest
22 +++ b/games-emulation/higan/Manifest
23 @@ -1 +1,2 @@
24 DIST higan-116_pre20210404.tar.gz 9130899 BLAKE2B bb9830901d7014f9d442f3a3bd9bd82ad791d2ba62a3264cfc187e5d7498a5ec6eae1fff6509f5206d9a21294e2a3ef710fbed5fac3626ecc88c4156bd50f289 SHA512 8ee40d8b9867fe767d5321dc4df3e73039fa39b7ecad2eddb58c3114bcf42b1b2074396ae5c4783ca060057aeb4bca7110101cc44d9608fe7c4d5f561b3f40a5
25 +DIST higan-116_pre20210818.tar.gz 9131284 BLAKE2B 4d3a514b9b8ec46353066b7257814c42024bff86c462b7a121aad5b5d1969d21cd7a96097e7d9d89d35e7a7f66a14c11a35cd77be05e73eca96caa3990e1c9b5 SHA512 d218feab3a3a39cd58fd2a727320ac88a4f006aa987c26860463f577039a9124b93119ee162f7d120f3bb4c23974eec53c7a0850c6e5743a8fdc8e48d108125d
26
27 diff --git a/games-emulation/higan/files/higan-116_pre20210818-paths.patch b/games-emulation/higan/files/higan-116_pre20210818-paths.patch
28 new file mode 100644
29 index 000000000000..0652b164cfd9
30 --- /dev/null
31 +++ b/games-emulation/higan/files/higan-116_pre20210818-paths.patch
32 @@ -0,0 +1,44 @@
33 +Based on patch from Arch additionally using system's Shaders/
34 +
35 +Resulting paths:
36 +/usr/share/higan/{Database,Firmware,Shaders,Templates}
37 +~/higan/ -> ~/.local/share/higan/Systems
38 +
39 +Templates+Systems can be changed in ~/.config/higan/paths.bml and
40 +does not disrupt existing configurations. Shaders will use default
41 +~/.config/higan/Shaders over system's if it exists.
42 +
43 +https://bugs.gentoo.org/828108
44 +--- a/higan-ui/higan-ui.cpp
45 ++++ b/higan-ui/higan-ui.cpp
46 +@@ -44,9 +44,8 @@
47 + }
48 + if(!directory::exists(Path::templates)) {
49 +- Path::templates = {Path::userData(), "higan/"};
50 +- directory::create(Path::templates);
51 ++ Path::templates = {Path::sharedData(), "higan/Templates/"};
52 + }
53 + if(!directory::exists(Path::data)) {
54 +- Path::data = {Path::user(), "higan/"};
55 ++ Path::data = {Path::userData(), "higan/Systems/"};
56 + directory::create(Path::data);
57 + }
58 +--- a/higan-ui/menus/settings.cpp
59 ++++ b/higan-ui/menus/settings.cpp
60 +@@ -78,4 +78,6 @@
61 +
62 + string location{Path::settings, "Shaders/"};
63 ++ if(!directory::exists(location))
64 ++ location = string{Path::sharedData(), "higan/Shaders/"};
65 +
66 + if(settings.video.driver == "OpenGL 3.2") {
67 +--- a/icarus/icarus.cpp
68 ++++ b/icarus/icarus.cpp
69 +@@ -9,6 +9,5 @@
70 + if(inode::exists(location)) return location;
71 +
72 +- directory::create({Path::userData(), "icarus/"});
73 +- return {Path::userData(), "icarus/", name};
74 ++ return {Path::sharedData(), "higan/", name};
75 + }
76 +
77
78 diff --git a/games-emulation/higan/higan-116_pre20210818.ebuild b/games-emulation/higan/higan-116_pre20210818.ebuild
79 new file mode 100644
80 index 000000000000..e484fdff7aa0
81 --- /dev/null
82 +++ b/games-emulation/higan/higan-116_pre20210818.ebuild
83 @@ -0,0 +1,122 @@
84 +# Copyright 1999-2022 Gentoo Authors
85 +# Distributed under the terms of the GNU General Public License v2
86 +
87 +EAPI=8
88 +
89 +inherit desktop toolchain-funcs
90 +
91 +HIGAN_COMMIT="9bf1b3314b2bcc73cbc11d344b369c31562aff10"
92 +
93 +DESCRIPTION="Multi-system emulator focused on accuracy, preservation, and configurability"
94 +HOMEPAGE="https://github.com/higan-emu/higan"
95 +SRC_URI="https://github.com/higan-emu/higan/archive/${HIGAN_COMMIT}.tar.gz -> ${P}.tar.gz"
96 +S="${WORKDIR}/${PN}-${HIGAN_COMMIT}"
97 +
98 +LICENSE="GPL-3+ ISC"
99 +SLOT="0"
100 +KEYWORDS="~amd64 ~x86"
101 +IUSE="alsa ao +gtk openal +opengl oss +pulseaudio +sdl udev xv"
102 +
103 +RDEPEND="
104 + x11-libs/libX11
105 + x11-libs/libXext
106 + x11-libs/libXrandr
107 + alsa? ( media-libs/alsa-lib )
108 + ao? ( media-libs/libao )
109 + openal? ( media-libs/openal )
110 + opengl? ( virtual/opengl )
111 + pulseaudio? ( media-sound/pulseaudio )
112 + sdl? ( media-libs/libsdl2[joystick] )
113 + udev? ( virtual/libudev:= )
114 + xv? ( x11-libs/libXv )
115 + gtk? (
116 + dev-libs/glib:2
117 + x11-libs/cairo
118 + x11-libs/gdk-pixbuf:2
119 + x11-libs/gtk+:3
120 + x11-libs/gtksourceview:3.0=
121 + x11-libs/pango
122 + )
123 + !gtk? (
124 + dev-qt/qtcore:5
125 + dev-qt/qtgui:5
126 + dev-qt/qtwidgets:5
127 + )"
128 +DEPEND="
129 + ${RDEPEND}
130 + x11-base/xorg-proto"
131 +BDEPEND="virtual/pkgconfig"
132 +
133 +PATCHES=(
134 + # insane build system, reinvents every built-in rule
135 + "${FILESDIR}"/${PN}-116_pre20210404-makefile.patch
136 + "${FILESDIR}"/${PN}-116_pre20210818-paths.patch
137 +)
138 +
139 +src_prepare() {
140 + default
141 +
142 + use !prefix || sed -i "s|/usr/share|${EPREFIX}&|" nall/path.hpp || die
143 +}
144 +
145 +src_compile() {
146 + local makeopts=(
147 + platform=linux
148 + compiler="$(tc-getCXX)"
149 + hiro=$(usex gtk gtk3 qt5)
150 + )
151 +
152 + local drivers=(
153 + video.xshm
154 + input.xlib
155 + $(usev alsa audio.alsa)
156 + $(usev ao audio.ao)
157 + $(usev openal audio.openal)
158 + $(usev opengl "video.glx video.glx2")
159 + $(usev oss audio.oss)
160 + $(usev pulseaudio "audio.pulseaudio audio.pulseaudiosimple")
161 + $(usev sdl input.sdl)
162 + $(usev udev input.udev)
163 + $(usev xv video.xvideo)
164 + )
165 +
166 + local coreopts=(
167 + cores="cv fc gb gba md ms msx ngp pce sfc sg ws"
168 + ruby="${drivers[*]}"
169 + build=performance
170 + local=false
171 + )
172 +
173 + emake "${makeopts[@]}" "${coreopts[@]}" -C higan-ui
174 +
175 + emake "${makeopts[@]}" -C icarus
176 +}
177 +
178 +src_install() {
179 + dobin higan-ui/out/higan
180 + domenu higan-ui/resource/higan.desktop
181 + doicon higan-ui/resource/higan.png
182 +
183 + dobin icarus/out/icarus
184 + domenu icarus/resource/icarus.desktop
185 + doicon icarus/resource/icarus.svg
186 +
187 + insinto /usr/share/higan
188 + doins -r icarus/{Database,Firmware}
189 + use opengl && doins -r extras/Shaders
190 +
191 + insinto /usr/share/higan/Templates
192 + doins -r higan/System/.
193 +}
194 +
195 +pkg_postinst() {
196 + if [[ ${REPLACING_VERSIONS} ]] &&
197 + ver_test ${REPLACING_VERSIONS} -lt 116_pre20210818; then
198 + elog "On new installs, higan now uses ~/.local/share/higan/Systems/ rather than"
199 + elog "~/higan/, and reads Templates from ${EROOT}/usr/share/higan/ on Gentoo."
200 + elog "Will need to edit/delete ~/.config/higan/paths.bml for this to take effect."
201 + elog
202 + elog "Additionally, system's shaders will be used if ~/.config/higan/Shaders"
203 + elog "does not exist, and icarus now uses the system's Database+Firmware files."
204 + fi
205 +}