3
5
Fork 0
mirror of git://git.savannah.gnu.org/guix.git synced 2023-12-14 03:33:07 +01:00

gnu: singularity: Wrap programs so they find Coreutils.

* gnu/packages/linux.scm (singularity)[arguments]: Add 'set-PATH' phase.
This commit is contained in:
Ludovic Courtès 2020-03-12 15:44:26 +01:00
parent cf2ac04f13
commit 22464cf32a
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -3494,7 +3494,19 @@ thanks to the use of namespaces.")
(("if ! singularity_which mksquashfs") "if 0")
(("if ! mksquashfs")
(string-append "if ! " (which "mksquashfs"))))
#t)))))
#t))
(add-after 'install 'set-PATH
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Have the 'singularity' and 'run-singularity' self-sufficient.
(let ((out (assoc-ref outputs "out"))
(coreutils (assoc-ref inputs "coreutils")))
(wrap-program (string-append out "/bin/singularity")
`("PATH" ":" = (,(string-append coreutils "/bin"))))
(substitute* (string-append out "/bin/run-singularity")
(("/usr/bin/env singularity")
(string-append (which "env") " "
out "/bin/singularity")))
#t))))))
(inputs
`(("libarchive" ,libarchive)
("python" ,python-wrapper)