git.iko.soy/typeable/nixpkgs
on master help sign in
singularity: 2.2 -> 2.4
commitdb927ea35b655129a0a6590d60ba8c53730c22c7 authorJustin Bedo <cu@cua0.org> dateTue 7 Nov 2017, 14:47 (9 years ago) parent02d361c
3 files changed+63−7
pkgs/applications/virtualization/singularity/default.nix+37−5 pkgs/applications/virtualization/singularity/env.patch+21 pkgs/build-support/singularity-tools/default.nix+5−2
pkgs/applications/virtualization/singularity/default.nix+37−5
@@ -1,20 +1,52 @@
11{ stdenv
22, fetchFromGitHub
3−, autoreconfHook }:
3+, autoreconfHook
4+, gnutar
5+, which
6+, gnugrep
7+, coreutils
8+, python
9+, e2fsprogs
10+, makeWrapper
11+, squashfsTools
12+, gzip
13+, gnused
14+, curl
15+, utillinux
16+ }:
417
518stdenv.mkDerivation rec {
619 name = "singularity-${version}";
7− version = "2.2";
20+ version = "2.4";
21+
22+ enableParallelBuilding = true;
23+
24+ patches = [ ./env.patch ];
25+
26+ preConfigure = ''
27+ sed -i 's/-static//g' src/Makefile.am
28+ patchShebangs .
29+ '';
30+
31+ fixupPhase = ''
32+ patchShebangs $out
33+ for f in $out/libexec/singularity/helpers/help.sh $out/libexec/singularity/cli/*.exec $out/libexec/singularity/bootstrap-scripts/*.sh ; do
34+ chmod a+x $f
35+ sed -i 's| /sbin/| |g' $f
36+ sed -i 's| /bin/bash| ${stdenv.shell}|g' $f
37+ wrapProgram $f --prefix PATH : ${stdenv.lib.makeBinPath buildInputs}
38+ done
39+ '';
840
941 src = fetchFromGitHub {
1042 owner = "singularityware";
1143 repo = "singularity";
1244 rev = version;
13− sha256 = "19g43gfdy5s8y4252474cp39d6ypn5dd37wp0s21fgd13vqy26px";
45+ sha256 = "1hi1ag1lb2x4djbz4x34wix83ymx0g9mzn2md6yrpiflc1d85rjz";
1446 };
1547
16− nativeBuildInputs = [ autoreconfHook ];
17− buildInputs = [ ];
48+ nativeBuildInputs = [ autoreconfHook makeWrapper ];
49+ buildInputs = [ coreutils gnugrep python e2fsprogs which gnutar squashfsTools gzip gnused curl utillinux ];
1850
1951 meta = with stdenv.lib; {
2052 homepage = http://singularity.lbl.gov/;
pkgs/applications/virtualization/singularity/env.patchnew file+21
@@ -0,0 +1,21 @@
1+diff --git a/libexec/functions b/libexec/functions
2+index bc68107..6c2211c 100644
3+--- a/libexec/functions
4++++ b/libexec/functions
5+@@ -29,16 +29,6 @@ if [ -z "${SINGULARITY_MESSAGELEVEL:-}" ]; then
6+ SINGULARITY_MESSAGELEVEL=5
7+ fi
8+
9+-if [ -z "${USER:-}" ]; then
10+- USER=`id -un`
11+- export USER
12+-fi
13+-if [ -z "${HOME:-}" ]; then
14+- HOME=`getent passwd "$USER" | cut -d : -f 6`
15+- export HOME
16+-fi
17+-
18+-
19+ message() {
20+ LEVEL="${1:-}"
21+ MESSAGE="${2:-}"
pkgs/build-support/singularity-tools/default.nix+5−2
@@ -61,6 +61,7 @@ rec {
6161 mkfs -t ext3 -b 4096 /dev/${vmTools.hd}
6262 mount /dev/${vmTools.hd} disk
6363 cd disk
64+ mkdir proc sys dev
6465
6566 # Run root script
6667 ${stdenv.lib.optionalString (runAsRoot != null) ''
@@ -92,8 +93,10 @@ rec {
9293 cd disk
9394
9495 export PATH=$PATH:${e2fsprogs}/bin/
95− singularity create -s $((1 + size * 4 / 1024 + ${toString extraSpace})) $out
96− tar -c . | singularity import $out
96+ echo creating
97+ singularity image.create -s $((1 + size * 4 / 1024 + ${toString extraSpace})) $out
98+ echo importing
99+ tar -c . | singularity image.import $out
97100 '');
98101
99102 in result;