My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nomicon/pkgs/applications/science/math/sage/sage.nix

33 lines
723 B

{ stdenv
, sage-with-env
, makeWrapper
}:
stdenv.mkDerivation rec {
version = sage-with-env.version;
name = "sage-tests-${version}";
buildInputs = [
makeWrapper
];
unpackPhase = "#do nothing";
configurePhase = "#do nothing";
buildPhase = "#do nothing";
installPhase = ''
mkdir -p "$out/bin"
# Like a symlink, but make sure that $0 points to the original.
makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage"
'';
doInstallCheck = true;
installCheckPhase = ''
export HOME="$TMPDIR/sage-home"
mkdir -p "$HOME"
# "--long" tests are in the order of 1h, without "--long" its 1/2h
"$out/bin/sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage --long --all
'';
}