mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
singularity: 2.2 -> 2.4
This commit is contained in:
parent
02d361cea9
commit
db927ea35b
|
@ -1,20 +1,52 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, autoreconfHook }:
|
, autoreconfHook
|
||||||
|
, gnutar
|
||||||
|
, which
|
||||||
|
, gnugrep
|
||||||
|
, coreutils
|
||||||
|
, python
|
||||||
|
, e2fsprogs
|
||||||
|
, makeWrapper
|
||||||
|
, squashfsTools
|
||||||
|
, gzip
|
||||||
|
, gnused
|
||||||
|
, curl
|
||||||
|
, utillinux
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "singularity-${version}";
|
name = "singularity-${version}";
|
||||||
version = "2.2";
|
version = "2.4";
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
patches = [ ./env.patch ];
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
sed -i 's/-static//g' src/Makefile.am
|
||||||
|
patchShebangs .
|
||||||
|
'';
|
||||||
|
|
||||||
|
fixupPhase = ''
|
||||||
|
patchShebangs $out
|
||||||
|
for f in $out/libexec/singularity/helpers/help.sh $out/libexec/singularity/cli/*.exec $out/libexec/singularity/bootstrap-scripts/*.sh ; do
|
||||||
|
chmod a+x $f
|
||||||
|
sed -i 's| /sbin/| |g' $f
|
||||||
|
sed -i 's| /bin/bash| ${stdenv.shell}|g' $f
|
||||||
|
wrapProgram $f --prefix PATH : ${stdenv.lib.makeBinPath buildInputs}
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "singularityware";
|
owner = "singularityware";
|
||||||
repo = "singularity";
|
repo = "singularity";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "19g43gfdy5s8y4252474cp39d6ypn5dd37wp0s21fgd13vqy26px";
|
sha256 = "1hi1ag1lb2x4djbz4x34wix83ymx0g9mzn2md6yrpiflc1d85rjz";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
||||||
buildInputs = [ ];
|
buildInputs = [ coreutils gnugrep python e2fsprogs which gnutar squashfsTools gzip gnused curl utillinux ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://singularity.lbl.gov/;
|
homepage = http://singularity.lbl.gov/;
|
||||||
|
|
21
pkgs/applications/virtualization/singularity/env.patch
Normal file
21
pkgs/applications/virtualization/singularity/env.patch
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
diff --git a/libexec/functions b/libexec/functions
|
||||||
|
index bc68107..6c2211c 100644
|
||||||
|
--- a/libexec/functions
|
||||||
|
+++ b/libexec/functions
|
||||||
|
@@ -29,16 +29,6 @@ if [ -z "${SINGULARITY_MESSAGELEVEL:-}" ]; then
|
||||||
|
SINGULARITY_MESSAGELEVEL=5
|
||||||
|
fi
|
||||||
|
|
||||||
|
-if [ -z "${USER:-}" ]; then
|
||||||
|
- USER=`id -un`
|
||||||
|
- export USER
|
||||||
|
-fi
|
||||||
|
-if [ -z "${HOME:-}" ]; then
|
||||||
|
- HOME=`getent passwd "$USER" | cut -d : -f 6`
|
||||||
|
- export HOME
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
-
|
||||||
|
message() {
|
||||||
|
LEVEL="${1:-}"
|
||||||
|
MESSAGE="${2:-}"
|
|
@ -61,6 +61,7 @@ rec {
|
||||||
mkfs -t ext3 -b 4096 /dev/${vmTools.hd}
|
mkfs -t ext3 -b 4096 /dev/${vmTools.hd}
|
||||||
mount /dev/${vmTools.hd} disk
|
mount /dev/${vmTools.hd} disk
|
||||||
cd disk
|
cd disk
|
||||||
|
mkdir proc sys dev
|
||||||
|
|
||||||
# Run root script
|
# Run root script
|
||||||
${stdenv.lib.optionalString (runAsRoot != null) ''
|
${stdenv.lib.optionalString (runAsRoot != null) ''
|
||||||
|
@ -92,8 +93,10 @@ rec {
|
||||||
cd disk
|
cd disk
|
||||||
|
|
||||||
export PATH=$PATH:${e2fsprogs}/bin/
|
export PATH=$PATH:${e2fsprogs}/bin/
|
||||||
singularity create -s $((1 + size * 4 / 1024 + ${toString extraSpace})) $out
|
echo creating
|
||||||
tar -c . | singularity import $out
|
singularity image.create -s $((1 + size * 4 / 1024 + ${toString extraSpace})) $out
|
||||||
|
echo importing
|
||||||
|
tar -c . | singularity image.import $out
|
||||||
'');
|
'');
|
||||||
|
|
||||||
in result;
|
in result;
|
||||||
|
|
Loading…
Reference in a new issue