10 stdenv.mkDerivation (finalAttrs: {
11 pname = "foomatic-db-nonfree";
12 version = "0-unstable-2015-06-05";
14 src = fetchFromGitHub {
15 # there is also a daily snapshot at the `downloadPage`,
16 # but it gets deleted quickly and would provoke 404 errors
17 owner = "OpenPrinting";
18 repo = "foomatic-db-nonfree";
19 rev = "6ddae02ac89240c019f8b5026cfe70e30fd2b3db";
20 hash = "sha256-cRZH0CXg03FEqUJdxaNnPVXjf8+ct86PjhL59WQbw60=";
29 # sed-substitute indirection is more robust against
30 # characters in paths that might need escaping
32 sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' \
33 -e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac
34 substituteInPlace configure.ac \
36 --subst-var-by DATA "${placeholder "out"}/share"
40 mkdir -p "${placeholder "out"}/share/foomatic/db/source"
44 # make ppd files available to cups,
45 # use a package-specific subdirectory to avoid
46 # conflicts with other ppd-containing packages
48 if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then
49 echo "failed to create share/foomatic/db/source/PPD"
52 mkdir -p "${placeholder "out"}/share/cups/model"
53 ln -s "${placeholder "out"}/share/foomatic/db/source/PPD" \
54 "${placeholder "out"}/share/cups/model/foomatic-db-nonfree"
57 # we might patch ppd file commands with `patchPpdFilesHook`,
58 # but the only command "rastertophaser6100" isn't packaged yet
62 echo 'compressing ppd files'
63 find -H "${placeholder "out"}/share/cups/model/foomatic-db-nonfree" -type f -iname '*.ppd' -print0 \
64 | xargs -0r -n 64 -P "$NIX_BUILD_CORES" gzip -9n
68 changelog = "https://github.com/OpenPrinting/foomatic-db-nonfree/blob/${finalAttrs.src.rev}/ChangeLog";
69 description = "OpenPrinting printer support database (unfree content)";
70 downloadPage = "https://www.openprinting.org/download/foomatic/";
71 homepage = "https://openprinting.github.io/projects/02-foomatic/";
72 license = lib.licenses.unfree;
73 maintainers = [ lib.maintainers.yarny ];
74 # list printer manufacturers here so people
75 # searching for ppd files can find this package
77 The collected knowledge about printers,
78 drivers, and driver options in XML files,
79 used by `foomatic-db-engine` to generate PPD files.
80 This is a package of PPD and Foomatic XML files
81 that may have restrictions that keep them
82 from being used on a variety of machines
83 for licensing and other non-technical reasons.
84 The XML files in this package enable `foomatic-db-ppds`
85 to create about 120 additional PPD files, for printer from
86 Dell, Genicom, Lexmark, Oce, Tektronix and Xerox.
87 Besides the XML files, this package contains
88 about 130 PPD files, for printers from
89 Dell, Genicom, Lexmark, Oce and Xerox.