about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2021-01-10 10:33:57 +0200
committerGitHub <noreply@github.com>2021-01-10 10:33:57 +0200
commit4539bf9ebe357fd361c04485e69c7fd44f1d7824 (patch)
tree0bc2222ce4bcf0587ae6d927c47855bcb11b95f7 /pkgs/misc
parenta29fcc1c108edc5317ddcbff86d82d45dd5dbd4c (diff)
parent60df55c9fba36891b2c76eda50d5e2c9a0731e4e (diff)
Merge pull request #108830 from khumba/hplip-ppd-search-path
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix6
-rw-r--r--pkgs/misc/drivers/hplip/hplip-3.20.11-nixos-cups-ppd-search-path.patch24
2 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index b29463d61ddf8..f1688a1b56fce 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -93,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 = ''
diff --git a/pkgs/misc/drivers/hplip/hplip-3.20.11-nixos-cups-ppd-search-path.patch b/pkgs/misc/drivers/hplip/hplip-3.20.11-nixos-cups-ppd-search-path.patch
new file mode 100644
index 0000000000000..d26e13dd2d633
--- /dev/null
+++ b/pkgs/misc/drivers/hplip/hplip-3.20.11-nixos-cups-ppd-search-path.patch
@@ -0,0 +1,24 @@
+From: Bryan Gardiner <bog@khumba.net>
+Date: Sat, 9 Jan 2021 16:51:20 -0800
+Subject: [PATCH] Add NixOS CUPS PPD search path.
+
+---
+ base/g.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/base/g.py b/base/g.py
+index f73e23f..758f339 100644
+--- a/base/g.py
++++ b/base/g.py
+@@ -283,7 +283,7 @@ prop.max_message_len = 8192
+ prop.max_message_read = 65536
+ prop.read_timeout = 90
+ 
+-prop.ppd_search_path = '/usr/share;/usr/local/share;/usr/lib;/usr/local/lib;/usr/libexec;/opt;/usr/lib64'
++prop.ppd_search_path = '/var/lib/cups/path/share;/usr/share;/usr/local/share;/usr/lib;/usr/local/lib;/usr/libexec;/opt;/usr/lib64'
+ prop.ppd_search_pattern = 'HP-*.ppd.*'
+ prop.ppd_download_url = 'http://www.linuxprinting.org/ppd-o-matic.cgi'
+ prop.ppd_file_suffix = '-hpijs.ppd'
+-- 
+2.29.2
+