guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/11: gnu: opensmtpd: Fix cross-compilation.


From: guix-commits
Subject: 08/11: gnu: opensmtpd: Fix cross-compilation.
Date: Thu, 22 Aug 2024 17:54:51 -0400 (EDT)

nckx pushed a commit to branch master
in repository guix.

commit 83338f5a72c80eb7bb75d4e3f31266318bb4d4a3
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Aug 18 02:00:00 2024 +0200

    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
---
 gnu/packages/mail.scm | 41 +++++++++++++++++++++++++----------------
 1 file 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]