2021-06-28 23:13:55 +00:00
|
|
|
{ stdenv, lib, fetchurl, autoPatchelfHook, python3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gurobi";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "11.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-oZ7Oz22e4k6cVF3TDFxp/pE+RuU+3p/CatTWj1ci5ZY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "gurobi${builtins.replaceStrings ["."] [""] version}/linux64";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
2021-06-28 23:13:55 +00:00
|
|
|
buildInputs = [ (python3.withPackages (ps: [ ps.gurobipy ])) ];
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
makeFlags = [ "--directory=src/build" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin/
|
|
|
|
rm $out/bin/gurobi.sh
|
2021-06-28 23:13:55 +00:00
|
|
|
rm $out/bin/python*
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cp lib/gurobi.py $out/bin/gurobi.sh
|
|
|
|
|
|
|
|
mkdir -p $out/include
|
|
|
|
cp include/gurobi*.h $out/include/
|
|
|
|
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp lib/*.jar $out/lib/
|
|
|
|
cp lib/libGurobiJni*.so $out/lib/
|
|
|
|
cp lib/libgurobi*.so* $out/lib/
|
|
|
|
cp lib/libgurobi*.a $out/lib/
|
|
|
|
cp src/build/*.a $out/lib/
|
|
|
|
|
|
|
|
mkdir -p $out/share/java
|
|
|
|
ln -s $out/lib/gurobi.jar $out/share/java/
|
|
|
|
ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Optimization solver for mathematical programming";
|
|
|
|
homepage = "https://www.gurobi.com";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ wegank ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|