diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index b28df2501aac..9352bb4d52e0 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -201,7 +201,7 @@ in stdenv.mkDerivation { passthru = let pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { - inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch; + inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch ucsEncoding; executable = libPrefix; buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; }; withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;}; diff --git a/pkgs/development/python-modules/gurobipy/darwin.nix b/pkgs/development/python-modules/gurobipy/darwin.nix new file mode 100644 index 000000000000..95a59bf44c7c --- /dev/null +++ b/pkgs/development/python-modules/gurobipy/darwin.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, python, xar, cpio, cctools, insert_dylib }: +assert python.isPy27 && python.ucsEncoding == 2; +stdenv.mkDerivation + { name = "gurobipy-7.0.2"; + src = fetchurl + { url = "http://packages.gurobi.com/7.0/gurobi7.0.2_mac64.pkg"; + sha256 = "14dpxas6gx02kfb28i0fh68p1z4sbjmwg8hp8h5ch6c701h260mg"; + }; + buildInputs = [ xar cpio cctools insert_dylib ]; + buildCommand = + '' + # Unpack + xar -xf $src + zcat gurobi*mac64tar.pkg/Payload | cpio -i + tar xf gurobi*_mac64.tar.gz + + # Install + cd gurobi*/mac64 + mkdir -p $out/lib/python2.7/site-packages + mv lib/python2.7/gurobipy $out/lib/python2.7/site-packages + mv lib/lib*.so $out/lib + + # Fixup + 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 \ + $out/lib/python2.7/site-packages/gurobipy/gurobipy.so + insert_dylib --inplace $out/lib/libaes70.so \ + $out/lib/python2.7/site-packages/gurobipy/gurobipy.so + ''; + } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d677520468ce..490e8a581224 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5630,6 +5630,12 @@ in { }; }; + gurobipy = if stdenv.system == "x86_64-darwin" + then callPackage ../development/python-modules/gurobipy/darwin.nix + { inherit (pkgs.darwin) cctools insert_dylib; + } + else throw "gurobipy not yet supported on ${stdenv.system}"; + helper = buildPythonPackage rec { pname = "helper"; version = "2.4.1";