nixpkgs/pkgs/by-name/sc/scalp/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.4 KiB
Nix
Raw Normal View History

2024-11-12 16:53:11 +00:00
{
lib,
stdenv,
fetchgit,
cmake,
withGurobi ? false,
gurobi,
withCplex ? false,
cplex,
withLpsolve ? true,
lp_solve,
2022-07-31 11:28:19 +00:00
}:
stdenv.mkDerivation rec {
pname = "scalp";
version = "unstable-2022-03-15";
src = fetchgit {
url = "https://digidev.digi.e-technik.uni-kassel.de/git/scalp.git";
2023-04-03 11:16:03 +00:00
# mirrored at https://git.sr.ht/~weijia/scalp
2022-07-31 11:28:19 +00:00
rev = "185b84e4ff967f42cf2de5db4db4e6fa0cc18fb8";
hash = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg=";
2022-07-31 11:28:19 +00:00
};
nativeBuildInputs = [
cmake
];
2024-11-12 16:53:11 +00:00
buildInputs =
lib.optionals withGurobi [
gurobi
]
++ lib.optionals withCplex [
cplex
]
++ lib.optionals withLpsolve [
lp_solve
];
2022-07-31 11:28:19 +00:00
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace CMakeLists.txt \
--replace "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib"
'';
2024-11-12 16:53:11 +00:00
cmakeFlags =
[
"-DBUILD_TESTS=${lib.boolToString doCheck}"
]
++ lib.optionals withGurobi [
"-DGUROBI_DIR=${gurobi}"
]
++ lib.optionals withCplex [
"-DCPLEX_DIR=${cplex}"
];
2022-07-31 11:28:19 +00:00
doCheck = true;
meta = with lib; {
description = "Scalable Linear Programming Library";
mainProgram = "scalp";
2022-07-31 11:28:19 +00:00
homepage = "https://digidev.digi.e-technik.uni-kassel.de/scalp/";
license = licenses.lgpl3;
platforms = platforms.unix;
maintainers = with maintainers; [ wegank ];
};
}