commit:     79567f95d25c83baea0df69d7d30b7f372d6c4ef
Author:     Wynn Wolf Arbor <wolf <AT> oriole <DOT> systems>
AuthorDate: Tue Jun  9 14:41:50 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Wed Jun 10 14:45:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79567f95

mail-filter/opendkim: Fix build on musl

The build of libvbr, which is included in opendkim and enabled by
default in the ebuild, fails on musl because the '__P' macro is not
defined. glibc defines it along with '__PMT' in cdefs.h, but notes that
they are kept "only because some other projects expect the macros to be
defined".

Since cdefs.h is not included in musl, patch vbr.h to include this
particular macro definition.

See also: https://github.com/trusteddomainproject/OpenDKIM/pull/74

Closes: https://github.com/gentoo/gentoo/pull/16140
Signed-off-by: Wynn Wolf Arbor <wolf <AT> oriole.systems>
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../opendkim-2.10.3-define-P-macro-in-libvbr.patch | 40 ++++++++++++++++++++++
 mail-filter/opendkim/opendkim-2.10.3-r18.ebuild    |  1 +
 2 files changed, 41 insertions(+)

diff --git 
a/mail-filter/opendkim/files/opendkim-2.10.3-define-P-macro-in-libvbr.patch 
b/mail-filter/opendkim/files/opendkim-2.10.3-define-P-macro-in-libvbr.patch
new file mode 100644
index 00000000000..bbb4eb8b33b
--- /dev/null
+++ b/mail-filter/opendkim/files/opendkim-2.10.3-define-P-macro-in-libvbr.patch
@@ -0,0 +1,40 @@
+From 50a91575cee8d08682f090d2d6bdb4806eccfbcd Mon Sep 17 00:00:00 2001
+From: Wynn Wolf Arbor <[email protected]>
+Date: Wed, 10 Jun 2020 09:37:03 +0200
+Subject: [PATCH] Define __P() macro in libvbr
+
+Definitions for this macro have been added throughout the codebase in
+commits 91e7407d, 705948fd, 227fa252, 842c1733, and b730bdc0, but one
+was still missing from libvbr. glibc contains a definition for legacy
+reasons, but other libcs might not. Particularly, the musl libc does not
+contain it, leading to build errors when enabling support for VBR.
+
+Add a definition for __P() to vbr.h to fix this.
+---
+ libvbr/vbr.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/libvbr/vbr.h b/libvbr/vbr.h
+index 4bef1f36..3bcb9212 100644
+--- a/libvbr/vbr.h
++++ b/libvbr/vbr.h
+@@ -12,6 +12,16 @@
+ /* system includes */
+ #include <sys/types.h>
+
++#ifdef __STDC__
++# ifndef __P
++#  define __P(x)  x
++# endif /* ! __P */
++#else /* __STDC__ */
++# ifndef __P
++#  define __P(x)  ()
++# endif /* ! __P */
++#endif /* __STDC__ */
++
+ /* strings */
+ #define       VBR_ALL                 "all"
+ #define       VBR_INFOHEADER          "VBR-Info"
+--
+2.27.0
+

diff --git a/mail-filter/opendkim/opendkim-2.10.3-r18.ebuild 
b/mail-filter/opendkim/opendkim-2.10.3-r18.ebuild
index 260010392d1..039036e2305 100644
--- a/mail-filter/opendkim/opendkim-2.10.3-r18.ebuild
+++ b/mail-filter/opendkim/opendkim-2.10.3-r18.ebuild
@@ -51,6 +51,7 @@ PATCHES=(
        "${FILESDIR}/${P}-openrc.patch"
        "${FILESDIR}/${P}-openssl-1.1.1.patch.r2"
        "${FILESDIR}/${P}-lua-pkgconfig.patch"
+       "${FILESDIR}/${P}-define-P-macro-in-libvbr.patch"
 )
 
 src_prepare() {

Reply via email to