From 22464cf32abcd38311eb29001a23b26f8c4c54dc Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 12 Mar 2020 15:44:26 +0100 Subject: gnu: singularity: Wrap programs so they find Coreutils. * gnu/packages/linux.scm (singularity)[arguments]: Add 'set-PATH' phase. --- gnu/packages/linux.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gnu/packages') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b6048a8cfb..e864e17800 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -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) -- cgit 1.4.1