From 874649cd8388e2959d55ab0eb51cc4654ce86837 Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Tue, 9 Jun 2020 16:12:24 +0200 Subject: mail-filter/libmilter: Fix build on musl The build on musl currently fails in two different places. Firstly, the sys/cdefs.h header is not available on musl. sendmail already includes all necessary compatibility definitions for cdefs.h in its 'libsm' library, but these are turned off through a platform specific header file when building on Linux. Since gcc processes -include options after all -D or -U options, we can't simply pass '-DSM_CONF_SYS_CDEFS_H=0' in the ebuild. Instead, for now, patch the Linux platform header file directly. Secondly, musl does not include the getipnodeby* function family. Pass '-DNEEDSGETIPNODE' to fix this. Closes: https://bugs.gentoo.org/712628 Signed-off-by: Wynn Wolf Arbor Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Joonas Niilola --- .../libmilter/files/libmilter-musl-disable-cdefs.patch | 11 +++++++++++ mail-filter/libmilter/libmilter-1.0.2_p1.ebuild | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch (limited to 'mail-filter/libmilter') diff --git a/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch b/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch new file mode 100644 index 000000000000..6dc4ac63105e --- /dev/null +++ b/mail-filter/libmilter/files/libmilter-musl-disable-cdefs.patch @@ -0,0 +1,11 @@ +--- a/include/sm/os/sm_os_linux.h 2020-06-09 11:57:46.789786561 +0200 ++++ b/include/sm/os/sm_os_linux.h 2020-06-09 11:57:49.174781812 +0200 +@@ -33,7 +33,7 @@ + # endif /* LINUX_VERSION_CODE */ + #endif /* SM_CONF_SHM */ + +-#define SM_CONF_SYS_CDEFS_H 1 ++#define SM_CONF_SYS_CDEFS_H 0 + #ifndef SM_CONF_SEM + # define SM_CONF_SEM 2 + #endif /* SM_CONF_SEM */ diff --git a/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild index f2d436b1e73d..e197eb05925d 100644 --- a/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild +++ b/mail-filter/libmilter/libmilter-1.0.2_p1.ebuild @@ -42,6 +42,12 @@ src_prepare() { use ipv6 && ENVDEF="${ENVDEF} -DNETINET6" use poll && ENVDEF="${ENVDEF} -DSM_CONF_POLL=1" + if use elibc_musl; then + use ipv6 && ENVDEF="${ENVDEF} -DNEEDSGETIPNODE" + + eapply "${FILESDIR}/${PN}-musl-disable-cdefs.patch" + fi + sed -e "s|@@CFLAGS@@|${CFLAGS}|" \ -e "s:@@LDFLAGS@@:${LDFLAGS}:" \ -e "s:@@CC@@:${CC}:" \ -- cgit v1.2.3-65-gdbad