9 stdenv.mkDerivation (finalAttrs: {
10 pname = "foomatic-db-nonfree";
11 version = "unstable-2015-06-05";
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=";
22 nativeBuildInputs = [ autoconf automake perl ];
24 # sed-substitute indirection is more robust against
25 # characters in paths that might need escaping
27 sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' \
28 -e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac
29 substituteInPlace configure.ac \
31 --subst-var-by DATA "${placeholder "out"}/share"
35 mkdir -p "${placeholder "out"}/share/foomatic/db/source"
39 # make ppd files available to cups,
40 # use a package-specific subdirectory to avoid
41 # conflicts with other ppd-containing packages
43 if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then
44 echo "failed to create share/foomatic/db/source/PPD"
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"
52 # we might patch ppd file commands with `patchPpdFilesHook`,
53 # but the only command "rastertophaser6100" isn't packaged yet
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
63 changelog = "https://github.com/OpenPrinting/foomatic-db-nonfree/blob/${finalAttrs.src.rev}/ChangeLog";
64 description = "OpenPrinting printer support database (unfree content)";
65 downloadPage = "https://www.openprinting.org/download/foomatic/";
66 homepage = "https://openprinting.github.io/projects/02-foomatic/";
67 license = lib.licenses.unfree;
68 maintainers = [ lib.maintainers.yarny ];
69 # list printer manufacturers here so people
70 # searching for ppd files can find this package
72 The collected knowledge about printers,
73 drivers, and driver options in XML files,
74 used by `foomatic-db-engine` to generate PPD files.
75 This is a package of PPD and Foomatic XML files
76 that may have restrictions that keep them
77 from being used on a variety of machines
78 for licensing and other non-technical reasons.
79 The XML files in this package enable `foomatic-db-ppds`
80 to create about 120 additional PPD files, for printer from
81 Dell, Genicom, Lexmark, Oce, Tektronix and Xerox.
82 Besides the XML files, this package contains
83 about 130 PPD files, for printers from
84 Dell, Genicom, Lexmark, Oce and Xerox.