Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 19.03 2.2 kB view raw
1diff -Naur a/setup.py b/setup.py 2--- a/setup.py 2017-12-22 10:52:43.730264611 -0500 3+++ b/setup.py 2017-12-22 10:53:27.660104199 -0500 4@@ -15,30 +15,6 @@ 5 from distutils.command.install import install 6 import os,sys,shutil 7 8-class GurobiClean(Command): 9- description = "remove the build directory" 10- user_options = [] 11- def initialize_options(self): 12- self.cwd = None 13- def finalize_options(self): 14- self.cwd = os.path.dirname(os.path.realpath(__file__)) 15- def run(self): 16- assert os.getcwd() == self.cwd, 'Must be run from setup.py directory: %s' % self.cwd 17- build_dir = os.path.join(os.getcwd(), "build") 18- if os.path.exists(build_dir): 19- print('removing %s' % build_dir) 20- shutil.rmtree(build_dir) 21- 22-class GurobiInstall(install): 23- 24- # Calls the default run command, then deletes the build area 25- # (equivalent to "setup clean --all"). 26- def run(self): 27- install.run(self) 28- c = GurobiClean(self.distribution) 29- c.finalize_options() 30- c.run() 31- 32 License = """ 33 This software is covered by the Gurobi End User License Agreement. 34 By completing the Gurobi installation process and using the software, 35@@ -79,20 +55,4 @@ 36 packages = ['gurobipy'], 37 package_dir={'gurobipy' : srcpath }, 38 package_data = {'gurobipy' : [srcfile] }, 39- cmdclass={'install' : GurobiInstall, 40- 'clean' : GurobiClean } 41 ) 42- 43-if os.name == 'posix' and sys.platform == 'darwin': # update Mac paths 44- verstr = sys.version[:3] 45- default = '/Library/Frameworks/Python.framework/Versions/%s/Python' % verstr 46- default = '/System'+default if verstr == '2.7' else default 47- modified = sys.prefix + '/Python' 48- if default != modified: 49- import subprocess 50- from distutils.sysconfig import get_python_lib 51- sitelib = get_python_lib() + '/gurobipy/gurobipy.so' 52- if not os.path.isfile(modified): # Anaconda 53- libver = verstr if verstr == '2.7' else verstr+'m' 54- modified = sys.prefix + '/lib/libpython%s.dylib' % libver # For Anaconda 55- subprocess.call(('install_name_tool', '-change', default, modified, sitelib))