From 4ca2daae8f21834424f5d4055c85dbcf5765fc1d Mon Sep 17 00:00:00 2001 From: Raymond Gauthier Date: Tue, 20 Feb 2018 22:48:31 -0500 Subject: hplip: 3.18.3 -> 3.18.5 Also fixes multiples issues: - broken plugins: - `fax_marvell.so file is not present or symbolic link is missing` - `lj.so library file doesn't have user/group execute permission.` - `bb_escl.so file is not present or symbolic link is missing` - multiple error during configuration phase which prevented `*.ppd` generation: - `ppdc: Unable to find include file ""` - patched configure time `perl` script - patched use of `file` - some potentially problematic filter and services: - patched reference to ghost script and fonts dir in filter. - patched usb configuration service. - patch scripts so that they refer to valid location. Add some options: - `withStaticPPDInstall`: Install `*.ppd` files along with `*.drv`. When true, configure outputs: `checking for cups ppd install... yes`. --- pkgs/misc/drivers/hplip/default.nix | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'pkgs/misc/drivers/hplip') diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 91be6cf743a4..4b88d4a96fa0 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -1,26 +1,28 @@ { stdenv, fetchurl, substituteAll , pkgconfig , makeWrapper -, cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends, dbus, usbutils -, net_snmp, openssl, polkit, nettools +, cups, zlib, libjpeg, libusb1, pythonPackages, sane-backends +, dbus, file, ghostscript, usbutils +, net_snmp, openssl, perl, polkit, nettools , bash, coreutils, utillinux , withQt5 ? true , withPlugin ? false +, withStaticPPDInstall ? false }: let name = "hplip-${version}"; - version = "3.18.3"; + version = "3.18.5"; src = fetchurl { url = "mirror://sourceforge/hplip/${name}.tar.gz"; - sha256 = "0x5xs86v18w46rxz5whc15bl4fb7p4km6xqjpwzclp83nl7rl01y"; + sha256 = "0xb7ga2wgbwjxsss67mjn2y6fmqsfwzmv11ivvfzhnl36lh22hkb"; }; plugin = fetchurl { url = "https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run"; - sha256 = "11nc3cifhd2h2c7p0dr2jjzrg3fd5j43ih1wy0m186l6wcgdjssw"; + sha256 = "1jf74jya071zqvwhy9n0c3007pzgcxydkw7qdh4sx70brly81i7p"; }; hplipState = substituteAll { @@ -55,8 +57,11 @@ pythonPackages.buildPythonApplication { libusb1 sane-backends dbus + file + ghostscript net_snmp openssl + perl zlib ]; @@ -86,6 +91,11 @@ pythonPackages.buildPythonApplication { -e s,/usr/share/hal/fdi/preprobe/10osvendor,$out/share/hal/fdi/preprobe/10osvendor,g \ -e s,/usr/lib/systemd/system,$out/lib/systemd/system,g \ -e s,/var/lib/hp,$out/var/lib/hp,g \ + -e s,/usr/bin/perl,${perl}/bin/perl,g \ + -e s,/usr/bin/file,${file}/bin/file,g \ + -e s,/usr/bin/gs,${ghostscript}/bin/gs,g \ + -e s,/usr/share/cups/fonts,${ghostscript}/share/ghostscript/fonts,g \ + -e "s,ExecStart=/usr/bin/python /usr/bin/hp-config_usb_printer,ExecStart=$out/bin/hp-config_usb_printer,g" \ {} + ''; @@ -98,6 +108,7 @@ pythonPackages.buildPythonApplication { --with-systraydir=$out/xdg/autostart --with-mimedir=$out/etc/cups --enable-policykit + ${stdenv.lib.optionalString withStaticPPDInstall "--enable-cups-ppd-install"} --disable-qt4 ${stdenv.lib.optionalString withQt5 "--enable-qt5"} " @@ -111,10 +122,20 @@ pythonPackages.buildPythonApplication { hplip_confdir=$out/etc/hp hplip_statedir=$out/var/lib/hp " + + # Prevent 'ppdc: Unable to find include file ""' which prevent + # generation of '*.ppd' files. + # This seems to be a 'ppdc' issue when the tool is run in a hermetic sandbox. + # Could not find how to fix the problem in 'ppdc' so this is a workaround. + export CUPS_DATADIR="${cups}/share/cups" ''; enableParallelBuilding = true; + # + # Running `hp-diagnose_plugin -g` can be used to diagnose + # issues with plugins. + # postInstall = stdenv.lib.optionalString withPlugin '' sh ${plugin} --noexec --keep cd plugin_tmp @@ -130,17 +151,27 @@ pythonPackages.buildPythonApplication { mkdir -p $out/share/hplip/prnt/plugins for plugin in lj hbpl1; do cp $plugin-${hplipArch}.so $out/share/hplip/prnt/plugins + chmod 0755 $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so ln -s $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so \ $out/share/hplip/prnt/plugins/$plugin.so done mkdir -p $out/share/hplip/scan/plugins - for plugin in bb_soap bb_marvell bb_soapht fax_marvell; do + for plugin in bb_soap bb_marvell bb_soapht bb_escl; do cp $plugin-${hplipArch}.so $out/share/hplip/scan/plugins + chmod 0755 $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so ln -s $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so \ $out/share/hplip/scan/plugins/$plugin.so done + mkdir -p $out/share/hplip/fax/plugins + for plugin in fax_marvell; do + cp $plugin-${hplipArch}.so $out/share/hplip/fax/plugins + chmod 0755 $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so + ln -s $out/share/hplip/fax/plugins/$plugin-${hplipArch}.so \ + $out/share/hplip/fax/plugins/$plugin.so + done + mkdir -p $out/var/lib/hp cp ${hplipState} $out/var/lib/hp/hplip.state -- cgit 1.4.1