mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
singularity: 3.2.1 -> 3.6.1
This commit is contained in:
parent
dc1c3f3203
commit
712f1ee9aa
@ -1,13 +1,16 @@
|
||||
{stdenv
|
||||
, removeReferencesTo
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, fetchurl
|
||||
, utillinux
|
||||
, gpgme
|
||||
, openssl
|
||||
, libuuid
|
||||
, coreutils
|
||||
, go
|
||||
, which
|
||||
, makeWrapper
|
||||
, cryptsetup
|
||||
, squashfsTools
|
||||
, buildGoPackage}:
|
||||
|
||||
@ -15,24 +18,22 @@ with lib;
|
||||
|
||||
buildGoPackage rec {
|
||||
pname = "singularity";
|
||||
version = "3.2.1";
|
||||
version = "3.6.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sylabs";
|
||||
repo = "singularity";
|
||||
rev = "v${version}";
|
||||
sha256 = "14lhxwy21s7q081x7kbnvkjsbxgsg2f181qlzmlxcn6n7gfav3kj";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/hpcng/singularity/releases/download/v${version}/singularity-${version}.tar.gz";
|
||||
sha256 = "070jj6kbiw23sd2p4xhvmyb8gd83imwgisdf18ahkwp7dq85db3c";
|
||||
};
|
||||
|
||||
goPackagePath = "github.com/sylabs/singularity";
|
||||
goDeps = ./deps.nix;
|
||||
|
||||
buildInputs = [ openssl utillinux ];
|
||||
nativeBuildInputs = [ removeReferencesTo which makeWrapper ];
|
||||
buildInputs = [ gpgme openssl libuuid ];
|
||||
nativeBuildInputs = [ removeReferencesTo utillinux which makeWrapper cryptsetup ];
|
||||
propagatedBuildInputs = [ coreutils squashfsTools ];
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace internal/pkg/build/copy/copy.go \
|
||||
postPatch = ''
|
||||
substituteInPlace internal/pkg/build/files/copy.go \
|
||||
--replace /bin/cp ${coreutils}/bin/cp
|
||||
'';
|
||||
|
||||
@ -46,24 +47,28 @@ buildGoPackage rec {
|
||||
|
||||
# Don't install SUID binaries
|
||||
sed -i 's/-m 4755/-m 755/g' builddir/Makefile
|
||||
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
make -C builddir
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
make -C builddir install LOCALSTATEDIR=$out/var
|
||||
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 = ''
|
||||
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; {
|
||||
|
@ -97,6 +97,7 @@ rec {
|
||||
cd ..
|
||||
mkdir -p /var/singularity/mnt/{container,final,overlay,session,source}
|
||||
echo "root:x:0:0:System administrator:/root:/bin/sh" > /etc/passwd
|
||||
echo > /etc/resolv.conf
|
||||
TMPDIR=$(pwd -P) singularity build $out ./img
|
||||
'');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user