commit: 58fbe741f556d999674b8e8f41597ce1a71306a2
parent: 8c628abcde2cb0a80e8899f990d4074bff9d4c09
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 28 Oct 2018 07:35:59 +0100
mail-mta/opensmtpd: Fix missing object files (6.4.0)
Diffstat:
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/mail-mta/opensmtpd/files/opensmtpd-6.4.0_p1_missing_object_file_smtpctl.patch b/mail-mta/opensmtpd/files/opensmtpd-6.4.0_p1_missing_object_file_smtpctl.patch
@@ -0,0 +1,33 @@
+From a0dc55816ac0aa58b832331799fb7d1e160e427d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?L=C3=A9o=20Gaspard?= <leo@gaspard.io>
+Date: Sat, 27 Oct 2018 11:53:28 +0900
+Subject: [PATCH] Add missing object file for smtpctl
+
+With this change and addition of `CFLAGS=-ffunction-sections` and
+`LDFLAGS=-Wl,--gc-sections`, it now builds.
+
+`purge_config` is defined in `config.c` but used in `parse.y`, making
+`config.c` mandatory. But `config.c` requires lots of functions from
+other files in other unrelated functions, meaning that these unrelated
+(and unused in `smtpctl`) functions need to be garbage-collected.
+
+This is a workaround, a better way would likely be to refactor
+`purge_config` and `config_default` out of `config.c`, but I don't want
+to push for a change that would separate the portable version and the
+OpenBSD version too much.
+---
+ mk/smtpctl/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mk/smtpctl/Makefile.am b/mk/smtpctl/Makefile.am
+index 5af0b713..f0fce735 100644
+--- a/mk/smtpctl/Makefile.am
++++ b/mk/smtpctl/Makefile.am
+@@ -4,6 +4,7 @@ sbin_PROGRAMS= smtpctl
+
+ smtpctl_SOURCES= $(smtpd_srcdir)/enqueue.c
+ smtpctl_SOURCES+= $(smtpd_srcdir)/parser.c
++smtpctl_SOURCES+= $(smtpd_srcdir)/parse.c
+ smtpctl_SOURCES+= $(smtpd_srcdir)/log.c
+ smtpctl_SOURCES+= $(smtpd_srcdir)/envelope.c
+ smtpctl_SOURCES+= $(smtpd_srcdir)/queue_backend.c
diff --git a/mail-mta/opensmtpd/opensmtpd-6.4.0_p1.ebuild b/mail-mta/opensmtpd/opensmtpd-6.4.0_p1.ebuild
@@ -46,6 +46,9 @@ S=${WORKDIR}/${MY_P/_}
src_prepare() {
# Use /run instead of /var/run
sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die
+ epatch "${FILESDIR}/opensmtpd-6.4.0_p1_missing_object_file_smtpctl.patch"
+ append-cflags "-ffunction-sections"
+ append-ldflags "-Wl,--gc-sections"
epatch_user
eautoreconf
}