summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-02-07 03:49:24 +0000
committerSam James <sam@gentoo.org>2022-02-07 03:49:24 +0000
commit11559f90b487fb1480b81dd58eb490e091042f5f (patch)
tree5ad84045eea2a85da6d872fde097ec4cbb63e298 /dev-libs/libgamin
parentmedia-sound/mumble: [QA] disable -Werror (diff)
downloadgentoo-11559f90b487fb1480b81dd58eb490e091042f5f.tar.gz
gentoo-11559f90b487fb1480b81dd58eb490e091042f5f.tar.bz2
gentoo-11559f90b487fb1480b81dd58eb490e091042f5f.zip
dev-libs/libgamin: fix musl build
Upstream is long dead and the patch has been used in ::musl for quite some time. Closes: https://bugs.gentoo.org/538474 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/libgamin')
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-musl-pthread.patch33
-rw-r--r--dev-libs/libgamin/libgamin-0.1.10-r6.ebuild3
2 files changed, 36 insertions, 0 deletions
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-musl-pthread.patch b/dev-libs/libgamin/files/libgamin-0.1.10-musl-pthread.patch
new file mode 100644
index 000000000000..35ad2602c46b
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-musl-pthread.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/538474
+https://bugzilla.gnome.org/show_bug.cgi?id=588337
+
+From: Felix Janda <felix.janda@posteo.de>
+Date: Mon, 2 Feb 2015 20:08:40 +0100
+Subject: [PATCH] Use PTHREAD_MUTEX_RECURSIVE unconditionally
+
+Previously the nonportable PTHREAD_MUTEX_RECURSIVE_NP had been
+used for portability with glibc. However since 1998 glibc also
+has PTHREAD_MUTEX_RECURSIVE if _XOPEN_SOURCE is >= 500. So we
+can use the portable version for all known systems.
+--- a/libgamin/gam_data.c
++++ b/libgamin/gam_data.c
+@@ -2,6 +2,7 @@
+ * gam_data.c: implementation of the connection data handling of libgamin
+ */
+
++#define _XOPEN_SOURCE 700
+ #include <stdlib.h>
+ #include <string.h> /* for memset */
+ #include <stdio.h>
+@@ -470,11 +471,7 @@ gamin_data_new(void)
+ }
+ if (is_threaded > 0) {
+ pthread_mutexattr_init(&attr);
+-#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP)
+- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+-#else
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+-#endif
+ pthread_mutex_init(&ret->lock, &attr);
+ pthread_mutexattr_destroy(&attr);
+ }
diff --git a/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild b/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild
index 5353e67256ce..87a88a7e7a0c 100644
--- a/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild
+++ b/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild
@@ -59,6 +59,9 @@ src_prepare() {
# Fix possible server deadlock in ih_sub_cancel, upstream bug #667230
epatch "${FILESDIR}/${PN}-0.1.10-deadlock.patch"
+ # Fix musl build, upstream bug #588337
+ epatch "${FILESDIR}/${PN}-0.1.10-musl-pthread.patch"
+
# Drop DEPRECATED flags
sed -i -e 's:-DG_DISABLE_DEPRECATED:$(NULL):g' server/Makefile.am || die