1 |
commit: 11559f90b487fb1480b81dd58eb490e091042f5f |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 7 03:49:24 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 7 03:49:24 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11559f90 |
7 |
|
8 |
dev-libs/libgamin: fix musl build |
9 |
|
10 |
Upstream is long dead and the patch has been used in ::musl for quite |
11 |
some time. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/538474 |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
.../files/libgamin-0.1.10-musl-pthread.patch | 33 ++++++++++++++++++++++ |
17 |
dev-libs/libgamin/libgamin-0.1.10-r6.ebuild | 3 ++ |
18 |
2 files changed, 36 insertions(+) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 000000000000..35ad2602c46b |
23 |
--- /dev/null |
24 |
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-musl-pthread.patch |
25 |
@@ -0,0 +1,33 @@ |
26 |
+https://bugs.gentoo.org/538474 |
27 |
+https://bugzilla.gnome.org/show_bug.cgi?id=588337 |
28 |
+ |
29 |
+From: Felix Janda <felix.janda@××××××.de> |
30 |
+Date: Mon, 2 Feb 2015 20:08:40 +0100 |
31 |
+Subject: [PATCH] Use PTHREAD_MUTEX_RECURSIVE unconditionally |
32 |
+ |
33 |
+Previously the nonportable PTHREAD_MUTEX_RECURSIVE_NP had been |
34 |
+used for portability with glibc. However since 1998 glibc also |
35 |
+has PTHREAD_MUTEX_RECURSIVE if _XOPEN_SOURCE is >= 500. So we |
36 |
+can use the portable version for all known systems. |
37 |
+--- a/libgamin/gam_data.c |
38 |
++++ b/libgamin/gam_data.c |
39 |
+@@ -2,6 +2,7 @@ |
40 |
+ * gam_data.c: implementation of the connection data handling of libgamin |
41 |
+ */ |
42 |
+ |
43 |
++#define _XOPEN_SOURCE 700 |
44 |
+ #include <stdlib.h> |
45 |
+ #include <string.h> /* for memset */ |
46 |
+ #include <stdio.h> |
47 |
+@@ -470,11 +471,7 @@ gamin_data_new(void) |
48 |
+ } |
49 |
+ if (is_threaded > 0) { |
50 |
+ pthread_mutexattr_init(&attr); |
51 |
+-#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP) |
52 |
+- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); |
53 |
+-#else |
54 |
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); |
55 |
+-#endif |
56 |
+ pthread_mutex_init(&ret->lock, &attr); |
57 |
+ pthread_mutexattr_destroy(&attr); |
58 |
+ } |
59 |
|
60 |
diff --git a/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild b/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild |
61 |
index 5353e67256ce..87a88a7e7a0c 100644 |
62 |
--- a/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild |
63 |
+++ b/dev-libs/libgamin/libgamin-0.1.10-r6.ebuild |
64 |
@@ -59,6 +59,9 @@ src_prepare() { |
65 |
# Fix possible server deadlock in ih_sub_cancel, upstream bug #667230 |
66 |
epatch "${FILESDIR}/${PN}-0.1.10-deadlock.patch" |
67 |
|
68 |
+ # Fix musl build, upstream bug #588337 |
69 |
+ epatch "${FILESDIR}/${PN}-0.1.10-musl-pthread.patch" |
70 |
+ |
71 |
# Drop DEPRECATED flags |
72 |
sed -i -e 's:-DG_DISABLE_DEPRECATED:$(NULL):g' server/Makefile.am || die |