2017-12-18 18:07:41 +00:00
|
|
|
{ fetchurl, python, xar, cpio, cctools, insert_dylib }:
|
2017-12-09 22:41:18 +00:00
|
|
|
assert python.pkgs.isPy27 && python.ucsEncoding == 2;
|
2017-12-18 18:07:41 +00:00
|
|
|
python.pkgs.buildPythonPackage
|
2018-06-23 14:27:58 +01:00
|
|
|
{ pname = "gurobipy";
|
|
|
|
version = "7.5.2";
|
2017-12-09 20:00:43 +00:00
|
|
|
src = fetchurl
|
2017-12-22 16:43:09 +00:00
|
|
|
{ url = "http://packages.gurobi.com/7.5/gurobi7.5.2_mac64.pkg";
|
|
|
|
sha256 = "10zgn8741x48xjdiknj59x66mwj1azhihi1j5a1ajxi2n5fsak2h";
|
2017-12-09 20:00:43 +00:00
|
|
|
};
|
|
|
|
buildInputs = [ xar cpio cctools insert_dylib ];
|
2017-12-18 18:07:41 +00:00
|
|
|
unpackPhase =
|
2017-12-09 20:00:43 +00:00
|
|
|
''
|
|
|
|
xar -xf $src
|
|
|
|
zcat gurobi*mac64tar.pkg/Payload | cpio -i
|
|
|
|
tar xf gurobi*_mac64.tar.gz
|
2017-12-18 18:07:41 +00:00
|
|
|
sourceRoot=$(echo gurobi*/*64)
|
|
|
|
runHook postUnpack
|
|
|
|
'';
|
2017-12-22 16:43:09 +00:00
|
|
|
patches = [ ./no-clever-setup.patch ];
|
2017-12-18 18:07:41 +00:00
|
|
|
postInstall = "mv lib/lib*.so $out/lib";
|
|
|
|
postFixup =
|
|
|
|
''
|
2017-12-09 20:00:43 +00:00
|
|
|
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
|
2017-12-22 16:43:09 +00:00
|
|
|
install_name_tool -change /Library/gurobi752/mac64/lib/libgurobi75.so \
|
|
|
|
$out/lib/libgurobi75.so \
|
2017-12-09 20:00:43 +00:00
|
|
|
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
|
2017-12-22 16:43:09 +00:00
|
|
|
insert_dylib --inplace $out/lib/libaes75.so \
|
2017-12-09 20:00:43 +00:00
|
|
|
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
|
|
|
|
'';
|
|
|
|
}
|