Unbork journals audit logs and introduce audit option (#379629)
[NixPkgs.git] / pkgs / by-name / fo / foomatic-db-nonfree / package.nix
blob6d52b503b501ba668c6114340f34ecb8d02a8b9c
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   autoconf,
6   automake,
7   perl,
8 }:
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=";
21   };
23   nativeBuildInputs = [
24     autoconf
25     automake
26     perl
27   ];
29   # sed-substitute indirection is more robust against
30   # characters in paths that might need escaping
31   postPatch = ''
32     sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g'  \
33       -e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac
34     substituteInPlace configure.ac  \
35       --subst-var PATH  \
36       --subst-var-by DATA "${placeholder "out"}/share"
37   '';
39   preConfigure = ''
40     mkdir -p "${placeholder "out"}/share/foomatic/db/source"
41     ./make_configure
42   '';
44   # make ppd files available to cups,
45   # use a package-specific subdirectory to avoid
46   # conflicts with other ppd-containing packages
47   postInstall = ''
48     if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then
49         echo "failed to create share/foomatic/db/source/PPD"
50         exit 1
51     fi
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"
55   '';
57   # we might patch ppd file commands with `patchPpdFilesHook`,
58   # but the only command "rastertophaser6100" isn't packaged yet
60   # compress ppd files
61   postFixup = ''
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
65   '';
67   meta = {
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
76     longDescription = ''
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.
90     '';
91   };