2021-04-05 15:23:46 +00:00
|
|
|
{ stdenv, lib, fetchurl, autoPatchelfHook, python2 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
majorVersion = "8.1";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "gurobi";
|
|
|
|
version = "${majorVersion}.0";
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
src = with lib; fetchurl {
|
2020-04-24 23:36:52 +00:00
|
|
|
url = "http://packages.gurobi.com/${versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
|
|
|
|
sha256 = "1yjqbzqnq4jjkjm616d36bgd3rmqr0a1ii17n0prpdjzmdlq63dz";
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "gurobi${builtins.replaceStrings ["."] [""] version}/linux64";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
2021-04-05 15:23:46 +00:00
|
|
|
buildInputs = [ (python2.withPackages (ps: [ ps.gurobipy ])) ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
cd src/build
|
|
|
|
make
|
|
|
|
cd ../..
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin/
|
|
|
|
rm $out/bin/gurobi.env
|
|
|
|
rm $out/bin/gurobi.sh
|
|
|
|
rm $out/bin/python2.7
|
|
|
|
|
|
|
|
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/
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.libSuffix = lib.replaceStrings ["."] [""] majorVersion;
|
|
|
|
|
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";
|
|
|
|
license = licenses.unfree;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ jfrankenau ];
|
|
|
|
};
|
|
|
|
}
|