python312Packages.gurobipy: 11.0.3 -> 12.0.0 (#357427)

This commit is contained in:
Weijia Wang 2024-11-24 12:07:30 +01:00 committed by GitHub
commit b013efdaa8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 52 additions and 19 deletions

View File

@ -1,24 +1,52 @@
{ stdenv, lib, fetchurl, autoPatchelfHook, python3 }: {
stdenv,
lib,
fetchurl,
autoPatchelfHook,
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 = [ autoPatchelfHook ]; nativeBuildInputs = [
buildInputs = [ (python3.withPackages (ps: [ ps.gurobipy ])) ]; autoPatchelfHook
];
buildInputs = [
(python3.withPackages (ps: [
ps.gurobipy
]))
];
strictDeps = true; strictDeps = true;
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
@ -39,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 ];
}; };
} }

View File

@ -17,14 +17,14 @@ let
}; };
platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
hashes = rec { hashes = rec {
cp311-aarch64-darwin = "sha256-E4tL6PtC1JS4SEvUz6meoeUR6IYM2xFxNJ9PzgbZqgE="; cp311-aarch64-darwin = "sha256-KRC3fY7KUVCfI4u+TQQjgqLLIEunkzgIZxiuTol2/50=";
cp311-aarch64-linux = "sha256-hMWOFkyQ/B3ovAqsitJagrSp0webUGRzWCLOz1UrGyY="; cp311-aarch64-linux = "sha256-/DiS49iND4oB2nXxL3QCPTmO9Zmp4a3WbtdjE3M+MPs=";
cp311-x86_64-darwin = cp311-aarch64-darwin; cp311-x86_64-darwin = cp311-aarch64-darwin;
cp311-x86_64-linux = "sha256-2O7Vykgx0fELCM1wH3VIOyeBBzR1DUFKWzy25LpMF/M="; cp311-x86_64-linux = "sha256-oI+0Kl58sCzbmTwTgci4xaO67tyt1W5yiNhFile4FEI=";
cp312-aarch64-darwin = "sha256-BXAJeUaVEa7fy00BNsFhB30IU5O2pEnJjp/3gYdHJ5w="; cp312-aarch64-darwin = "sha256-tcNcuYGmFScBaFUyTgVMrkc0lnhdtX8Ggr1W1YSpbu4=";
cp312-aarch64-linux = "sha256-t1KopNiYo8xZsGcKpEne6OIVnU9CDzADO6+W8Uo2UW0="; cp312-aarch64-linux = "sha256-+Ch951NcO5yX9KqHFpadcDAqlyvQnp07b71yZsoOq3I=";
cp312-x86_64-darwin = cp312-aarch64-darwin; cp312-x86_64-darwin = cp312-aarch64-darwin;
cp312-x86_64-linux = "sha256-0IppqYhLLHq4Q8mWe0R3DBfHOsVybbeoeUroXXwfxEY="; cp312-x86_64-linux = "sha256-kLukle+yXP9aOCYViv974pY30ugKzMOompjLhjCFYQY=";
}; };
hash = hash =
hashes."${pyShortVersion}-${stdenv.system}" hashes."${pyShortVersion}-${stdenv.system}"
@ -32,7 +32,7 @@ let
in in
buildPythonPackage rec { buildPythonPackage rec {
pname = "gurobipy"; pname = "gurobipy";
version = "11.0.3"; version = "12.0.0";
inherit format; inherit format;
src = fetchPypi { src = fetchPypi {