mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
singularity: 3.2.1 -> 3.6.1
This commit is contained in:
parent
dc1c3f3203
commit
712f1ee9aa
@ -1,13 +1,16 @@
|
|||||||
{stdenv
|
{stdenv
|
||||||
, removeReferencesTo
|
, removeReferencesTo
|
||||||
, lib
|
, lib
|
||||||
, fetchFromGitHub
|
, fetchurl
|
||||||
, utillinux
|
, utillinux
|
||||||
|
, gpgme
|
||||||
, openssl
|
, openssl
|
||||||
|
, libuuid
|
||||||
, coreutils
|
, coreutils
|
||||||
, go
|
, go
|
||||||
, which
|
, which
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, cryptsetup
|
||||||
, squashfsTools
|
, squashfsTools
|
||||||
, buildGoPackage}:
|
, buildGoPackage}:
|
||||||
|
|
||||||
@ -15,24 +18,22 @@ with lib;
|
|||||||
|
|
||||||
buildGoPackage rec {
|
buildGoPackage rec {
|
||||||
pname = "singularity";
|
pname = "singularity";
|
||||||
version = "3.2.1";
|
version = "3.6.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchurl {
|
||||||
owner = "sylabs";
|
url = "https://github.com/hpcng/singularity/releases/download/v${version}/singularity-${version}.tar.gz";
|
||||||
repo = "singularity";
|
sha256 = "070jj6kbiw23sd2p4xhvmyb8gd83imwgisdf18ahkwp7dq85db3c";
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "14lhxwy21s7q081x7kbnvkjsbxgsg2f181qlzmlxcn6n7gfav3kj";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
goPackagePath = "github.com/sylabs/singularity";
|
goPackagePath = "github.com/sylabs/singularity";
|
||||||
goDeps = ./deps.nix;
|
goDeps = ./deps.nix;
|
||||||
|
|
||||||
buildInputs = [ openssl utillinux ];
|
buildInputs = [ gpgme openssl libuuid ];
|
||||||
nativeBuildInputs = [ removeReferencesTo which makeWrapper ];
|
nativeBuildInputs = [ removeReferencesTo utillinux which makeWrapper cryptsetup ];
|
||||||
propagatedBuildInputs = [ coreutils squashfsTools ];
|
propagatedBuildInputs = [ coreutils squashfsTools ];
|
||||||
|
|
||||||
prePatch = ''
|
postPatch = ''
|
||||||
substituteInPlace internal/pkg/build/copy/copy.go \
|
substituteInPlace internal/pkg/build/files/copy.go \
|
||||||
--replace /bin/cp ${coreutils}/bin/cp
|
--replace /bin/cp ${coreutils}/bin/cp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -46,24 +47,28 @@ buildGoPackage rec {
|
|||||||
|
|
||||||
# Don't install SUID binaries
|
# Don't install SUID binaries
|
||||||
sed -i 's/-m 4755/-m 755/g' builddir/Makefile
|
sed -i 's/-m 4755/-m 755/g' builddir/Makefile
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
make -C builddir
|
make -C builddir
|
||||||
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
make -C builddir install LOCALSTATEDIR=$out/var
|
make -C builddir install LOCALSTATEDIR=$out/var
|
||||||
chmod 755 $out/libexec/singularity/bin/starter-suid
|
chmod 755 $out/libexec/singularity/bin/starter-suid
|
||||||
wrapProgram $out/bin/singularity --prefix PATH : ${stdenv.lib.makeBinPath propagatedBuildInputs}
|
|
||||||
|
# Explicitly configure paths in the config file
|
||||||
|
sed -i 's|^# mksquashfs path =.*$|mksquashfs path = ${stdenv.lib.makeBinPath [squashfsTools]}/mksquashfs|' $out/etc/singularity/singularity.conf
|
||||||
|
sed -i 's|^# cryptsetup path =.*$|cryptsetup path = ${stdenv.lib.makeBinPath [cryptsetup]}/cryptsetup|' $out/etc/singularity/singularity.conf
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
find $out/libexec/ -type f -executable -exec remove-references-to -t ${go} '{}' + || true
|
find $out/libexec/ -type f -executable -exec remove-references-to -t ${go} '{}' + || true
|
||||||
|
|
||||||
# These etc scripts shouldn't have their paths patched
|
|
||||||
cp etc/actions/* $out/etc/singularity/actions/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -97,6 +97,7 @@ rec {
|
|||||||
cd ..
|
cd ..
|
||||||
mkdir -p /var/singularity/mnt/{container,final,overlay,session,source}
|
mkdir -p /var/singularity/mnt/{container,final,overlay,session,source}
|
||||||
echo "root:x:0:0:System administrator:/root:/bin/sh" > /etc/passwd
|
echo "root:x:0:0:System administrator:/root:/bin/sh" > /etc/passwd
|
||||||
|
echo > /etc/resolv.conf
|
||||||
TMPDIR=$(pwd -P) singularity build $out ./img
|
TMPDIR=$(pwd -P) singularity build $out ./img
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user