guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/05: gnu: singularity: Wrap programs so they find Coreutils.


From: guix-commits
Subject: 02/05: gnu: singularity: Wrap programs so they find Coreutils.
Date: Thu, 12 Mar 2020 13:33:19 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 22464cf32abcd38311eb29001a23b26f8c4c54dc
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Mar 12 15:44:26 2020 +0100

    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(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index b6048a8..e864e17 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]