The CUPS backend was not built since gutenprint requires libusb1, not 0.1 (at least since ~2014).
With this change CUPS detects printers relying on the pure gutenprint backend (like some dye sublimation printers).
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools.
This update was made based on information from https://repology.org/metapackage/gutenprint/versions.
These checks were done:
- built on NixOS
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/escputil -h’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/escputil --help’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/testpattern -h’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/testpattern --help’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/testpattern help’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/cups-genppd.5.2 -h’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/cups-genppd.5.2 help’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/cups-genppdupdate -h’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/cups-genppdupdate --help’ got 0 exit code
- ran ‘/nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14/bin/cups-genppdupdate help’ got 0 exit code
- found 5.2.14 with grep in /nix/store/8pdjcfv46m5w8ifh68mvajwkn3vjwal1-gutenprint-5.2.14
- directory tree listing: https://gist.github.com/6d652f72cb774ccd13cc489d708ad63d
Additional CUPS drivers can be added via "services.printing.drivers" but
Gutenprint was an exception. It was possible to add a Gutenprint
derivation to that list and it would work at first but unlike the other
drivers Gutenprint requires a script to be run after each update or any
attempt to print something would simply fail and an error would show up
in the jobs queue (http://localhost:631/jobs/):
"The PPD version (5.2.11) is not compatible with Gutenprint 5.2.13.
Please run
`/nix/store/7762kpyhfkcgmr3q81v1bbyy0bjhym80-gutenprint-5.2.13/sbin/cups-genppdupdate'
as administrator."
This is due to state in "/var/lib/cups/ppd" and one would need to run
"/nix/store/.../bin/cups-genppdupdate -p /var/lib/cups/ppd" manually.
The alternative was to enable the following option:
"services.printing.gutenprint" but this had two disadvantages:
1) It is an exception that one could be unaware of or that could
potentially cause some confusion.
2) One couldn't use a customized Gutenprint derivation in
"services.printing.drivers" but would instead have to overwrite
"pkgs.gutenprint".
This new approach simply detects a Gutenprint derivation in
"services.printing.gutenprint" by checking if the meta set of a
derivation contains "isGutenprint = true". Therefore no special
exception for Gutenprint would be required and it could easily be
applied to other drivers if they would require such a script to be run.
Rework gutenprint derivation:
* Convert to regular stdenv.mkDerivation;
* Enable IJS driver;
* Fix cups-genppdupdate;
* Move things around to the proper directories;
* Enable parallel building;
* Clean from old hacks.
This is used to generate ppd files for cups:
$ cups-genppd.5.2 -M | grep p50
canon-cp500
escp2-p50
$ cups-genppd.5.2 -p . escp2-p50
This will create the relevant ppd file in the current directory. This
can then be used by cups after setting services.drivers.drivers =
[pkgs.gutenprint]; and configuring the printer to use this ppd e.g.
via the web interface on http://localhost:631