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,19 +1811,19 @@ 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)
@ -1831,11 +1831,13 @@ delivery.")
(("(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")
"\n"))
(("(ZCAT_COMMAND=).*" all var) (("(ZCAT_COMMAND=).*" all var)
(string-append var (search-input-file inputs "bin/zcat") "\n")) (string-append var (search-input-file inputs "bin/zcat")
"\n"))
(("# (USE_GNUTLS(|_PC)=.*)" all line) (("# (USE_GNUTLS(|_PC)=.*)" all line)
(string-append line "\n")) (string-append line "\n"))
(("# (AUTH_CRAM_MD5=yes)" all line) line) (("# (AUTH_CRAM_MD5=yes)" all line) line)
@ -1844,32 +1846,33 @@ delivery.")
(("# (AUTH_PLAINTEXT=yes)" all line) line) (("# (AUTH_PLAINTEXT=yes)" all line) line)
(("# (AUTH_SPA=yes)" all line) line) (("# (AUTH_SPA=yes)" all line) line)
(("# (AUTH_TLS=yes)" all line) line)) (("# (AUTH_TLS=yes)" all line) line))
;; This file has hard-coded relative file names for tools despite ;; This file has hard-coded relative file names for tools
;; the zcat configuration above. ;; despite the zcat configuration above.
(substitute* '("src/exigrep.src") (substitute* "src/exigrep.src"
(("'(bzcat|xzcat|zcat|lzma)'" _ command) (("'(bzcat|xzcat|zcat|lzma)'" _ command)
(format #f "'~a'" (format #f "'~a'"
(search-input-file (search-input-file
inputs (string-append "bin/" command)))))))) inputs (string-append "bin/" command))))))))
(add-before 'build 'fix-sh-paths (add-before 'build 'fix-sh-file-names
(lambda _ (lambda _
(substitute* '("scripts/lookups-Makefile" "scripts/reversion") (substitute* (list "scripts/lookups-Makefile"
"scripts/reversion")
(("SHELL=/bin/sh") "SHELL=sh")) (("SHELL=/bin/sh") "SHELL=sh"))
(substitute* '("scripts/Configure-config.h") (substitute* "scripts/Configure-config.h"
(("\\| /bin/sh") "| sh")) (("\\| /bin/sh") "| sh"))
(patch-shebang "scripts/Configure-eximon"))) (patch-shebang "scripts/Configure-eximon")))
(add-before 'build 'build-reproducibly (add-before 'build 'build-reproducibly
(lambda _ (lambda _
;; The compilation number is incremented for every build from the ;; The compilation number increments on every build in the
;; same source tree. It appears to vary over different (parallel?) ;; same source tree and varies across different (parallel?)
;; builds. Make it a constant number instead. ;; builds. Make it a constant number instead.
(substitute* "src/version.c" (substitute* "src/version.c"
(("#include \"cnumber.h\"") "1"))))) (("#include \"cnumber.h\"") "1")))))
#:make-flags #:make-flags
(list (string-append "CC=" ,(cc-for-target)) #~(list (string-append "CC=" #$(cc-for-target))
"INSTALL_ARG=-no_chown") "INSTALL_ARG=-no_chown")
;; No 'check' target. There is a test suite in test/, which assumes that ;; No check target. The test/ suite assumes that particular
;; certain build options were (not) used and that it can freely sudo. ;; build options were (not) used and that it can freely sudo.
#:tests? #f)) #:tests? #f))
(home-page "https://www.exim.org/") (home-page "https://www.exim.org/")
(synopsis (synopsis