Subject: [PATCH 2/4] gnu: Add singularity.

From: Ricardo Wurmus <[email-masked]>
Date: Fri, 25 May 2018 17:47:28 +0200

* gnu/packages/linux.scm (singularity): New variable.
---
 gnu/packages/linux.scm | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 70e612995..5670bf193 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2016 Raymond Nicholson <[email-masked]>
 ;;; Copyright © 2016 Mathieu Lirzin <[email-masked]>
 ;;; Copyright © 2016, 2018 Nicolas Goaziou <[email-masked]>
-;;; Copyright © 2016 Ricardo Wurmus <[email-masked]>
+;;; Copyright © 2016, 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2016 David Craven <[email-masked]>
 ;;; Copyright © 2016 John Darrington <[email-masked]>
 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <[email-masked]>
@@ -80,6 +80,7 @@
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages netpbm)
+  #:use-module (gnu packages nettle)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages ninja)
   #:use-module (gnu packages perl)
@@ -2566,6 +2567,43 @@ similar in functionality to chroot, although pflask provides better isolation
 thanks to the use of namespaces.")
     (license license:bsd-2)))
 
+(define-public singularity
+  (package
+    (name "singularity")
+    (version "2.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/singularityware/singularity/releases/download/"
+                                  version "/singularity-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0f28dgf2qcy8ljjfix7p9q36q12j7rxyicfzzi4n0fl8zr8ab88g"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--disable-suid"
+             "--localstatedir=/var")
+       #:phases
+       (modify-phases %standard-phases
+         ;; Do not create directories in /var.
+         (add-after 'unpack 'disable-install-hook
+           (lambda _
+             (substitute* "Makefile.in"
+               (("\\$\\(MAKE\\) .*install-data-hook") ""))
+             #t)))))
+    (inputs
+     `(("libarchive" ,libarchive)
+       ("python" ,python-wrapper)
+       ("nettle" ,nettle)
+       ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("squashfs-tools" ,squashfs-tools)))
+    (home-page "https://singularity.lbl.gov/")
+    (synopsis "Container platform")
+    (description "Singularity is a container platform supporting a number of
+container image formats.")
+    (license license:bsd-3)))
+
 (define-public hdparm
   (package
     (name "hdparm")
-- 
2.15.1