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/pcsx2/
Date: Fri, 23 Sep 2022 00:27:51
Message-Id: 1663892836.93f2338a21aac12956e09a794d976b4cb5c32a4c.ionen@gentoo
1 commit: 93f2338a21aac12956e09a794d976b4cb5c32a4c
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 22 22:58:57 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 23 00:27:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93f2338a
7
8 games-emulation/pcsx2: sync live
9
10 See pcsx2-1.7.3329's commit for some details on changes.
11
12 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
13
14 games-emulation/pcsx2/pcsx2-9999.ebuild | 202 +++++++++++++++++++++++---------
15 1 file changed, 146 insertions(+), 56 deletions(-)
16
17 diff --git a/games-emulation/pcsx2/pcsx2-9999.ebuild b/games-emulation/pcsx2/pcsx2-9999.ebuild
18 index 00afde986d44..e4673dc1422c 100644
19 --- a/games-emulation/pcsx2/pcsx2-9999.ebuild
20 +++ b/games-emulation/pcsx2/pcsx2-9999.ebuild
21 @@ -1,108 +1,198 @@
22 # Copyright 1999-2022 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24
25 -EAPI=7
26 +EAPI=8
27
28 WX_GTK_VER="3.0-gtk3"
29 -inherit cmake fcaps git-r3 toolchain-funcs wxwidgets
30 +inherit cmake fcaps flag-o-matic wxwidgets
31
32 -DESCRIPTION="A PlayStation 2 emulator"
33 +if [[ ${PV} == 9999 ]]; then
34 + inherit git-r3
35 + EGIT_REPO_URI="https://github.com/PCSX2/pcsx2.git"
36 +else
37 + HASH_GLSLANG=c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5
38 + HASH_VULKAN=9f4c61a31435a7a90a314fc68aeb386c92a09c0f
39 + SRC_URI="
40 + https://github.com/PCSX2/pcsx2/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
41 + vulkan? (
42 + https://github.com/KhronosGroup/glslang/archive/${HASH_GLSLANG}.tar.gz -> ${PN}-glslang-${HASH_GLSLANG::10}.tar.gz
43 + https://github.com/KhronosGroup/Vulkan-Headers/archive/${HASH_VULKAN}.tar.gz -> ${PN}-vulkan-headers-${HASH_VULKAN::10}.tar.gz
44 + )"
45 + KEYWORDS="-* ~amd64"
46 +fi
47 +
48 +DESCRIPTION="PlayStation 2 emulator"
49 HOMEPAGE="https://pcsx2.net/"
50 -EGIT_REPO_URI="https://github.com/PCSX2/${PN}.git"
51 -EGIT_SUBMODULES=(
52 - 3rdparty/glslang/glslang # needs StandAlone/ResourceLimits.h
53 - 3rdparty/imgui/imgui # not made to be system-wide
54 - 3rdparty/vulkan-headers # to keep in sync with glslang
55 -)
56
57 -LICENSE="GPL-3 Apache-2.0 OFL-1.1" # TODO: needs review for a full list
58 +LICENSE="
59 + GPL-3+ Apache-2.0 BSD BSD-2 BSD-4 Boost-1.0 GPL-2+ LGPL-2.1+
60 + LGPL-3+ MIT OFL-1.1 ZLIB public-domain"
61 SLOT="0"
62 -KEYWORDS=""
63 -IUSE="pulseaudio test"
64 -
65 +IUSE="cpu_flags_x86_sse4_1 pulseaudio qt6 test vulkan wayland"
66 +REQUIRED_USE="cpu_flags_x86_sse4_1" # dies at runtime if no support
67 RESTRICT="!test? ( test )"
68
69 RDEPEND="
70 app-arch/xz-utils
71 app-arch/zstd:=
72 dev-cpp/rapidyaml:=
73 - dev-libs/glib:2
74 dev-libs/libaio
75 dev-libs/libchdr
76 >=dev-libs/libfmt-7.1.3:=
77 - dev-libs/libxml2:2
78 dev-libs/libzip:=[zstd]
79 - media-libs/alsa-lib
80 media-libs/cubeb
81 - media-libs/freetype
82 + media-libs/harfbuzz
83 media-libs/libglvnd
84 media-libs/libpng:=
85 media-libs/libsamplerate
86 - media-libs/libsdl2[haptic,joystick,sound]
87 + >=media-libs/libsdl2-2.0.22[haptic,joystick]
88 media-libs/libsoundtouch:=
89 net-libs/libpcap
90 - sys-libs/zlib
91 + sys-libs/zlib:=
92 virtual/libudev:=
93 - x11-libs/gdk-pixbuf:2
94 - x11-libs/gtk+:3
95 - x11-libs/libICE
96 x11-libs/libX11
97 - x11-libs/libXext
98 x11-libs/libXrandr
99 - x11-libs/wxGTK:${WX_GTK_VER}[X]
100 - pulseaudio? ( media-sound/pulseaudio )
101 -"
102 + qt6? (
103 + dev-qt/qtbase:6[gui,network,widgets]
104 + net-misc/curl
105 + )
106 + !qt6? (
107 + dev-libs/glib:2
108 + x11-libs/gdk-pixbuf:2
109 + x11-libs/gtk+:3[wayland?]
110 + x11-libs/wxGTK:${WX_GTK_VER}[X]
111 + pulseaudio? ( media-libs/libpulse )
112 + )
113 + vulkan? ( media-libs/vulkan-loader )
114 + wayland? ( dev-libs/wayland )"
115 DEPEND="
116 ${RDEPEND}
117 - x11-base/xorg-proto"
118 -BDEPEND="test? ( dev-cpp/gtest )"
119 + x11-base/xorg-proto
120 + test? ( dev-cpp/gtest )"
121 +BDEPEND="
122 + dev-lang/perl
123 + qt6? ( dev-qt/qttools[linguist] )
124 + !qt6? ( sys-devel/gettext )"
125
126 FILECAPS=(
127 - -m 755 "CAP_NET_RAW+eip CAP_NET_ADMIN+eip" usr/bin/pcsx2
128 + -m 0755 "CAP_NET_RAW+eip CAP_NET_ADMIN+eip" usr/bin/pcsx2
129 )
130
131 PATCHES=(
132 "${FILESDIR}"/${PN}-1.7.0-crcs.patch
133 + "${FILESDIR}"/${PN}-1.7.3329-clang16.patch
134 + "${FILESDIR}"/${PN}-1.7.3329-lto.patch
135 + "${FILESDIR}"/${PN}-1.7.3329-musl.patch
136 + "${FILESDIR}"/${PN}-1.7.3329-qt6.patch
137 + "${FILESDIR}"/${PN}-1.7.3329-unbundle.patch
138 + "${FILESDIR}"/${PN}-1.7.3329-wx-vs-sdl.patch
139 )
140
141 +src_unpack() {
142 + if [[ ${PV} == 9999 ]]; then
143 + local EGIT_SUBMODULES=()
144 + if use vulkan; then
145 + EGIT_SUBMODULES+=(
146 + 3rdparty/glslang/glslang # needs StandAlone/ResourceLimits.h
147 + 3rdparty/vulkan-headers # to keep in sync with glslang
148 + )
149 + fi
150 + git-r3_src_unpack
151 + else
152 + default
153 + if use vulkan; then
154 + rmdir "${S}"/3rdparty/{glslang/glslang,vulkan-headers} || die
155 + mv glslang-${HASH_GLSLANG} "${S}"/3rdparty/glslang/glslang || die
156 + mv Vulkan-Headers-${HASH_VULKAN} "${S}"/3rdparty/vulkan-headers || die
157 + fi
158 + fi
159 +}
160 +
161 src_prepare() {
162 cmake_src_prepare
163
164 - # unbundle, use sed over patch for less chances to break -9999
165 - # note: gentoo's zstd lacks a cmake module which upstream tries to use
166 - sed -e '/add_subdir.*cubeb/c\find_package(cubeb REQUIRED)' \
167 - -e '/add_subdir.*libchdr/c\pkg_check_modules(chdr REQUIRED IMPORTED_TARGET libchdr)\nalias_library(chdr-static PkgConfig::chdr)' \
168 - -e '/system_library.*zstd/,/endif()/c\pkg_check_modules(zstd REQUIRED IMPORTED_TARGET libzstd)\nalias_library(Zstd::Zstd PkgConfig::zstd)' \
169 - -e '/compile_options(\(cubeb\|chdr-static\|speex\)/d' \
170 - -i cmake/SearchForStuff.cmake || die
171 + # qt6 build doesn't support PACKAGE_MODE and need to set resources location
172 + sed -e "/EmuFolders::AppRoot =/s|=.*|= \"${EPREFIX}/usr/share/PCSX2\";|" \
173 + -i pcsx2/Frontend/CommonHost.cpp || die
174 +
175 + # pulseaudio is only used for usb-mic and without qt6, not for audio output
176 + { use pulseaudio && use !qt6; } || :> cmake/FindPulseAudio.cmake || die
177
178 - # pulseaudio is only used for usb-mic, not audio output
179 - use pulseaudio || > cmake/FindPulseAudio.cmake || die
180 + # GS tests currently fail to build with qt6
181 + use !qt6 || sed -i '/add_subdirectory(GS)/d' tests/ctest/CMakeLists.txt || die
182 +
183 + # delete all 3rdparty/* except known-used ones in non-live
184 + if [[ ${PV} != 9999 ]]; then
185 + local keep=(
186 + cpuinfo glad imgui include jpgd lzma simpleini xbyak
187 + $(usev vulkan 'glslang vulkan-headers')
188 + )
189 + find 3rdparty -mindepth 1 -maxdepth 1 -type d \
190 + -not \( -false ${keep[*]/#/-o -name } \) -exec rm -r {} + || die
191 + fi
192 }
193
194 src_configure() {
195 - # Build with ld.gold fails
196 - # https://github.com/PCSX2/pcsx2/issues/1671
197 - tc-ld-disable-gold
198 + use qt6 || setup-wxwidgets
199 +
200 + # for bundled glslang (bug #858374)
201 + use vulkan && append-flags -fno-strict-aliasing
202
203 - # pcsx2 build scripts will force CMAKE_BUILD_TYPE=Devel
204 - # if it something other than "Devel|Debug|Release"
205 - local CMAKE_BUILD_TYPE="Release"
206 local mycmakeargs=(
207 - -DBUILD_SHARED_LIBS=FALSE
208 - -DDISABLE_ADVANCE_SIMD=TRUE
209 - -DDISABLE_BUILD_DATE=TRUE
210 - -DDISABLE_PCSX2_WRAPPER=TRUE
211 - -DDISABLE_SETCAP=TRUE
212 + -DBUILD_SHARED_LIBS=no
213 + -DDISABLE_BUILD_DATE=yes
214 + -DDISABLE_PCSX2_WRAPPER=yes
215 + -DDISABLE_SETCAP=yes
216 -DENABLE_TESTS=$(usex test)
217 - -DPACKAGE_MODE=TRUE
218 - -DQT_BUILD=FALSE # TODO when qt6 is in tree
219 - -DSDL2_API=TRUE # conditionally needed if wxGTK[sdl], cmake/ApiValidation.cmake
220 - -DUSE_SYSTEM_LIBS=TRUE
221 - -DUSE_VTUNE=FALSE
222 - -DXDG_STD=TRUE
223 + -DPACKAGE_MODE=yes
224 + -DQT_BUILD=$(usex qt6)
225 + -DUSE_SYSTEM_LIBS=yes
226 + -DUSE_VTUNE=no
227 + -DUSE_VULKAN=$(usex vulkan)
228 + -DWAYLAND_API=$(usex wayland)
229 + -DXDG_STD=yes
230 +
231 + # sse4.1 is the bare minimum required, -m is required at build time
232 + # (see PCSX2Base.h) and it dies if no support at runtime (AppInit.cpp)
233 + # https://github.com/PCSX2/pcsx2/pull/4329
234 + -DARCH_FLAG=-msse4.1
235 )
236
237 - setup-wxwidgets
238 cmake_src_configure
239 }
240 +
241 +src_test() {
242 + cmake_build unittests
243 +}
244 +
245 +src_install() {
246 + cmake_src_install
247 +
248 + use qt6 && newbin "${BUILD_DIR}"/pcsx2-qt/pcsx2-qt pcsx2
249 +}
250 +
251 +pkg_postinst() {
252 + fcaps_pkg_postinst
253 +
254 + local replacing_old
255 + if [[ ${REPLACING_VERSIONS##* } ]] &&
256 + ver_test ${REPLACING_VERSIONS##* } -lt 1.6.1
257 + then
258 + replacing_old=
259 + elog ">=${PN}-1.7 has received several changes since <=${PN}-1.6.0, just-in-case"
260 + elog "it is recommended to backup your save states and memory cards before use."
261 + elog "Note that the executable was also renamed from 'PCSX2' to 'pcsx2'."
262 + fi
263 +
264 + if [[ ${PV} != 9999 && ( ! ${REPLACING_VERSIONS} || -v replacing_old ) ]]; then
265 + [[ -v replacing_old ]] && elog
266 + elog "${PN}-1.7.x is a development branch using a nightly release model"
267 + elog "(new 'release' every 1-2 days). Stable 1.6.0 is getting old and lacks"
268 + elog "many notable features (e.g. native 64bit builds). Given it may be a long"
269 + elog "time before there is a new stable, Gentoo will carry and update 1.7.x"
270 + elog "roughly every months."
271 + elog
272 + elog "Please report an issue if feel a picked nightly release needs to be"
273 + elog "updated ahead of time or masked (notably for handling regressions)."
274 + fi
275 +}