about summary refs log tree commit diff
path: root/pkgs/misc/drivers/hplip
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2016-04-01 21:07:40 +0200
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2016-04-04 22:14:21 +0200
commitd54bc765b5662ebe4529a8d8754a9bf5d00a256b (patch)
tree225ca437b34f5580ad8c79f4d1d2224fc197adb3 /pkgs/misc/drivers/hplip
parent621218c3c119c5673c94a85eb2890076480fed02 (diff)
downloadnixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar.gz
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar.bz2
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar.lz
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar.xz
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.tar.zst
nixlib-d54bc765b5662ebe4529a8d8754a9bf5d00a256b.zip
hplip: canonicalise 56-hpmud.rules' paths if installed
Fixes #14338.
Diffstat (limited to 'pkgs/misc/drivers/hplip')
-rw-r--r--pkgs/misc/drivers/hplip/3.15.9.nix12
-rw-r--r--pkgs/misc/drivers/hplip/default.nix12
2 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/misc/drivers/hplip/3.15.9.nix b/pkgs/misc/drivers/hplip/3.15.9.nix
index 9cd5a7894646..1162cc4f00d2 100644
--- a/pkgs/misc/drivers/hplip/3.15.9.nix
+++ b/pkgs/misc/drivers/hplip/3.15.9.nix
@@ -2,6 +2,7 @@
 , pkgconfig
 , cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils
 , net_snmp, polkit
+, bash, coreutils, utillinux
 , qtSupport ? true, qt4, pyqt4
 , withPlugin ? false
 }:
@@ -112,8 +113,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  postInstall = stdenv.lib.optionalString withPlugin
-    ''
+  postInstall = stdenv.lib.optionalString withPlugin ''
     sh ${plugin} --noexec --keep
     cd plugin_tmp
 
@@ -175,6 +175,14 @@ stdenv.mkDerivation {
     wrapPythonProgramsIn $out/lib "$out $pythonPath"
 
     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.
+    # Needs a lot of patching but might save someone a bit of confusion:
+    substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
+      --replace {,${bash}}/bin/sh \
+      --replace {/usr,${coreutils}}/bin/nohup \
+      --replace {,${utillinux}/bin/}logger \
+      --replace {/usr,$out}/bin
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index ebe8a4d19abf..cd8e906c8171 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -2,6 +2,7 @@
 , pkgconfig
 , cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils
 , net_snmp, polkit
+, bash, coreutils, utillinux
 , qtSupport ? true, qt4, pyqt4
 , withPlugin ? false
 }:
@@ -112,8 +113,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  postInstall = stdenv.lib.optionalString withPlugin
-    ''
+  postInstall = stdenv.lib.optionalString withPlugin ''
     sh ${plugin} --noexec --keep
     cd plugin_tmp
 
@@ -175,6 +175,14 @@ stdenv.mkDerivation {
     wrapPythonProgramsIn $out/lib "$out $pythonPath"
 
     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.
+    # Needs a lot of patching but might save someone a bit of confusion:
+    substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
+      --replace {,${bash}}/bin/sh \
+      --replace {/usr,${coreutils}}/bin/nohup \
+      --replace {,${utillinux}/bin/}logger \
+      --replace {/usr,$out}/bin
   '';
 
   meta = with stdenv.lib; {