gnu: singularity: Modernize package definition.

* gnu/packages/linux.scm (singularity)[source]: Remove trailing #t from
snippet.
[arguments]: Use G-expressions; remove trailing #t from build phases.
[inputs]: Drop labels; add coreutils.
This commit is contained in:
Ricardo Wurmus 2023-10-17 13:55:36 +02:00
parent d389f67773
commit 2fb94a505b
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC

View File

@ -12,7 +12,7 @@
;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org> ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016, 2018-2023 Nicolas Goaziou <mail@nicolasgoaziou.fr> ;;; Copyright © 2016, 2018-2023 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016 John Darrington <jmd@gnu.org> ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;; Copyright © 2016-2023 Marius Bakke <marius@gnu.org> ;;; Copyright © 2016-2023 Marius Bakke <marius@gnu.org>
@ -5215,45 +5215,43 @@ thanks to the use of namespaces.")
;; supported since Linux-libre 5.4.5. ;; supported since Linux-libre 5.4.5.
(substitute* "src/lib/image/squashfs/mount.c" (substitute* "src/lib/image/squashfs/mount.c"
(("\"errors=remount-ro\"") (("\"errors=remount-ro\"")
"NULL")) "NULL"))))))
#t))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:configure-flags '("--localstatedir=/var") (list
#:phases #:configure-flags #~(list "--localstatedir=/var")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'patch-references #~(modify-phases %standard-phases
(lambda _ (add-after 'unpack 'patch-references
(substitute* "libexec/cli/build.exec.in" (lambda _
(("-mksquashfs") (string-append "-" (which "mksquashfs")))) (substitute* "libexec/cli/build.exec.in"
(substitute* (append (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
(substitute* (append
(find-files "libexec" "functions") (find-files "libexec" "functions")
(find-files "libexec/bootstrap-scripts" ".*sh$") (find-files "libexec/bootstrap-scripts" ".*sh$")
(find-files "libexec/cli" ".*exec$")) (find-files "libexec/cli" ".*exec$"))
(("\\| grep ") (("\\| grep ")
(string-append "| " (which "grep") " ")) (string-append "| " (which "grep") " "))
(("egrep ") (("egrep ")
(string-append (which "egrep") " ")) (string-append (which "egrep") " "))
((" sed ") ((" sed ")
(string-append " " (which "sed") " "))) (string-append " " (which "sed") " ")))))
#t)) (add-after 'install 'set-PATH
(add-after 'install 'set-PATH (lambda _
(lambda* (#:key inputs outputs #:allow-other-keys) ;; Have the 'singularity' and 'run-singularity' self-sufficient.
;; Have the 'singularity' and 'run-singularity' self-sufficient. (let ((coreutils #$(this-package-input "coreutils")))
(let ((out (assoc-ref outputs "out")) (wrap-program (string-append #$output "/bin/singularity")
(coreutils (assoc-ref inputs "coreutils"))) `("PATH" ":" = (,(string-append coreutils "/bin"))))
(wrap-program (string-append out "/bin/singularity") (substitute* (string-append #$output "/bin/run-singularity")
`("PATH" ":" = (,(string-append coreutils "/bin")))) (("/usr/bin/env singularity")
(substitute* (string-append out "/bin/run-singularity") (string-append (which "env") " "
(("/usr/bin/env singularity") #$output "/bin/singularity")))))))))
(string-append (which "env") " "
out "/bin/singularity")))
#t))))))
(inputs (inputs
`(("libarchive" ,libarchive) (list coreutils
("python" ,python-wrapper) libarchive
("zlib" ,zlib) python-wrapper
("squashfs-tools" ,squashfs-tools))) squashfs-tools
zlib))
(home-page "https://singularity.lbl.gov/") (home-page "https://singularity.lbl.gov/")
(synopsis "Container platform") (synopsis "Container platform")
(description "Singularity is a container platform supporting a number of (description "Singularity is a container platform supporting a number of