public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ionen Wolkens" <ionen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/pcsx2/files/, games-emulation/pcsx2/
Date: Tue,  2 Jul 2024 05:17:30 +0000 (UTC)	[thread overview]
Message-ID: <1719897424.1109347a0b07161d08e96bf82608361d24a18a3f.ionen@gentoo> (raw)

commit:     1109347a0b07161d08e96bf82608361d24a18a3f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  2 04:48:07 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jul  2 05:17:04 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1109347a

games-emulation/pcsx2: fix build with musl

Originally thought would only need _GNU_SOURCE, but there is a bit
more to the fix 7zip upstream did in bug #928730. Could still patch
but can go for the easy solution which will use neither cpu_set_t
nor (more importantly) pthread_attr_setaffinity_np that musl lacks.

Also fix a different musl issue only affecting >=pcsx2-1.7.5913,
workaround imported from Chimera Linux.

Closes: https://bugs.gentoo.org/935298
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../pcsx2/files/pcsx2-1.7.5913-musl-cache.patch      | 20 ++++++++++++++++++++
 games-emulation/pcsx2/pcsx2-1.7.5835.ebuild          |  4 ++++
 games-emulation/pcsx2/pcsx2-1.7.5913.ebuild          |  5 +++++
 games-emulation/pcsx2/pcsx2-9999.ebuild              |  5 +++++
 4 files changed, 34 insertions(+)

diff --git a/games-emulation/pcsx2/files/pcsx2-1.7.5913-musl-cache.patch b/games-emulation/pcsx2/files/pcsx2-1.7.5913-musl-cache.patch
new file mode 100644
index 000000000000..3383904fee48
--- /dev/null
+++ b/games-emulation/pcsx2/files/pcsx2-1.7.5913-musl-cache.patch
@@ -0,0 +1,20 @@
+Patch adapted from [1]:
+
+	musl doesn't expose these sysconf values, so just use the loop
+	below that reads them out of sysfs coherency_line_size only
+
+[1] https://github.com/chimera-linux/cports/blob/114b576aee3ebc25b48ac120da1a1093dcc4365f/user/pcsx2/patches/cache.patch
+--- a/common/Linux/LnxHostSys.cpp
++++ b/common/Linux/LnxHostSys.cpp
+@@ -143,7 +143,11 @@
+ size_t HostSys::GetRuntimeCacheLineSize()
+ {
++	#if defined(__GLIBC__)
+ 	int l1i = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
+ 	int l1d = sysconf(_SC_LEVEL1_ICACHE_LINESIZE);
+ 	int res = (l1i > l1d) ? l1i : l1d;
++	#else
++	int res = 0;
++	#endif
+ 	for (int index = 0; index < 16; index++)
+ 	{

diff --git a/games-emulation/pcsx2/pcsx2-1.7.5835.ebuild b/games-emulation/pcsx2/pcsx2-1.7.5835.ebuild
index 87e19f866161..ece5dfc93cc5 100644
--- a/games-emulation/pcsx2/pcsx2-1.7.5835.ebuild
+++ b/games-emulation/pcsx2/pcsx2-1.7.5835.ebuild
@@ -105,6 +105,10 @@ src_configure() {
 		strip-unsupported-flags
 	fi
 
+	# pthread_attr_setaffinity_np is not supported on musl, may be possible
+	# to remove if bundled lzma code is updated like 7zip did (bug #935298)
+	use elibc_musl && append-cppflags -DZ7_AFFINITY_DISABLE
+
 	local mycmakeargs=(
 		-DBUILD_SHARED_LIBS=no
 		-DDISABLE_ADVANCE_SIMD=yes

diff --git a/games-emulation/pcsx2/pcsx2-1.7.5913.ebuild b/games-emulation/pcsx2/pcsx2-1.7.5913.ebuild
index f8d4b9f5a3aa..deabb28cc4af 100644
--- a/games-emulation/pcsx2/pcsx2-1.7.5913.ebuild
+++ b/games-emulation/pcsx2/pcsx2-1.7.5913.ebuild
@@ -81,6 +81,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.7.5232-cubeb-automagic.patch
 	"${FILESDIR}"/${PN}-1.7.5835-vanilla-shaderc.patch
 	"${FILESDIR}"/${PN}-1.7.5855-no-libbacktrace.patch
+	"${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch
 )
 
 src_prepare() {
@@ -107,6 +108,10 @@ src_configure() {
 		strip-unsupported-flags
 	fi
 
+	# pthread_attr_setaffinity_np is not supported on musl, may be possible
+	# to remove if bundled lzma code is updated like 7zip did (bug #935298)
+	use elibc_musl && append-cppflags -DZ7_AFFINITY_DISABLE
+
 	local mycmakeargs=(
 		-DBUILD_SHARED_LIBS=no
 		-DDISABLE_ADVANCE_SIMD=yes

diff --git a/games-emulation/pcsx2/pcsx2-9999.ebuild b/games-emulation/pcsx2/pcsx2-9999.ebuild
index f8d4b9f5a3aa..deabb28cc4af 100644
--- a/games-emulation/pcsx2/pcsx2-9999.ebuild
+++ b/games-emulation/pcsx2/pcsx2-9999.ebuild
@@ -81,6 +81,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-1.7.5232-cubeb-automagic.patch
 	"${FILESDIR}"/${PN}-1.7.5835-vanilla-shaderc.patch
 	"${FILESDIR}"/${PN}-1.7.5855-no-libbacktrace.patch
+	"${FILESDIR}"/${PN}-1.7.5913-musl-cache.patch
 )
 
 src_prepare() {
@@ -107,6 +108,10 @@ src_configure() {
 		strip-unsupported-flags
 	fi
 
+	# pthread_attr_setaffinity_np is not supported on musl, may be possible
+	# to remove if bundled lzma code is updated like 7zip did (bug #935298)
+	use elibc_musl && append-cppflags -DZ7_AFFINITY_DISABLE
+
 	local mycmakeargs=(
 		-DBUILD_SHARED_LIBS=no
 		-DDISABLE_ADVANCE_SIMD=yes


             reply	other threads:[~2024-07-02  5:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02  5:17 Ionen Wolkens [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-07-02 15:55 [gentoo-commits] repo/gentoo:master commit in: games-emulation/pcsx2/files/, games-emulation/pcsx2/ Ionen Wolkens
2024-06-22  9:34 Ionen Wolkens
2024-05-23  0:53 Ionen Wolkens
2024-05-21 17:19 Ionen Wolkens
2024-04-13 17:29 Ionen Wolkens
2024-01-08 12:59 Ionen Wolkens
2023-10-10 20:20 Ionen Wolkens
2023-07-25  0:10 Ionen Wolkens
2023-07-01  9:07 Ionen Wolkens
2023-01-11 11:26 Ionen Wolkens
2022-12-29 20:29 Ionen Wolkens
2022-12-29  2:05 Ionen Wolkens
2022-12-19  5:48 Ionen Wolkens
2022-09-23  0:27 Ionen Wolkens
2022-07-31 20:38 James Le Cuirot
2020-10-27  7:35 Joonas Niilola
2018-07-23  6:17 Sergei Trofimovich
2017-01-18 10:46 David Seifert
2016-01-13 14:23 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1719897424.1109347a0b07161d08e96bf82608361d24a18a3f.ionen@gentoo \
    --to=ionen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox