3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/math/gurobi/default.nix

54 lines
1.4 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, autoPatchelfHook, python3 }:
2018-07-14 22:50:24 +01:00
stdenv.mkDerivation rec {
pname = "gurobi";
2021-12-10 15:29:40 +00:00
version = "9.5.0";
2018-07-14 22:50:24 +01:00
src = fetchurl {
url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
2021-12-10 15:29:40 +00:00
sha256 = "sha256-u1QuWl0WhfbjZOrwXqbFVySF/8N6IkUWnPPLQCiLwp4=";
2018-07-14 22:50:24 +01:00
};
sourceRoot = "gurobi${builtins.replaceStrings ["."] [""] version}/linux64";
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ (python3.withPackages (ps: [ ps.gurobipy ])) ];
2021-03-25 15:05:57 +00:00
strictDeps = true;
2018-07-14 22:50:24 +01:00
makeFlags = [ "--directory=src/build" ];
2018-07-14 22:50:24 +01:00
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin/
rm $out/bin/gurobi.sh
rm $out/bin/python*
2018-07-14 22:50:24 +01:00
cp lib/gurobi.py $out/bin/gurobi.sh
mkdir -p $out/include
cp include/gurobi*.h $out/include/
mkdir -p $out/lib
2018-11-14 18:38:18 +00:00
cp lib/*.jar $out/lib/
cp lib/libGurobiJni*.so $out/lib/
2018-07-14 22:50:24 +01:00
cp lib/libgurobi*.so* $out/lib/
cp lib/libgurobi*.a $out/lib/
cp src/build/*.a $out/lib/
2018-11-14 18:38:18 +00:00
mkdir -p $out/share/java
ln -s $out/lib/gurobi.jar $out/share/java/
ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
2018-07-14 22:50:24 +01:00
'';
passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version);
2019-06-22 00:20:28 +01:00
meta = with lib; {
2018-07-14 22:50:24 +01:00
description = "Optimization solver for mathematical programming";
homepage = "https://www.gurobi.com";
2018-07-14 22:50:24 +01:00
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ jfrankenau ];
};
}