From 2daea2c81f1690fb12070abe67f5ab6b1d582159 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 30 Jun 2019 15:29:17 +0200 Subject: [PATCH] hplip: retain udev rules in WithPlugin version Beginning with commit 8ffd6af27e6dfae0a3b4d77db03409f62c5b8d98, the build recipe for `hplipWithPlugin` explicitely drops a udev rule file that is delivered with the sources. In `hplip` (without plugin), the rule file is retained. The udev rules takes care of uploading firmware to certain printers (and maybe of other things), e.g. to HP LaserJet 1000. This commit reinstates the rule file and expands the fixup script so that the rules are also patched in the WithPlugin version. --- pkgs/misc/drivers/hplip/3.16.11.nix | 8 +++----- pkgs/misc/drivers/hplip/3.18.5.nix | 8 +++----- pkgs/misc/drivers/hplip/default.nix | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/pkgs/misc/drivers/hplip/3.16.11.nix b/pkgs/misc/drivers/hplip/3.16.11.nix index 4e9b4cbf0ae..ebea49d9540 100644 --- a/pkgs/misc/drivers/hplip/3.16.11.nix +++ b/pkgs/misc/drivers/hplip/3.16.11.nix @@ -142,8 +142,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/etc/sane.d/dll.d mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -171,9 +169,9 @@ pythonPackages.buildPythonApplication { 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. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \ diff --git a/pkgs/misc/drivers/hplip/3.18.5.nix b/pkgs/misc/drivers/hplip/3.18.5.nix index 7da6b2db930..68220392fd0 100644 --- a/pkgs/misc/drivers/hplip/3.18.5.nix +++ b/pkgs/misc/drivers/hplip/3.18.5.nix @@ -174,8 +174,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/var/lib/hp cp ${hplipState} $out/var/lib/hp/hplip.state - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -203,9 +201,9 @@ pythonPackages.buildPythonApplication { 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. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \ diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 6c02fa52124..851aa9f3f88 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -181,8 +181,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/var/lib/hp cp ${hplipState} $out/var/lib/hp/hplip.state - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -210,9 +208,9 @@ pythonPackages.buildPythonApplication { 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. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \