Archived
1
0
Fork 0

gnu: exim: Use G-expressions.

* gnu/packages/mail.scm (exim)[arguments]:
Rewrite as G-expressions.  Make some surface tweaks to reduce
excessive indentation in places, but again the output is unchanged.
This commit is contained in:
Tobias Geerinckx-Rice 2022-06-19 02:00:05 +02:00
parent 41bc69886a
commit f454e0fcaa
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -1811,66 +1811,69 @@ delivery.")
(native-inputs (native-inputs
(list pcre2 perl pkg-config)) (list pcre2 perl pkg-config))
(arguments (arguments
`(#:phases (list #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'configure (replace 'configure
;; We'd use #:make-flags but the top-level Makefile calls others ;; We'd use #:make-flags but the top-level Makefile calls
;; recursively, so just set all variables this way. ;; others recursively, so just set all variables this way.
(lambda* (#:key outputs inputs #:allow-other-keys) (lambda* (#:key outputs inputs #:allow-other-keys)
(substitute* '("Makefile" "OS/Makefile-Default") (substitute* (list "Makefile" "OS/Makefile-Default")
(("(RM_COMMAND=).*" all var) (("(RM_COMMAND=).*" all var)
(string-append var "rm\n"))) (string-append var "rm\n")))
(copy-file "src/EDITME" "Local/Makefile") (copy-file "src/EDITME" "Local/Makefile")
(copy-file "exim_monitor/EDITME" "Local/eximon.conf") (copy-file "exim_monitor/EDITME" "Local/eximon.conf")
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out")))
(substitute* '("Local/Makefile") (substitute* "Local/Makefile"
(("(BIN_DIRECTORY=).*" all var) (("(BIN_DIRECTORY=).*" all var)
(string-append var out "/bin\n")) (string-append var out "/bin\n"))
(("(CONFIGURE_FILE=).*" all var) (("(CONFIGURE_FILE=).*" all var)
(string-append var out "/etc/exim.conf\n")) (string-append var out "/etc/exim.conf\n"))
(("(EXIM_USER=).*" all var) (("(EXIM_USER=).*" all var)
(string-append var "nobody\n")) (string-append var "nobody\n"))
(("(FIXED_NEVER_USERS=).*" all var) (("(FIXED_NEVER_USERS=).*" all var)
(string-append var "\n")) ; XXX no root in build environment (string-append var "\n")) ; no root in build environment
(("(COMPRESS_COMMAND=).*" all var) (("(COMPRESS_COMMAND=).*" all var)
(string-append var (search-input-file inputs "bin/gzip") "\n")) (string-append var (search-input-file inputs "bin/gzip")
(("(ZCAT_COMMAND=).*" all var) "\n"))
(string-append var (search-input-file inputs "bin/zcat") "\n")) (("(ZCAT_COMMAND=).*" all var)
(("# (USE_GNUTLS(|_PC)=.*)" all line) (string-append var (search-input-file inputs "bin/zcat")
(string-append line "\n")) "\n"))
(("# (AUTH_CRAM_MD5=yes)" all line) line) (("# (USE_GNUTLS(|_PC)=.*)" all line)
(("# (AUTH_DOVECOT=yes)" all line) line) (string-append line "\n"))
(("# (AUTH_EXTERNAL=yes)" all line) line) (("# (AUTH_CRAM_MD5=yes)" all line) line)
(("# (AUTH_PLAINTEXT=yes)" all line) line) (("# (AUTH_DOVECOT=yes)" all line) line)
(("# (AUTH_SPA=yes)" all line) line) (("# (AUTH_EXTERNAL=yes)" all line) line)
(("# (AUTH_TLS=yes)" all line) line)) (("# (AUTH_PLAINTEXT=yes)" all line) line)
;; This file has hard-coded relative file names for tools despite (("# (AUTH_SPA=yes)" all line) line)
;; the zcat configuration above. (("# (AUTH_TLS=yes)" all line) line))
(substitute* '("src/exigrep.src") ;; This file has hard-coded relative file names for tools
(("'(bzcat|xzcat|zcat|lzma)'" _ command) ;; despite the zcat configuration above.
(format #f "'~a'" (substitute* "src/exigrep.src"
(search-input-file (("'(bzcat|xzcat|zcat|lzma)'" _ command)
inputs (string-append "bin/" command)))))))) (format #f "'~a'"
(add-before 'build 'fix-sh-paths (search-input-file
(lambda _ inputs (string-append "bin/" command))))))))
(substitute* '("scripts/lookups-Makefile" "scripts/reversion") (add-before 'build 'fix-sh-file-names
(("SHELL=/bin/sh") "SHELL=sh")) (lambda _
(substitute* '("scripts/Configure-config.h") (substitute* (list "scripts/lookups-Makefile"
(("\\| /bin/sh") "| sh")) "scripts/reversion")
(patch-shebang "scripts/Configure-eximon"))) (("SHELL=/bin/sh") "SHELL=sh"))
(add-before 'build 'build-reproducibly (substitute* "scripts/Configure-config.h"
(lambda _ (("\\| /bin/sh") "| sh"))
;; The compilation number is incremented for every build from the (patch-shebang "scripts/Configure-eximon")))
;; same source tree. It appears to vary over different (parallel?) (add-before 'build 'build-reproducibly
;; builds. Make it a constant number instead. (lambda _
(substitute* "src/version.c" ;; The compilation number increments on every build in the
(("#include \"cnumber.h\"") "1"))))) ;; same source tree and varies across different (parallel?)
#:make-flags ;; builds. Make it a constant number instead.
(list (string-append "CC=" ,(cc-for-target)) (substitute* "src/version.c"
"INSTALL_ARG=-no_chown") (("#include \"cnumber.h\"") "1")))))
;; No 'check' target. There is a test suite in test/, which assumes that #:make-flags
;; certain build options were (not) used and that it can freely sudo. #~(list (string-append "CC=" #$(cc-for-target))
#:tests? #f)) "INSTALL_ARG=-no_chown")
;; No check target. The test/ suite assumes that particular
;; build options were (not) used and that it can freely sudo.
#:tests? #f))
(home-page "https://www.exim.org/") (home-page "https://www.exim.org/")
(synopsis (synopsis
"Message Transfer Agent (MTA) developed at the University of Cambridge") "Message Transfer Agent (MTA) developed at the University of Cambridge")