From 0c54a292fbf7b00dedfdc497515b149be5b6fb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20J=C3=A4ger?= Date: Sat, 10 Jun 2017 02:04:33 -0700 Subject: [PATCH] hplip: introduce nettools dependency (#26439) * hplip: introduce nettools dependency Some HP printers (notably a HP MFP M477fnw) need to run `hostname` as part of the printing process. This executable is provided by the "nettools" package. * hplip: prepend nettools to PATH --- pkgs/misc/drivers/hplip/default.nix | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 62f94ae6fc9f..6adc2a765c7f 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -1,7 +1,8 @@ { stdenv, fetchurl, substituteAll , pkgconfig +, makeWrapper , cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils -, net_snmp, openssl, polkit +, net_snmp, openssl, polkit, nettools , bash, coreutils, utillinux , qtSupport ? true , withPlugin ? false @@ -22,20 +23,17 @@ let sha256 = "1y3wdax2wb6kdd8bi40wl7v9s8ffyjz95bz42sjcpzzddmlhcaxg"; }; - hplipState = - substituteAll - { - inherit version; - src = ./hplip.state; - }; + hplipState = substituteAll { + inherit version; + src = ./hplip.state; + }; - hplipPlatforms = - { - "i686-linux" = "x86_32"; - "x86_64-linux" = "x86_64"; - "armv6l-linux" = "arm32"; - "armv7l-linux" = "arm32"; - }; + hplipPlatforms = { + "i686-linux" = "x86_32"; + "x86_64-linux" = "x86_64"; + "armv6l-linux" = "arm32"; + "armv7l-linux" = "arm32"; + }; hplipArch = hplipPlatforms."${stdenv.system}" or (throw "HPLIP not supported on ${stdenv.system}"); @@ -63,6 +61,7 @@ pythonPackages.buildPythonApplication { nativeBuildInputs = [ pkgconfig + makeWrapper ]; propagatedBuildInputs = with pythonPackages; [ @@ -146,6 +145,9 @@ pythonPackages.buildPythonApplication { ''; postFixup = '' + wrapProgram $out/lib/cups/filter/hpps \ + --prefix PATH : "${nettools}/bin" + 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.