commit:     c0c3f271f5d35a31cfb5225885aaa5258d471590
Author:     Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx>
AuthorDate: Sun Mar 12 23:24:21 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 20 05:32:45 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0c3f271

media-sound/musepack-tools: fix build on musl

Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx>
Bug: https://bugs.gentoo.org/712978

This patch makes the following changes.
* __linux__ isn't the same as __GLIBC__

Thus, it avoids calling <fpu_control.h> macros in musl, doesn't require
conditional patching and still works nicely with glibc-based systems.

* Includes <sys/select.h> for select(3). That header includes <sys/time.h>
and also fixes the struct timeval error.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/musepack-tools-465-musl.patch            | 24 ++++++++++++++++++++++
 .../musepack-tools/musepack-tools-465-r2.ebuild    |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/media-sound/musepack-tools/files/musepack-tools-465-musl.patch 
b/media-sound/musepack-tools/files/musepack-tools-465-musl.patch
new file mode 100644
index 000000000000..f7fb0f771082
--- /dev/null
+++ b/media-sound/musepack-tools/files/musepack-tools-465-musl.patch
@@ -0,0 +1,24 @@
+Bug: https://bugs.gentoo.org/712978
+
+--- a/mpcenc/keyboard.c
++++ b/mpcenc/keyboard.c
+@@ -84,6 +84,8 @@
+ #  define echo_on()   (void)0
+ # endif
+ 
++# include <sys/select.h>
++
+ int
+ WaitKey ( void )
+ {
+--- a/mpcenc/mpcenc.h
++++ b/mpcenc/mpcenc.h
+@@ -50,7 +50,7 @@
+ # include <unistd.h>
+ #endif
+ 
+-#if   defined __linux__
++#if   defined __GLIBC__
+ #  include <fpu_control.h>
+ #elif defined __FreeBSD__
+ # include <machine/floatingpoint.h>

diff --git a/media-sound/musepack-tools/musepack-tools-465-r2.ebuild 
b/media-sound/musepack-tools/musepack-tools-465-r2.ebuild
index 6b5b76e9cdf3..ed17b264c7fb 100644
--- a/media-sound/musepack-tools/musepack-tools-465-r2.ebuild
+++ b/media-sound/musepack-tools/musepack-tools-465-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -29,4 +29,5 @@ RDEPEND="
 PATCHES=(
        "${FILESDIR}"/${P}-gentoo.patch
        "${FILESDIR}"/${P}-fno-common.patch
+       "${FILESDIR}"/${P}-musl.patch
 )

Reply via email to