Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/icon/files/, dev-lang/icon/
Date: Thu, 04 Jun 2020 13:35:39
Message-Id: 1591277677.ee19109f17c12e97eea26c8506538eb246de32ee.juippis@gentoo
1 commit: ee19109f17c12e97eea26c8506538eb246de32ee
2 Author: Cheyenne Wills <cwills <AT> witznd <DOT> net>
3 AuthorDate: Mon May 18 04:48:10 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 4 13:34:37 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee19109f
7
8 dev-lang/icon: fix for building with sys-libs/musl
9
10 The Icon Programming Library function fpoll.c fails to build when
11 the sys-libs/musl is being used.
12
13 fpoll.c is sensitive to the internal layout of the FILE structure.
14
15 Patch fpoll.c so it will build when sys-libs/musl is used.
16
17 Since the musl library does not provide a way to detect that the
18 musl library is being used. Update the ebuild to update CFLAGS
19 to include a define that indicates musl is being used.
20
21 In addition, CFLAGS were being overridden within the build process.
22 Update the ebuild to ensure that the ebuild's CFLAGS are used.
23
24 Closes: https://bugs.gentoo.org/716212
25 Signed-off-by: Cheyenne Wills <cwills <AT> witznd.net>
26 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
27
28 dev-lang/icon/files/icon-9.5.1-musl.patch | 24 ++++++++++++++++++++++++
29 dev-lang/icon/icon-9.5.1-r2.ebuild | 12 +++++++++++-
30 2 files changed, 35 insertions(+), 1 deletion(-)
31
32 diff --git a/dev-lang/icon/files/icon-9.5.1-musl.patch b/dev-lang/icon/files/icon-9.5.1-musl.patch
33 new file mode 100644
34 index 00000000000..16fc9df0173
35 --- /dev/null
36 +++ b/dev-lang/icon/files/icon-9.5.1-musl.patch
37 @@ -0,0 +1,24 @@
38 +diff -uprN a/ipl/cfuncs/fpoll.c b/ipl/cfuncs/fpoll.c
39 +--- a/ipl/cfuncs/fpoll.c 2020-05-10 21:46:39.730752626 -0600
40 ++++ b/ipl/cfuncs/fpoll.c 2020-05-10 21:50:41.613577816 -0600
41 +@@ -33,6 +33,10 @@
42 + #include <sys/types.h>
43 + #include <sys/time.h>
44 +
45 ++#if defined(_MUSL)
46 ++# include <stdio_ext.h>
47 ++#endif
48 ++
49 + #include "icall.h"
50 +
51 + int fpoll(int argc, descriptor *argv) /*: await data from file */
52 +@@ -66,6 +70,9 @@ int fpoll(int argc, descriptor *argv) /*
53 + #elif defined(_FSTDIO) /* new BSD library */
54 + if (f->_r > 0)
55 + RetArg(1);
56 ++#elif defined(_MUSL) /* MUSL library */
57 ++ if (__freadahead(f))
58 ++ RetArg(1);
59 + #else /* old AT&T library */
60 + if (f->_cnt > 0)
61 + RetArg(1);
62
63 diff --git a/dev-lang/icon/icon-9.5.1-r2.ebuild b/dev-lang/icon/icon-9.5.1-r2.ebuild
64 index 5f313ed60aa..d76ac046eb3 100644
65 --- a/dev-lang/icon/icon-9.5.1-r2.ebuild
66 +++ b/dev-lang/icon/icon-9.5.1-r2.ebuild
67 @@ -31,8 +31,13 @@ PATCHES=(
68 "${FILESDIR}"/${PN}-9.5.1-flags.patch
69 # https://bugs.gentoo.org/669330
70 # Fix glibc 2.28 problem.
71 - # Patch has also been submitted for upstream approval
72 + # Patch has been accepted upstream, but is not yet in a release
73 "${FILESDIR}"/${PN}-9.5.1-fpoll.patch
74 +
75 + # https://bugs.gentoo.org/716212
76 + # Fix building with musl
77 + # Patch has been accepted upstream, but is not yet in a release
78 + "${FILESDIR}"/${PN}-9.5.1-musl.patch
79 )
80
81 src_prepare() {
82 @@ -61,8 +66,13 @@ src_configure() {
83 -e 's:-L/usr/X11R6/lib64::g' \
84 -e 's:-L/usr/X11R6/lib::g' \
85 -e 's:-I/usr/X11R6/include::g' \
86 + -e 's:-I/usr/X11R6/include::g' \
87 + -e '/^CFLAGS/d' \
88 Makedefs || die "sed of Makedefs failed"
89
90 + if use elibc_musl; then
91 + append-flags "-D_MUSL"
92 + fi
93 append-flags $(test-flags -fno-strict-aliasing -fwrapv)
94 }