aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/mail.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2024-08-18 02:00:00 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2024-08-18 02:00:00 +0200
commit83338f5a72c80eb7bb75d4e3f31266318bb4d4a3 (patch)
tree97f6134df08d5341f1d0666371f255dc0b19ab4a /gnu/packages/mail.scm
parent13e947c4f5e3c54073d5cf0fa29285a62be0c466 (diff)
downloadguix-83338f5a72c80eb7bb75d4e3f31266318bb4d4a3.tar
guix-83338f5a72c80eb7bb75d4e3f31266318bb4d4a3.tar.gz
gnu: opensmtpd: Fix cross-compilation.
* gnu/packages/mail.scm (opensmtpd)[arguments]: Specify the correct, non-native ‘zcat’ in #:configure-flags. Fix the 'patch-FHS-file-names phase to do the same for ‘cat’ & ‘sh’. [inputs]: Add bash-minimal, coreutils, and gzip. Change-Id: I0877b982929b4931abf0fc82871d05cab9e888c0
Diffstat (limited to 'gnu/packages/mail.scm')
-rw-r--r--gnu/packages/mail.scm41
1 files changed, 25 insertions, 16 deletions
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a41f5e2ed5..1f24592834 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -3289,7 +3289,10 @@ from the Cyrus IMAP project.")
(inputs
;; OpenSMTPd bundled (a subset of) libasr and libtls, which we use. See
;; https://www.mail-archive.com/misc@opensmtpd.org/msg05909.html for why.
- (list bdb
+ (list bash-minimal ;sh invoked at run time
+ bdb
+ coreutils ;for cat
+ gzip ;for zcat
libbsd ;https://github.com/OpenSMTPD/OpenSMTPD/issues/1233
libevent
libressl
@@ -3300,30 +3303,36 @@ from the Cyrus IMAP project.")
groff ;for man pages
pkg-config))
(arguments
- `(#:configure-flags
- (list "--localstatedir=/var"
- "--with-libbsd"
- ;; This is the default only if it exists at build time—it doesn't.
- "--with-path-socket=/var/run"
- "--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt"
- "--with-user-smtpd=smtpd"
- "--with-user-queue=smtpq" "--with-group-queue=smtpq"
- "--with-auth-pam"
- "--with-table-db")
- #:phases
- (modify-phases %standard-phases
+ (list
+ #:configure-flags
+ #~(list "--localstatedir=/var"
+ "--with-libbsd"
+ ;; This is the default only if it exists at build time—it doesn't.
+ "--with-path-socket=/var/run"
+ "--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt"
+ "--with-user-smtpd=smtpd"
+ "--with-user-queue=smtpq" "--with-group-queue=smtpq"
+ "--with-auth-pam"
+ "--with-table-db"
+
+ ;; This is called at run time but defaults to the native zcat in
+ ;; $PATH, breaking cross-compilation.
+ (string-append "ac_cv_path_ZCAT="
+ #$(this-package-input "gzip") "/bin/zcat"))
+ #:phases
+ `(modify-phases %standard-phases
;; Fix some incorrectly hard-coded external tool file names.
(add-after 'unpack 'patch-FHS-file-names
- (lambda _
+ (lambda* (#:key inputs #:allow-other-keys)
;; avoids warning smtpd: couldn't enqueue offline message
;; smtpctl exited abnormally
(substitute* "usr.sbin/smtpd/smtpd.h"
(("/usr/bin/smtpctl") "/run/setuid-programs/smtpctl"))
(substitute* "usr.sbin/smtpd/smtpctl.c"
;; ‘gzcat’ is auto-detected at compile time, but ‘cat’ isn't.
- (("/bin/cat") (which "cat")))
+ (("/bin/cat" file) (search-input-file inputs file)))
(substitute* "usr.sbin/smtpd/mda_unpriv.c"
- (("/bin/sh") (which "sh")))))
+ (("/bin/sh" file) (search-input-file inputs file)))))
;; OpenSMTPD provides a single smtpctl utility to control both the
;; daemon and the local submission subsystem. To accomodate systems
;; that require historical interfaces such as sendmail, newaliases or