summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-22 20:21:32 +0200
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-07-23 03:12:23 +0200
commit72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb (patch)
tree44f782519d45ef87a783edef34f9e8f5a872b72e
parent3e79e3a264da7f1617259fe7675c588b0fc50487 (diff)
downloadnixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar.gz
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar.bz2
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar.lz
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar.xz
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.tar.zst
nixpkgs-72f6a797fa1bb97a8af6a03c6a31a911f5e27bcb.zip
hplip: fix (Python) tools again
Something changed in the generic fixupPhase magic exposing a bug
in the previous fix (wrapPythonPrograms where I should have used
wrapPythonProgramsIn).

Also move buildInputs and friends to a more conventional spot.
-rw-r--r--pkgs/misc/drivers/hplip/default.nix79
1 files changed, 40 insertions, 39 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index ba64b729393..c069f6bbb9f 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -39,6 +39,28 @@ in
 stdenv.mkDerivation {
   inherit name src;
 
+  buildInputs = [
+    libjpeg
+    cups
+    libusb1
+    pythonPackages.python
+    pythonPackages.wrapPython
+    saneBackends
+    dbus
+    net_snmp
+  ] ++ stdenv.lib.optional qtSupport qt4;
+  nativeBuildInputs = [
+    pkgconfig
+  ];
+
+  pythonPath = with pythonPackages; [
+    dbus
+    pillow
+    pygobject
+    recursivePthLoader
+    reportlab
+  ] ++ stdenv.lib.optional qtSupport pyqt4;
+
   prePatch = ''
     # HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
     find . -type f -exec sed -i \
@@ -73,24 +95,7 @@ stdenv.mkDerivation {
   '';
 
   postInstall =
-    ''
-      # Wrap the user-facing Python scripts in /bin without turning the ones
-      # in /share into shell scripts (they need to be importable).
-      # Complicated by the fact that /bin contains just symlinks to /share.
-      for bin in $out/bin/*; do
-        py=`readlink -m $bin`
-        rm $bin
-        cp $py $bin
-        wrapPythonProgramsIn $bin "$out $pythonPath"
-        sed -i "s@$(dirname $bin)/[^ ]*@$py@g" $bin
-      done
-
-      # Remove originals. Knows a little too much about wrapPythonProgramsIn.
-      rm -f $out/bin/.*-wrapped
-
-      wrapPythonPrograms $out/lib "$out $pythonPath"
-    ''
-    + (stdenv.lib.optionalString withPlugin
+    (stdenv.lib.optionalString withPlugin
     (let hplip_arch =
           if stdenv.system == "i686-linux" then "x86_32"
           else if stdenv.system == "x86_64-linux" then "x86_64"
@@ -129,29 +134,25 @@ stdenv.mkDerivation {
     mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
 
     rm $out/etc/udev/rules.d/56-hpmud.rules
-    ''));
+  ''));
+
+  fixupPhase = ''
+    # Wrap the user-facing Python scripts in /bin without turning the ones
+    # in /share into shell scripts (they need to be importable).
+    # Complicated by the fact that /bin contains just symlinks to /share.
+    for bin in $out/bin/*; do
+      py=`readlink -m $bin`
+      rm $bin
+      cp $py $bin
+      wrapPythonProgramsIn $bin "$out $pythonPath"
+      sed -i "s@$(dirname $bin)/[^ ]*@$py@g" $bin
+    done
 
-  buildInputs = [
-      libjpeg
-      cups
-      libusb1
-      pythonPackages.python
-      pythonPackages.wrapPython
-      saneBackends
-      dbus
-      net_snmp
-    ] ++ stdenv.lib.optional qtSupport qt4;
-  nativeBuildInputs = [
-    pkgconfig
-  ];
+    # Remove originals. Knows a little too much about wrapPythonProgramsIn.
+    rm -f $out/bin/.*-wrapped
 
-  pythonPath = with pythonPackages; [
-      dbus
-      pillow
-      pygobject
-      recursivePthLoader
-      reportlab
-    ] ++ stdenv.lib.optional qtSupport pyqt4;
+    wrapPythonProgramsIn $out/lib "$out $pythonPath"
+  '';
 
   meta = with stdenv.lib; {
     description = "Print, scan and fax HP drivers for Linux";