commit:     c3d65847f6bf6ab9b8366eb6c5edcc381309b8ef
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 17 09:39:49 2022 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Apr 17 09:41:15 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3d65847

app-emulation/fs-uae: Patch to fix musl build

Closes: https://bugs.gentoo.org/838469
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 .../fs-uae/files/fs-uae-3.1.66-musl.patch          | 35 ++++++++++++++++++++++
 app-emulation/fs-uae/fs-uae-3.1.66.ebuild          |  1 +
 2 files changed, 36 insertions(+)

diff --git a/app-emulation/fs-uae/files/fs-uae-3.1.66-musl.patch 
b/app-emulation/fs-uae/files/fs-uae-3.1.66-musl.patch
new file mode 100644
index 000000000000..cc78261ebe40
--- /dev/null
+++ b/app-emulation/fs-uae/files/fs-uae-3.1.66-musl.patch
@@ -0,0 +1,35 @@
+From 5d7287d1aa99f100e560b5a2d231e49b64a18da3 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <ch...@gentoo.org>
+Date: Sun, 17 Apr 2022 10:29:22 +0100
+Subject: [PATCH] Don't return NULL in mapped_malloc when a bool is expected
+
+This was apparently breaking the build under musl.
+---
+ src/memory.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/memory.cpp b/src/memory.cpp
+index 3cd7dee6..18d1283a 100644
+--- a/src/memory.cpp
++++ b/src/memory.cpp
+@@ -1872,7 +1872,7 @@ bool mapped_malloc (addrbank *ab)
+       if (id == -1) {
+               nocanbang ();
+               if (recurse)
+-                      return NULL;
++                      return false;
+               recurse++;
+               mapped_malloc (ab);
+               recurse--;
+@@ -1904,7 +1904,7 @@ bool mapped_malloc (addrbank *ab)
+               return ab->baseaddr != NULL;
+       }
+       if (recurse)
+-              return NULL;
++              return false;
+       nocanbang ();
+       recurse++;
+       mapped_malloc (ab);
+-- 
+2.34.1
+

diff --git a/app-emulation/fs-uae/fs-uae-3.1.66.ebuild 
b/app-emulation/fs-uae/fs-uae-3.1.66.ebuild
index 5cb3b91f1ede..2853da73fb7d 100644
--- a/app-emulation/fs-uae/fs-uae-3.1.66.ebuild
+++ b/app-emulation/fs-uae/fs-uae-3.1.66.ebuild
@@ -41,6 +41,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.0.0-libmpeg2.patch
        "${FILESDIR}"/${PN}-3.0.0-Xatom.h.patch
        "${FILESDIR}"/${PN}-3.1.35-deepbind.patch
+       "${FILESDIR}"/${PN}-3.1.66-musl.patch
 )
 
 src_prepare() {

Reply via email to