commit:     b17a1ad38a204f915a59f2df1fb63b3029d8fc43
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Mon Apr 25 22:04:00 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 26 04:13:01 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b17a1ad3

games-fps/yamagi-quake2: fix musl build

Closes: https://bugs.gentoo.org/831793

Signed-off-by: Alexander Tsoy <alexander <AT> tsoy.me>
Closes: https://github.com/gentoo/gentoo/pull/25204
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/yamagi-quake2-8.01-execinfo.patch        | 49 ++++++++++++++++++++++
 games-fps/yamagi-quake2/yamagi-quake2-8.01.ebuild  |  3 ++
 2 files changed, 52 insertions(+)

diff --git a/games-fps/yamagi-quake2/files/yamagi-quake2-8.01-execinfo.patch 
b/games-fps/yamagi-quake2/files/yamagi-quake2-8.01-execinfo.patch
new file mode 100644
index 000000000000..40de2342fa8e
--- /dev/null
+++ b/games-fps/yamagi-quake2/files/yamagi-quake2-8.01-execinfo.patch
@@ -0,0 +1,49 @@
+From e4a23de95ac1b1333a8f349a1ead82999bca3862 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <[email protected]>
+Date: Sun, 17 Apr 2022 17:07:28 +0300
+Subject: [PATCH] build: Make execinfo optional
+
+---
+ Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 3f9d72ce..99048a82 100644
+--- a/Makefile
++++ b/Makefile
+@@ -62,6 +62,8 @@ WITH_SYSTEMWIDE:=no
+ # MUST NOT be surrounded by quotation marks!
+ WITH_SYSTEMDIR:=""
+ 
++WITH_EXECINFO:=yes
++
+ # This will set the build options to create an MacOS .app-bundle.
+ # The app-bundle itself will not be created, but the runtime paths
+ # will be set to expect the game-data in *.app/
+@@ -406,6 +408,7 @@ config:
+       @echo "WITH_RPATH = $(WITH_RPATH)"
+       @echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)"
+       @echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)"
++      @echo "WITH_EXECINFO = $(WITH_EXECINFO)"
+       @echo "============================"
+       @echo ""
+ 
+@@ -492,6 +495,7 @@ release/quake2 : CFLAGS += -DUSE_OPENAL 
-DDEFAULT_OPENAL_DRIVER='"libopenal.so.1
+ endif
+ endif
+ 
++ifeq ($(WITH_EXECINFO),yes)
+ ifeq ($(YQ2_OSTYPE), Linux)
+ release/quake2 : CFLAGS += -DHAVE_EXECINFO
+ endif
+@@ -523,6 +527,7 @@ ifeq ($(YQ2_OSTYPE), Haiku)
+ release/quake2 : CFLAGS += -DHAVE_EXECINFO
+ release/quake2 : LDLIBS += -lexecinfo
+ endif
++endif
+ 
+ ifeq ($(WITH_RPATH),yes)
+ ifeq ($(YQ2_OSTYPE), Darwin)
+-- 
+2.35.1
+

diff --git a/games-fps/yamagi-quake2/yamagi-quake2-8.01.ebuild 
b/games-fps/yamagi-quake2/yamagi-quake2-8.01.ebuild
index 2b7bbeeab057..12f94411a485 100644
--- a/games-fps/yamagi-quake2/yamagi-quake2-8.01.ebuild
+++ b/games-fps/yamagi-quake2/yamagi-quake2-8.01.ebuild
@@ -43,6 +43,8 @@ DEPEND="${RDEPEND}
        client? ( vulkan? ( dev-util/vulkan-headers ) )
 "
 
+PATCHES=( "${FILESDIR}"/${PN}-8.01-execinfo.patch )
+
 DOCS=( CHANGELOG README.md doc )
 
 src_compile() {
@@ -51,6 +53,7 @@ src_compile() {
        local targets=( game )
        local emakeargs=(
                VERBOSE=1
+               WITH_EXECINFO=$(usex elibc_musl no yes)
                WITH_SYSTEMWIDE=yes
                WITH_SYSTEMDIR="${EPREFIX}"/usr/share/quake2
                WITH_OPENAL=$(usex openal)

Reply via email to