public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgamin/files/, dev-libs/libgamin/
@ 2022-02-07  3:50 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-02-07  3:50 UTC (permalink / raw
  To: gentoo-commits

commit:     11559f90b487fb1480b81dd58eb490e091042f5f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  7 03:49:24 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Feb  7 03:49:24 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11559f90

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 <AT> gentoo.org>

 .../files/libgamin-0.1.10-musl-pthread.patch       | 33 ++++++++++++++++++++++
 dev-libs/libgamin/libgamin-0.1.10-r6.ebuild        |  3 ++
 2 files changed, 36 insertions(+)

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
 


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-07  3:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07  3:50 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgamin/files/, dev-libs/libgamin/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox