Skip to content

Commit

Permalink
gurobipy: Bump to 7.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Dec 22, 2017
1 parent 73a0d95 commit 02efc76
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 31 deletions.
14 changes: 7 additions & 7 deletions pkgs/development/python-modules/gurobipy/darwin.nix
@@ -1,10 +1,10 @@
{ fetchurl, python, xar, cpio, cctools, insert_dylib }:
assert python.pkgs.isPy27 && python.ucsEncoding == 2;
python.pkgs.buildPythonPackage
{ name = "gurobipy-7.0.2";
{ name = "gurobipy-7.5.2";
src = fetchurl
{ url = "http://packages.gurobi.com/7.0/gurobi7.0.2_mac64.pkg";
sha256 = "14dpxas6gx02kfb28i0fh68p1z4sbjmwg8hp8h5ch6c701h260mg";
{ url = "http://packages.gurobi.com/7.5/gurobi7.5.2_mac64.pkg";
sha256 = "10zgn8741x48xjdiknj59x66mwj1azhihi1j5a1ajxi2n5fsak2h";
};
buildInputs = [ xar cpio cctools insert_dylib ];
unpackPhase =
Expand All @@ -15,18 +15,18 @@ python.pkgs.buildPythonPackage
sourceRoot=$(echo gurobi*/*64)
runHook postUnpack
'';
patches = [ ./no-darwin-fixup.patch ];
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 libgurobi70.so \
$out/lib/libgurobi70.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/libaes70.so \
insert_dylib --inplace $out/lib/libaes75.so \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
'';
}
9 changes: 5 additions & 4 deletions pkgs/development/python-modules/gurobipy/linux.nix
Expand Up @@ -5,18 +5,19 @@ let utf =
else if python.ucsEncoding == 4 then "32"
else throw "Unsupported python UCS encoding UCS${toString python.ucsEncoding}";
in python.pkgs.buildPythonPackage
{ name = "gurobipy-7.0.2";
{ name = "gurobipy-7.5.2";
src = fetchurl
{ url = "http://packages.gurobi.com/7.0/gurobi7.0.2_linux64.tar.gz";
sha256 = "1lgdj4cncjvnnw8dppiax7q2j8121pxyg9iryj8v26mrk778dnmn";
{ url = "http://packages.gurobi.com/7.5/gurobi7.5.2_linux64.tar.gz";
sha256 = "13i1dl22lnmg7z9mb48zl3hy1qnpwdpr0zl2aizda0qnb7my5rnj";
};
setSourceRoot = "sourceRoot=$(echo gurobi*/*64)";
patches = [ ./no-clever-setup.patch ];
postInstall = "mv lib/libaes*.so* lib/libgurobi*.so* $out/lib";
postFixup =
''
patchelf --set-rpath $out/lib \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
patchelf --add-needed libaes70.so \
patchelf --add-needed libaes75.so \
$out/lib/python2.7/site-packages/gurobipy/gurobipy.so
'';
}
55 changes: 55 additions & 0 deletions pkgs/development/python-modules/gurobipy/no-clever-setup.patch
@@ -0,0 +1,55 @@
diff -Naur a/setup.py b/setup.py
--- a/setup.py 2017-12-22 10:52:43.730264611 -0500
+++ b/setup.py 2017-12-22 10:53:27.660104199 -0500
@@ -15,30 +15,6 @@
from distutils.command.install import install
import os,sys,shutil

-class GurobiClean(Command):
- description = "remove the build directory"
- user_options = []
- def initialize_options(self):
- self.cwd = None
- def finalize_options(self):
- self.cwd = os.path.dirname(os.path.realpath(__file__))
- def run(self):
- assert os.getcwd() == self.cwd, 'Must be run from setup.py directory: %s' % self.cwd
- build_dir = os.path.join(os.getcwd(), "build")
- if os.path.exists(build_dir):
- print('removing %s' % build_dir)
- shutil.rmtree(build_dir)
-
-class GurobiInstall(install):
-
- # Calls the default run command, then deletes the build area
- # (equivalent to "setup clean --all").
- def run(self):
- install.run(self)
- c = GurobiClean(self.distribution)
- c.finalize_options()
- c.run()
-
License = """
This software is covered by the Gurobi End User License Agreement.
By completing the Gurobi installation process and using the software,
@@ -79,20 +55,4 @@
packages = ['gurobipy'],
package_dir={'gurobipy' : srcpath },
package_data = {'gurobipy' : [srcfile] },
- cmdclass={'install' : GurobiInstall,
- 'clean' : GurobiClean }
)
-
-if os.name == 'posix' and sys.platform == 'darwin': # update Mac paths
- verstr = sys.version[:3]
- default = '/Library/Frameworks/Python.framework/Versions/%s/Python' % verstr
- default = '/System'+default if verstr == '2.7' else default
- modified = sys.prefix + '/Python'
- if default != modified:
- import subprocess
- from distutils.sysconfig import get_python_lib
- sitelib = get_python_lib() + '/gurobipy/gurobipy.so'
- if not os.path.isfile(modified): # Anaconda
- libver = verstr if verstr == '2.7' else verstr+'m'
- modified = sys.prefix + '/lib/libpython%s.dylib' % libver # For Anaconda
- subprocess.call(('install_name_tool', '-change', default, modified, sitelib))
20 changes: 0 additions & 20 deletions pkgs/development/python-modules/gurobipy/no-darwin-fixup.patch

This file was deleted.

0 comments on commit 02efc76

Please sign in to comment.