Merge pull request #297437 from wegank/gurobipy-darwin-bump
python312Packages.gurobipy: 7.5.2 -> 11.0.1 (darwin)
This commit is contained in:
commit
2bb3dc3add
@ -1,33 +1,49 @@
|
|||||||
{ fetchurl, python, xar, cpio, cctools, insert_dylib }:
|
{
|
||||||
assert python.pkgs.isPy27 && python.ucsEncoding == 2;
|
lib,
|
||||||
python.pkgs.buildPythonPackage
|
stdenv,
|
||||||
{ pname = "gurobipy";
|
buildPythonPackage,
|
||||||
version = "7.5.2";
|
python,
|
||||||
src = fetchurl
|
fetchPypi,
|
||||||
{ url = "http://packages.gurobi.com/7.5/gurobi7.5.2_mac64.pkg";
|
}:
|
||||||
sha256 = "10zgn8741x48xjdiknj59x66mwj1azhihi1j5a1ajxi2n5fsak2h";
|
|
||||||
};
|
let
|
||||||
buildInputs = [ xar cpio cctools insert_dylib ];
|
format = "wheel";
|
||||||
unpackPhase =
|
pyShortVersion = "cp" + builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
|
||||||
''
|
platforms = rec {
|
||||||
xar -xf $src
|
aarch64-darwin = "macosx_10_9_universal2";
|
||||||
zcat gurobi*mac64tar.pkg/Payload | cpio -i
|
x86_64-darwin = aarch64-darwin;
|
||||||
tar xf gurobi*_mac64.tar.gz
|
};
|
||||||
sourceRoot=$(echo gurobi*/*64)
|
platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
|
||||||
runHook postUnpack
|
hashes = rec {
|
||||||
'';
|
cp311-aarch64-darwin = "sha256-pMwq4TXvr0mrKxZppeW2MQE/KrplWWFGmjKRLKwbHCI=";
|
||||||
patches = [ ./no-clever-setup.patch ];
|
cp311-x86_64-darwin = cp311-aarch64-darwin;
|
||||||
postInstall = "mv lib/lib*.so $out/lib";
|
cp312-aarch64-darwin = "sha256-5+1QxYOhjbs01S3gqhkQ9Bx/0/NhbXEi710BGpiC5kM=";
|
||||||
postFixup =
|
cp312-x86_64-darwin = cp312-aarch64-darwin;
|
||||||
''
|
};
|
||||||
install_name_tool -change \
|
hash =
|
||||||
/System/Library/Frameworks/Python.framework/Versions/2.7/Python \
|
hashes."${pyShortVersion}-${stdenv.system}"
|
||||||
${python}/lib/libpython2.7.dylib \
|
or (throw "Unsupported Python version: ${python.pythonVersion}");
|
||||||
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
|
in
|
||||||
install_name_tool -change /Library/gurobi752/mac64/lib/libgurobi75.so \
|
buildPythonPackage rec {
|
||||||
$out/lib/libgurobi75.so \
|
pname = "gurobipy";
|
||||||
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
|
version = "11.0.1";
|
||||||
insert_dylib --inplace $out/lib/libaes75.so \
|
inherit format;
|
||||||
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
|
|
||||||
'';
|
src = fetchPypi {
|
||||||
}
|
inherit pname version;
|
||||||
|
python = pyShortVersion;
|
||||||
|
abi = pyShortVersion;
|
||||||
|
dist = pyShortVersion;
|
||||||
|
inherit format platform hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "gurobipy" ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Python interface to Gurobi";
|
||||||
|
homepage = "https://www.gurobi.com";
|
||||||
|
license = lib.licenses.unfree;
|
||||||
|
maintainers = with lib.maintainers; [ wegank ];
|
||||||
|
platforms = builtins.attrNames platforms;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
@ -5118,10 +5118,8 @@ self: super: with self; {
|
|||||||
|
|
||||||
guppy3 = callPackage ../development/python-modules/guppy3 { };
|
guppy3 = callPackage ../development/python-modules/guppy3 { };
|
||||||
|
|
||||||
gurobipy = if stdenv.hostPlatform.system == "x86_64-darwin" then
|
gurobipy = if stdenv.hostPlatform.isDarwin then
|
||||||
callPackage ../development/python-modules/gurobipy/darwin.nix {
|
callPackage ../development/python-modules/gurobipy/darwin.nix { }
|
||||||
inherit (pkgs.darwin) cctools insert_dylib;
|
|
||||||
}
|
|
||||||
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||||
callPackage ../development/python-modules/gurobipy/linux.nix { }
|
callPackage ../development/python-modules/gurobipy/linux.nix { }
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user