diff --git a/pkgs/misc/drivers/hplip/3.15.9.nix b/pkgs/misc/drivers/hplip/3.15.9.nix index 9cd5a789464..1162cc4f00d 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 ebe8a4d19ab..cd8e906c817 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; {