1 |
commit: 874649cd8388e2959d55ab0eb51cc4654ce86837 |
2 |
Author: Wynn Wolf Arbor <wolf <AT> oriole <DOT> systems> |
3 |
AuthorDate: Tue Jun 9 14:12:24 2020 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 28 10:40:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=874649cd |
7 |
|
8 |
mail-filter/libmilter: Fix build on musl |
9 |
|
10 |
The build on musl currently fails in two different places. |
11 |
|
12 |
Firstly, the sys/cdefs.h header is not available on musl. sendmail |
13 |
already includes all necessary compatibility definitions for cdefs.h in |
14 |
its 'libsm' library, but these are turned off through a platform |
15 |
specific header file when building on Linux. Since gcc processes |
16 |
-include options after all -D or -U options, we can't simply pass |
17 |
'-DSM_CONF_SYS_CDEFS_H=0' in the ebuild. Instead, for now, patch the |
18 |
Linux platform header file directly. |
19 |
|
20 |
Secondly, musl does not include the getipnodeby* function family. Pass |
21 |
'-DNEEDSGETIPNODE' to fix this. |
22 |
|
23 |
Closes: https://bugs.gentoo.org/712628 |
24 |
Signed-off-by: Wynn Wolf Arbor <wolf <AT> oriole.systems> |
25 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
26 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
27 |
|
28 |
.../libmilter/files/libmilter-musl-disable-cdefs.patch | 11 +++++++++++ |
29 |
mail-filter/libmilter/libmilter-1.0.2_p1.ebuild | 6 ++++++ |
30 |
2 files changed, 17 insertions(+) |
31 |
|
32 |
diff --git a/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch b/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..6dc4ac63105 |
35 |
--- /dev/null |
36 |
+++ b/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch |
37 |
@@ -0,0 +1,11 @@ |
38 |
+--- a/include/sm/os/sm_os_linux.h 2020-06-09 11:57:46.789786561 +0200 |
39 |
++++ b/include/sm/os/sm_os_linux.h 2020-06-09 11:57:49.174781812 +0200 |
40 |
+@@ -33,7 +33,7 @@ |
41 |
+ # endif /* LINUX_VERSION_CODE */ |
42 |
+ #endif /* SM_CONF_SHM */ |
43 |
+ |
44 |
+-#define SM_CONF_SYS_CDEFS_H 1 |
45 |
++#define SM_CONF_SYS_CDEFS_H 0 |
46 |
+ #ifndef SM_CONF_SEM |
47 |
+ # define SM_CONF_SEM 2 |
48 |
+ #endif /* SM_CONF_SEM */ |
49 |
|
50 |
diff --git a/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild |
51 |
index f2d436b1e73..e197eb05925 100644 |
52 |
--- a/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild |
53 |
+++ b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild |
54 |
@@ -42,6 +42,12 @@ src_prepare() { |
55 |
use ipv6 && ENVDEF="${ENVDEF} -DNETINET6" |
56 |
use poll && ENVDEF="${ENVDEF} -DSM_CONF_POLL=1" |
57 |
|
58 |
+ if use elibc_musl; then |
59 |
+ use ipv6 && ENVDEF="${ENVDEF} -DNEEDSGETIPNODE" |
60 |
+ |
61 |
+ eapply "${FILESDIR}/${PN}-musl-disable-cdefs.patch" |
62 |
+ fi |
63 |
+ |
64 |
sed -e "s|@@CFLAGS@@|${CFLAGS}|" \ |
65 |
-e "s:@@LDFLAGS@@:${LDFLAGS}:" \ |
66 |
-e "s:@@CC@@:${CC}:" \ |