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
This commit is contained in:
Tim Jäger 2017-06-10 02:04:33 -07:00 committed by Jörg Thalheim
parent b731e65081
commit 0c54a292fb

View File

@ -1,7 +1,8 @@
{ stdenv, fetchurl, substituteAll { stdenv, fetchurl, substituteAll
, pkgconfig , pkgconfig
, makeWrapper
, cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils , cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils
, net_snmp, openssl, polkit , net_snmp, openssl, polkit, nettools
, bash, coreutils, utillinux , bash, coreutils, utillinux
, qtSupport ? true , qtSupport ? true
, withPlugin ? false , withPlugin ? false
@ -22,20 +23,17 @@ let
sha256 = "1y3wdax2wb6kdd8bi40wl7v9s8ffyjz95bz42sjcpzzddmlhcaxg"; sha256 = "1y3wdax2wb6kdd8bi40wl7v9s8ffyjz95bz42sjcpzzddmlhcaxg";
}; };
hplipState = hplipState = substituteAll {
substituteAll inherit version;
{ src = ./hplip.state;
inherit version; };
src = ./hplip.state;
};
hplipPlatforms = hplipPlatforms = {
{ "i686-linux" = "x86_32";
"i686-linux" = "x86_32"; "x86_64-linux" = "x86_64";
"x86_64-linux" = "x86_64"; "armv6l-linux" = "arm32";
"armv6l-linux" = "arm32"; "armv7l-linux" = "arm32";
"armv7l-linux" = "arm32"; };
};
hplipArch = hplipPlatforms."${stdenv.system}" hplipArch = hplipPlatforms."${stdenv.system}"
or (throw "HPLIP not supported on ${stdenv.system}"); or (throw "HPLIP not supported on ${stdenv.system}");
@ -63,6 +61,7 @@ pythonPackages.buildPythonApplication {
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig pkgconfig
makeWrapper
]; ];
propagatedBuildInputs = with pythonPackages; [ propagatedBuildInputs = with pythonPackages; [
@ -146,6 +145,9 @@ pythonPackages.buildPythonApplication {
''; '';
postFixup = '' postFixup = ''
wrapProgram $out/lib/cups/filter/hpps \
--prefix PATH : "${nettools}/bin"
substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
'' + stdenv.lib.optionalString (!withPlugin) '' '' + stdenv.lib.optionalString (!withPlugin) ''
# A udev rule to notify users that they need the binary plugin. # A udev rule to notify users that they need the binary plugin.