1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 20:12:52 +00:00
nixpkgs/pkgs/development/python-modules/gurobipy/darwin.nix
Frederik Rietdijk ced21f5e1a pythonPackages: remove name attribute`
The `buildPython*` function computes name from `pname` and `version`.
This change removes `name` attribute from all expressions in
`pkgs/development/python-modules`.

While at it, some other minor changes were made as well, such as
replacing `fetchurl` calls with `fetchPypi`.
2018-06-23 18:14:26 +02:00

34 lines
1.2 KiB
Nix

{ fetchurl, python, xar, cpio, cctools, insert_dylib }:
assert python.pkgs.isPy27 && python.ucsEncoding == 2;
python.pkgs.buildPythonPackage
{ pname = "gurobipy";
version = "7.5.2";
src = fetchurl
{ url = "http://packages.gurobi.com/7.5/gurobi7.5.2_mac64.pkg";
sha256 = "10zgn8741x48xjdiknj59x66mwj1azhihi1j5a1ajxi2n5fsak2h";
};
buildInputs = [ xar cpio cctools insert_dylib ];
unpackPhase =
''
xar -xf $src
zcat gurobi*mac64tar.pkg/Payload | cpio -i
tar xf gurobi*_mac64.tar.gz
sourceRoot=$(echo gurobi*/*64)
runHook postUnpack
'';
patches = [ ./no-clever-setup.patch ];
postInstall = "mv lib/lib*.so $out/lib";
postFixup =
''
install_name_tool -change \
/System/Library/Frameworks/Python.framework/Versions/2.7/Python \
${python}/lib/libpython2.7.dylib \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
install_name_tool -change /Library/gurobi752/mac64/lib/libgurobi75.so \
$out/lib/libgurobi75.so \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
insert_dylib --inplace $out/lib/libaes75.so \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
'';
}