summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-12-18 12:42:54 -0500
committerShea Levy <shea@shealevy.com>2017-12-18 12:42:54 -0500
commit03e10f8535899841e05120cce7f4979973150e05 (patch)
treea8580429571a9a1ed9ab197108979610192dc910 /pkgs/development/python-modules
parent0875bea675487a9497d63e4a064382e23104d372 (diff)
downloadnixlib-03e10f8535899841e05120cce7f4979973150e05.tar
nixlib-03e10f8535899841e05120cce7f4979973150e05.tar.gz
nixlib-03e10f8535899841e05120cce7f4979973150e05.tar.bz2
nixlib-03e10f8535899841e05120cce7f4979973150e05.tar.lz
nixlib-03e10f8535899841e05120cce7f4979973150e05.tar.xz
nixlib-03e10f8535899841e05120cce7f4979973150e05.tar.zst
nixlib-03e10f8535899841e05120cce7f4979973150e05.zip
gurobipy: Use buildPythonPackage on Linux
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/gurobipy/linux.nix21
1 files changed, 5 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/gurobipy/linux.nix b/pkgs/development/python-modules/gurobipy/linux.nix
index f65ae4a2ed2e..5010415d2c64 100644
--- a/pkgs/development/python-modules/gurobipy/linux.nix
+++ b/pkgs/development/python-modules/gurobipy/linux.nix
@@ -1,30 +1,19 @@
-{ stdenv, fetchurl, python }:
+{ fetchurl, python }:
 assert python.pkgs.isPy27;
 let utf =
   if python.ucsEncoding == 2 then "16"
   else if python.ucsEncoding == 4 then "32"
   else throw "Unsupported python UCS encoding UCS${toString python.ucsEncoding}";
-in stdenv.mkDerivation
+in python.pkgs.buildPythonPackage
   { name = "gurobipy-7.0.2";
     src = fetchurl
       { url = "http://packages.gurobi.com/7.0/gurobi7.0.2_linux64.tar.gz";
         sha256 = "1lgdj4cncjvnnw8dppiax7q2j8121pxyg9iryj8v26mrk778dnmn";
       };
-    buildCommand =
+    setSourceRoot = "sourceRoot=$(echo gurobi*/*64)";
+    postInstall = "mv lib/libaes*.so* lib/libgurobi*.so* $out/lib";
+    postFixup =
       ''
-        # Unpack
-        tar xf $src
-
-        # Install
-        cd gurobi*/linux64
-        mkdir -p $out/lib/python2.7/site-packages
-        mv lib/python2.7_utf${utf}/gurobipy \
-          $out/lib/python2.7/site-packages
-        mv lib/python2.7_utf${utf}/gurobipy.so \
-          $out/lib/python2.7/site-packages/gurobipy
-        mv lib/libaes*.so* lib/libgurobi*.so* $out/lib
-
-        # Fixup
         patchelf --set-rpath $out/lib \
           $out/lib/python2.7/site-packages/gurobipy/gurobipy.so
         patchelf --add-needed libaes70.so \