diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-01-26 18:06:19 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-01-26 18:21:18 +0000 |
commit | 7ac6743433dd45ceaead2ca96f6356dc0d064ce6 (patch) | |
tree | b68ec89d7d2a8d2b6e6b1ff94ba26d6af4096350 /nixpkgs/pkgs/misc/drivers/hplip/default.nix | |
parent | c5c7451dbef37b51f52792d6395a670ef5183d27 (diff) | |
parent | 891f607d5301d6730cb1f9dcf3618bcb1ab7f10e (diff) | |
download | nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.gz nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.bz2 nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.lz nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.xz nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.zst nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.zip |
Merge commit '891f607d5301d6730cb1f9dcf3618bcb1ab7f10e'
Diffstat (limited to 'nixpkgs/pkgs/misc/drivers/hplip/default.nix')
-rw-r--r-- | nixpkgs/pkgs/misc/drivers/hplip/default.nix | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/nixpkgs/pkgs/misc/drivers/hplip/default.nix b/nixpkgs/pkgs/misc/drivers/hplip/default.nix index b740f5091fa7..6a7eb35ae52b 100644 --- a/nixpkgs/pkgs/misc/drivers/hplip/default.nix +++ b/nixpkgs/pkgs/misc/drivers/hplip/default.nix @@ -1,8 +1,8 @@ -{ stdenv, fetchurl, substituteAll -, pkgconfig +{ lib, stdenv, fetchurl, substituteAll +, pkg-config , cups, zlib, libjpeg, libusb1, python3Packages, sane-backends , dbus, file, ghostscript, usbutils -, net-snmp, openssl, perl, nettools +, net-snmp, openssl, perl, nettools, avahi , bash, coreutils, util-linux # To remove references to gcc-unwrapped , removeReferencesTo, qt5 @@ -13,17 +13,17 @@ let - name = "hplip-${version}"; - version = "3.20.5"; + pname = "hplip"; + version = "3.20.11"; src = fetchurl { - url = "mirror://sourceforge/hplip/${name}.tar.gz"; - sha256 = "004bbd78487b7803cdcf2a96b00de938797227068c4de43ee7ad7d174c4e475a"; + url = "mirror://sourceforge/hplip/${pname}-${version}.tar.gz"; + sha256 = "CxZ1s9jnCaEyX+hj9arOO9NxB3mnPq6Gj3su6aVv2xE="; }; plugin = fetchurl { - url = "https://developers.hp.com/sites/default/files/${name}-plugin.run"; - sha256 = "ff3dedda3158be64b985efbf636890ddda5b271ae1f1fbd788219e1344a9c2e7"; + url = "https://developers.hp.com/sites/default/files/${pname}-${version}-plugin.run"; + sha256 = "r8PoQQFfjdHKySPCFwtDR8Tl6v5Eag9gXpBAp6sCF9Q="; }; hplipState = substituteAll { @@ -50,7 +50,7 @@ assert withPlugin -> builtins.elem hplipArch pluginArches || throw "HPLIP plugin not supported on ${stdenv.hostPlatform.system}"; python3Packages.buildPythonApplication { - inherit name src; + inherit pname version src; format = "other"; buildInputs = [ @@ -65,12 +65,13 @@ python3Packages.buildPythonApplication { openssl perl zlib + avahi ]; nativeBuildInputs = [ - pkgconfig + pkg-config removeReferencesTo - ] ++ stdenv.lib.optional withQt5 qt5.wrapQtAppsHook; + ] ++ lib.optional withQt5 qt5.wrapQtAppsHook; pythonPath = with python3Packages; [ dbus @@ -80,7 +81,7 @@ python3Packages.buildPythonApplication { usbutils sip dbus-python - ] ++ stdenv.lib.optionals withQt5 [ + ] ++ lib.optionals withQt5 [ pyqt5 enum-compat ]; @@ -92,6 +93,12 @@ python3Packages.buildPythonApplication { # https://bugs.launchpad.net/hplip/+bug/1788706 # https://bugs.launchpad.net/hplip/+bug/1787289 ./image-processor.patch + + # HPLIP's getSystemPPDs() function relies on searching for PPDs below common FHS + # paths, and hp-setup crashes if none of these paths actually exist (which they + # don't on NixOS). Add the equivalent NixOS path, /var/lib/cups/path/share. + # See: https://github.com/NixOS/nixpkgs/issues/21796 + ./hplip-3.20.11-nixos-cups-ppd-search-path.patch ]; prePatch = '' @@ -120,9 +127,9 @@ python3Packages.buildPythonApplication { --with-systraydir=$out/xdg/autostart --with-mimedir=$out/etc/cups --enable-policykit - ${stdenv.lib.optionalString withStaticPPDInstall "--enable-cups-ppd-install"} + ${lib.optionalString withStaticPPDInstall "--enable-cups-ppd-install"} --disable-qt4 - ${stdenv.lib.optionalString withQt5 "--enable-qt5"} + ${lib.optionalString withQt5 "--enable-qt5"} " export makeFlags=" @@ -148,7 +155,7 @@ python3Packages.buildPythonApplication { # Running `hp-diagnose_plugin -g` can be used to diagnose # issues with plugins. # - postInstall = stdenv.lib.optionalString withPlugin '' + postInstall = lib.optionalString withPlugin '' sh ${plugin} --noexec --keep cd plugin_tmp @@ -222,7 +229,7 @@ python3Packages.buildPythonApplication { --replace {,${util-linux}/bin/}logger \ --replace {/usr,$out}/bin remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/*.so) - '' + stdenv.lib.optionalString withQt5 '' + '' + lib.optionalString withQt5 '' for f in $out/bin/hp-*;do wrapQtApp $f done @@ -233,7 +240,7 @@ python3Packages.buildPythonApplication { "share/hplip" "lib/cups/backend" "lib/cups/filter" python3Packages.python.sitePackages "lib/sane" ]; - meta = with stdenv.lib; { + meta = with lib; { description = "Print, scan and fax HP drivers for Linux"; homepage = "https://developers.hp.com/hp-linux-imaging-and-printing"; downloadPage = "https://sourceforge.net/projects/hplip/files/hplip/"; |