about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-10-28 20:00:08 +0200
committerGitHub <noreply@github.com>2016-10-28 20:00:08 +0200
commitbeef906d2e0494ac5750e775504d98e34a2dfd4b (patch)
treee51b9eae2f3e8e344e71b6131950c4b9d12a22eb /pkgs/misc
parentbe59f34b2ce83e657d62deaf5bdb3be59dcf9716 (diff)
parentd9c7a14c6ac80f64b5ac002b8582c7f5e4199a5f (diff)
downloadnixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar.gz
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar.bz2
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar.lz
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar.xz
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.tar.zst
nixlib-beef906d2e0494ac5750e775504d98e34a2dfd4b.zip
Merge pull request #19882 from FRidh/hplip
hplip: use mkPythonDerivation
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix38
1 files changed, 4 insertions, 34 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index bf0af6b806fd..c0a6c0a9baa0 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -3,7 +3,7 @@
 , cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils
 , net_snmp, openssl, polkit
 , bash, coreutils, utillinux
-, qtSupport ? true, qt4
+, qtSupport ? true
 , withPlugin ? false
 }:
 
@@ -47,32 +47,27 @@ in
 assert withPlugin -> builtins.elem hplipArch pluginArches
   || throw "HPLIP plugin not supported on ${stdenv.system}";
 
-stdenv.mkDerivation {
+pythonPackages.mkPythonDerivation {
   inherit name src;
 
   buildInputs = [
     libjpeg
     cups
     libusb1
-    pythonPackages.python
-    pythonPackages.wrapPython
     sane-backends
     dbus
     net_snmp
     openssl
-  ] ++ stdenv.lib.optionals qtSupport [
-    qt4
   ];
 
   nativeBuildInputs = [
     pkgconfig
   ];
 
-  pythonPath = with pythonPackages; [
+  propagatedBuildInputs = with pythonPackages; [
     dbus
     pillow
     pygobject2
-    recursivePthLoader
     reportlab
     usbutils
   ] ++ stdenv.lib.optionals qtSupport [
@@ -149,32 +144,7 @@ stdenv.mkDerivation {
     rm $out/etc/udev/rules.d/56-hpmud.rules
   '';
 
-  fixupPhase = ''
-    # Wrap the user-facing Python scripts in $out/bin without turning the
-    # ones in $out /share into shell scripts (they need to be importable).
-    # Note that $out/bin contains only symlinks to $out/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
-
-    # Merely patching shebangs in $out/share does not cause trouble.
-    for i in $out/share/hplip{,/*}/*.py; do
-      substituteInPlace $i \
-        --replace /usr/bin/python \
-        ${pythonPackages.python}/bin/${pythonPackages.python.executable} \
-        --replace "/usr/bin/env python" \
-        ${pythonPackages.python}/bin/${pythonPackages.python.executable}
-    done
-
-    wrapPythonProgramsIn $out/lib "$out $pythonPath"
-
+  postFixup = ''
     substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
   '' + stdenv.lib.optionalString (!withPlugin) ''
     # A udev rule to notify users that they need the binary plugin.