34 binPath = lib.makeBinPath [ bc coreutils gawk gnused gnugrep which ];
37 stdenv.mkDerivation rec {
38 pname = "cups-filters";
42 url = "https://github.com/OpenPrinting/cups-filters/releases/download/${version}/${pname}-${version}.tar.xz";
43 hash = "sha256-Jwo3UqlgNoqpnUMftdNPQDmyrJQ8V22EBhLR2Bhcm7k=";
48 name = "CVE-2023-24805.patch";
49 url = "https://github.com/OpenPrinting/cups-filters/commit/93e60d3df358c0ae6f3dba79e1c9684657683d89.patch";
50 hash = "sha256-KgWTYFr2uShL040azzE+KaNyBPy7Gs/hCnEgQmmPCys=";
53 name = "CVE-2024-47076.patch";
54 url = "https://github.com/OpenPrinting/libcupsfilters/commit/95576ec3d20c109332d14672a807353cdc551018.patch";
55 hash = "sha256-MXWllrdWt8n7zqvumQNg34dBgWMwMTwf9lrD+ZZP8Wk=";
58 name = "remove-cups-ldap-browse-protocols_CVE-2024-47176_CVE-2024-47850.patch";
59 url = "https://github.com/OpenPrinting/cups-filters/commit/6fd2bdfbdce76149af531ce9fca9062304238451.patch";
60 hash = "sha256-XS1ODy7i7ilgEjsKuEvOUiRN9pqsj+bOktKoshKcg8Q=";
64 nativeBuildInputs = [ pkg-config makeWrapper autoreconfHook ];
74 liblouis # braille embosser support
81 ] ++ lib.optionals withAvahi [ avahi ];
84 "--with-mutool-path=${mupdf}/bin/mutool"
85 "--with-pdftops=pdftops"
86 "--with-pdftops-path=${poppler_utils}/bin/pdftops"
87 "--with-gs-path=${ghostscript}/bin/gs"
88 "--with-pdftocairo-path=${poppler_utils}/bin/pdftocairo"
89 "--with-ippfind-path=${cups}/bin/ippfind"
90 "--enable-imagefilters"
92 "--with-shell=${stdenv.shell}"
93 "--with-test-font-path=${dejavu_fonts}/share/fonts/truetype/DejaVuSans.ttf"
94 "--localstatedir=/var"
96 ] ++ lib.optionals (!withAvahi) [ "--disable-avahi" ];
98 makeFlags = [ "CUPS_SERVERBIN=$(out)/lib/cups" "CUPS_DATADIR=$(out)/share/cups" "CUPS_SERVERROOT=$(out)/etc/cups" ];
100 # https://github.com/OpenPrinting/cups-filters/issues/512
101 env.NIX_CFLAGS_COMPILE = "-std=c++17";
105 # Ensure that bannertopdf can find the PDF templates in
106 # $out. (By default, it assumes that cups and cups-filters are
107 # installed in the same prefix.)
108 substituteInPlace config.h --replace ${cups.out}/share/cups/data $out/share/cups/data
110 # Ensure that gstoraster can find gs in $PATH.
111 substituteInPlace filter/gstoraster.c --replace execve execvpe
113 # Patch shebangs of generated build scripts
119 for i in $out/lib/cups/filter/*; do
120 wrapProgram "$i" --prefix PATH ':' ${binPath}
124 enableParallelBuilding = true;
128 homepage = "http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters";
129 description = "Backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc";
130 license = lib.licenses.gpl2Plus;
131 platforms = lib.platforms.linux;