foomatic-db-engine: init at unstable-2022-05-03

`foomatic-db-engine` contains several perl scripts to parse
and process XML files from the Foomatic database packages.
It can be used to extract ppd files,
which will be accomplished in a follow-up commit.

The package also contains scripts
to handle print queues and jobs.
It can -- optionally -- talk to the local cups server,
to network printers and to SMB print servers.
The build recipe contains switches to enable these features;
however, they are not needed when generating ppd files.

There is a daily snapshot of a source archive available at
https://www.openprinting.org/download/foomatic/ .
However, these files rotate daily and
cannot be used as a stable download source.
So we rely on OpenPrinting's Github repository
instead and pinpoint a fresh commit.

Yarny0 cd4c8d63 bafefd7a

+96
+94
pkgs/misc/cups/drivers/foomatic-db-engine/default.nix
···
··· 1 + { lib 2 + , perlPackages 3 + , fetchFromGitHub 4 + , withCupsAccess ? false # needed to access local cups server 5 + , cups 6 + , cups-filters 7 + , curl 8 + , withSocketAccess ? false # needed to access network printers 9 + , netcat-gnu 10 + , withSMBAccess ? false # needed to access SMB-connected printers 11 + , samba 12 + , autoconf 13 + , automake 14 + , file 15 + , makeWrapper 16 + }: 17 + 18 + perlPackages.buildPerlPackage { 19 + pname = "foomatic-db-engine"; 20 + version = "unstable-2022-05-03"; 21 + 22 + src = fetchFromGitHub { 23 + # there is also a daily snapshot at the `downloadPage`, 24 + # but it gets deleted quickly and would provoke 404 errors 25 + owner = "OpenPrinting"; 26 + repo = "foomatic-db-engine"; 27 + rev = "2e6f14b54748fa121a4d2e3d480010e10b070c5a"; 28 + hash = "sha256-m7FQTxWmawbtm24h8UqznGKXgX41JhOtyyFMRwEhm5k="; 29 + }; 30 + 31 + outputs = [ "out" ]; 32 + 33 + propagatedBuildInputs = [ 34 + perlPackages.Clone 35 + perlPackages.DBI 36 + perlPackages.XMLLibXML 37 + ]; 38 + 39 + buildInputs = 40 + # provide some "cups-*" commands to `foomatic-{configure,printjob}` 41 + # so that they can manage a local cups server (add queues, add jobs...) 42 + lib.optionals withCupsAccess [ cups cups-filters curl ] 43 + # the commands `foomatic-{configure,getpjloptions}` need 44 + # netcat if they are used to query or alter a network 45 + # printer via AppSocket/HP JetDirect protocol 46 + ++ lib.optional withSocketAccess netcat-gnu 47 + # `foomatic-configure` can be used to access printers that are 48 + # shared via the SMB protocol, but it needs the `smbclient` binary 49 + ++ lib.optional withSMBAccess samba 50 + ; 51 + 52 + nativeBuildInputs = [ autoconf automake file makeWrapper ]; 53 + 54 + # sed-substitute indirection is more robust against 55 + # characters in paths that might need escaping 56 + prePatch = '' 57 + sed -Ei 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' configure.ac 58 + substituteInPlace configure.ac --subst-var PATH 59 + touch Makefile.PL # `buildPerlPackage` fails unless this exists 60 + ''; 61 + 62 + preConfigure = '' 63 + ./make_configure 64 + ''; 65 + 66 + configureFlags = [ 67 + "--sysconfdir=${placeholder "out"}/etc" 68 + "LIBDIR=${placeholder "out"}/share/foomatic" 69 + "PERLPREFIX=${placeholder "out"}" 70 + ]; 71 + 72 + postFixup = '' 73 + for bin in "${placeholder "out"}/bin"/*; do 74 + test '!' -L "$bin" || continue # skip symlink 75 + wrapProgram "$bin" --set PERL5LIB "$PERL5LIB" 76 + done 77 + ''; 78 + 79 + doCheck = false; # no tests, would fail 80 + 81 + meta = { 82 + description = "OpenPrinting printer support database engine"; 83 + downloadPage = "https://www.openprinting.org/download/foomatic/"; 84 + homepage = "https://openprinting.github.io/projects/02-foomatic/"; 85 + license = lib.licenses.gpl2Only; 86 + maintainers = [ lib.maintainers.yarny ]; 87 + longDescription = '' 88 + Foomatic's database engine generates PPD files 89 + from the data in Foomatic's XML database. 90 + It also contains scripts to directly 91 + generate print queues and handle jobs. 92 + ''; 93 + }; 94 + }
+2
pkgs/top-level/all-packages.nix
··· 36319 36320 epson-workforce-635-nx625-series = callPackage ../misc/drivers/epson-workforce-635-nx625-series { }; 36321 36322 gutenprint = callPackage ../misc/drivers/gutenprint { }; 36323 36324 gutenprintBin = callPackage ../misc/drivers/gutenprint/bin.nix { };
··· 36319 36320 epson-workforce-635-nx625-series = callPackage ../misc/drivers/epson-workforce-635-nx625-series { }; 36321 36322 + foomatic-db-engine = callPackage ../misc/cups/drivers/foomatic-db-engine {}; 36323 + 36324 gutenprint = callPackage ../misc/drivers/gutenprint { }; 36325 36326 gutenprintBin = callPackage ../misc/drivers/gutenprint/bin.nix { };