gurobi: 11.0.3 -> 12.0.0

This commit is contained in:
Weijia Wang 2024-11-20 00:15:07 +01:00
parent 54b5b8b06b
commit 41cbe1fe27

View File

@ -6,16 +6,29 @@
python3, python3,
}: }:
let
platform =
{
aarch64-linux = "armlinux64";
x86_64-linux = "linux64";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gurobi"; pname = "gurobi";
version = "11.0.3"; version = "12.0.0";
src = fetchurl { src = fetchurl {
url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_linux64.tar.gz"; url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_${platform}.tar.gz";
hash = "sha256-gqLIZxwjS7qp3GTaIrGVGr9BxiBH/fdwBOZfJKkd/RM="; hash =
{
aarch64-linux = "sha256-jhICy/CGahb6eMPkvg+jKIjskS+N3zM8KVYdBXlk74Y=";
x86_64-linux = "sha256-or3Jwda/jrTlUaGErxzo17BDXqjn0ZoBfMfVP9Xv2hI=";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
}; };
sourceRoot = "gurobi${builtins.replaceStrings [ "." ] [ "" ] version}/linux64"; sourceRoot = "gurobi${builtins.replaceStrings [ "." ] [ "" ] version}/${platform}";
nativeBuildInputs = [ nativeBuildInputs = [
autoPatchelfHook autoPatchelfHook
@ -32,6 +45,8 @@ stdenv.mkDerivation rec {
makeFlags = [ "--directory=src/build" ]; makeFlags = [ "--directory=src/build" ];
installPhase = '' installPhase = ''
runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
cp bin/* $out/bin/ cp bin/* $out/bin/
rm $out/bin/gurobi.sh rm $out/bin/gurobi.sh
@ -52,19 +67,24 @@ stdenv.mkDerivation rec {
mkdir -p $out/share/java mkdir -p $out/share/java
ln -s $out/lib/gurobi.jar $out/share/java/ ln -s $out/lib/gurobi.jar $out/share/java/
ln -s $out/lib/gurobi-javadoc.jar $out/share/java/ ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
runHook postInstall
''; '';
passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version); passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version);
meta = with lib; { meta = {
description = "Optimization solver for mathematical programming"; description = "Optimization solver for mathematical programming";
homepage = "https://www.gurobi.com"; homepage = "https://www.gurobi.com";
sourceProvenance = with sourceTypes; [ sourceProvenance = with lib.sourceTypes; [
binaryBytecode binaryBytecode
binaryNativeCode binaryNativeCode
]; ];
license = licenses.unfree; license = lib.licenses.unfree;
platforms = [ "x86_64-linux" ]; platforms = [
maintainers = with maintainers; [ wegank ]; "aarch64-linux"
"x86_64-linux"
];
maintainers = with lib.maintainers; [ wegank ];
}; };
} }