mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
autoreconfHook,
|
|
glpk,
|
|
gmp,
|
|
which,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "4ti2";
|
|
version = "1.6.15";
|
|
|
|
__structuredAttrs = true;
|
|
strictDeps = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "4ti2";
|
|
repo = "4ti2";
|
|
tag = "Release_${builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version}";
|
|
hash = "sha256-6X8zNp68KlKxplg1rdcotmXyIZE27POJs9/3n2BZLZE=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/{groebner/script.template.in,zsolve/{graver,hilbert}.template} \
|
|
--replace-fail 'SCRIPT=$(realpath $(which "$0"))' \
|
|
'SCRIPT=$(realpath $(${lib.getExe which} "$0"))'
|
|
''
|
|
+ lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
# configure.ac tries to compile and execute a specific test file here
|
|
substituteInPlace configure.ac \
|
|
--replace-fail "CHECK_TRAPV" ""
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
autoreconfHook
|
|
];
|
|
|
|
buildInputs = [
|
|
glpk
|
|
gmp
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
|
enableParallelInstalling = false;
|
|
|
|
installFlags = [ "install-exec" ];
|
|
|
|
meta = {
|
|
homepage = "https://4ti2.github.io/";
|
|
description = "Software package for algebraic, geometric and combinatorial problems on linear spaces";
|
|
license = lib.licenses.gpl2Plus;
|
|
maintainers = with lib.maintainers; [ coolcuber ];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
})
|