foomatic-db-nonfree (cups ppd files): init at unstable/2015-06-05

`foomatic-db-nonfree` contains -- similar to its sister
package `foomatic-db` -- knowledge about printers,
drivers, and driver options from OpenPrinting in xml files.
It needs to be combined with the `foomatic-db`
package to yield a working database.
It also provides about 100 (gzipped) ppd files.
In contrast to `foomatic-db`, this package contains
data that is provided under non-free licenses.

Quoting
https://github.com/OpenPrinting/foomatic-db-nonfree/blob/master/README

> This is a repository of PPD and Foomatic XML files that may
> have restrictions that keep them from being used on a variety
> of machines for licensing and other non-technical reasons.

ppd files can be found in
`$out/share/cups/model/foomatic-db-nonfree`.
The subdirectory `foomatic-db-nofree` is used to avoid conflicts
with other packages that might be combined with the package
`foomatic-db-nonfree` in `config.services.printing.drivers`.

ppd files in this package are *not* patched
to call executables from the nix store:
The only executable "rastertophaser6100" that is
called from ppd files isn't available in nixpkgs.

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.
Note that the current version is from 2015,
so updates are unlikely.

Yarny0 156cc612 90a8a78e

+83
+82
pkgs/misc/cups/drivers/foomatic-db-nonfree/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , autoconf 5 + , automake 6 + , perl 7 + }: 8 + 9 + stdenv.mkDerivation { 10 + pname = "foomatic-db-nonfree"; 11 + version = "unstable-2015-06-05"; 12 + 13 + src = fetchFromGitHub { 14 + # there is also a daily snapshot at the `downloadPage`, 15 + # but it gets deleted quickly and would provoke 404 errors 16 + owner = "OpenPrinting"; 17 + repo = "foomatic-db-nonfree"; 18 + rev = "6ddae02ac89240c019f8b5026cfe70e30fd2b3db"; 19 + hash = "sha256-cRZH0CXg03FEqUJdxaNnPVXjf8+ct86PjhL59WQbw60="; 20 + }; 21 + 22 + nativeBuildInputs = [ autoconf automake perl ]; 23 + 24 + # sed-substitute indirection is more robust against 25 + # characters in paths that might need escaping 26 + postPatch = '' 27 + sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' \ 28 + -e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac 29 + substituteInPlace configure.ac \ 30 + --subst-var PATH \ 31 + --subst-var-by DATA "${placeholder "out"}/share" 32 + ''; 33 + 34 + preConfigure = '' 35 + mkdir -p "${placeholder "out"}/share/foomatic/db/source" 36 + ./make_configure 37 + ''; 38 + 39 + # make ppd files available to cups, 40 + # use a package-specific subdirectory to avoid 41 + # conflicts with other ppd-containing packages 42 + postInstall = '' 43 + if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then 44 + echo "failed to create share/foomatic/db/source/PPD" 45 + exit 1 46 + fi 47 + mkdir -p "${placeholder "out"}/share/cups/model" 48 + ln -s "${placeholder "out"}/share/foomatic/db/source/PPD" \ 49 + "${placeholder "out"}/share/cups/model/foomatic-db-nonfree" 50 + ''; 51 + 52 + # we might patch ppd file commands with `patchPpdFilesHook`, 53 + # but the only command "rastertophaser6100" isn't packaged yet 54 + 55 + # compress ppd files 56 + postFixup = '' 57 + echo 'compressing ppd files' 58 + find -H "${placeholder "out"}/share/cups/model/foomatic-db-nonfree" -type f -iname '*.ppd' -print0 \ 59 + | xargs -0r -n 64 -P "$NIX_BUILD_CORES" gzip -9n 60 + ''; 61 + 62 + meta = { 63 + description = "OpenPrinting printer support database (unfree content)"; 64 + downloadPage = "https://www.openprinting.org/download/foomatic/"; 65 + homepage = "https://openprinting.github.io/projects/02-foomatic/"; 66 + license = lib.licenses.unfree; 67 + maintainers = [ lib.maintainers.yarny ]; 68 + # list printer manufacturers here so people 69 + # searching for ppd files can find this package 70 + longDescription = '' 71 + The collected knowledge about printers, 72 + drivers, and driver options in XML files. 73 + This is a package of PPD and Foomatic XML files 74 + that may have restrictions that keep them 75 + from being used on a variety of machines 76 + for licensing and other non-technical reasons. 77 + Besides the XML files, this package contains 78 + about 130 PPD files, for printers from 79 + Dell, Genicom, Lexmark, Oce and Xerox. 80 + ''; 81 + }; 82 + }
+1
pkgs/top-level/all-packages.nix
··· 36321 36321 36322 36322 foomatic-db = callPackage ../misc/cups/drivers/foomatic-db {}; 36323 36323 foomatic-db-engine = callPackage ../misc/cups/drivers/foomatic-db-engine {}; 36324 + foomatic-db-nonfree = callPackage ../misc/cups/drivers/foomatic-db-nonfree {}; 36324 36325 36325 36326 gutenprint = callPackage ../misc/drivers/gutenprint { }; 36326 36327