9 stdenv.mkDerivation rec {
10 pname = "cups-pdf-to-pdf";
11 version = "unstable-2021-12-22";
13 src = fetchFromGitHub {
15 repo = "CUPS-PDF-to-PDF";
16 rev = "c14428c2ca8e95371daad7db6d11c84046b1a2d4";
17 hash = "sha256-pa4PFf8OAFSra0hSazmKUfbMYL/cVWvYA1lBf7c7jmY=";
20 buildInputs = [ cups ];
23 sed -r 's|(gscall, size, ")cp |\1${coreutils}/bin/cp |' cups-pdf.c -i
26 # gcc command line is taken from original cups-pdf's README file
27 # https://fossies.org/linux/cups-pdf/README
28 # however, we replace gcc with $CC following
29 # https://nixos.org/manual/nixpkgs/stable/#sec-darwin
32 $CC -O9 -s cups-pdf.c -o cups-pdf -lcups
38 install -Dt $out/lib/cups/backend cups-pdf
39 install -Dm 0644 -t $out/etc/cups cups-pdf.conf
40 install -Dm 0644 -t $out/share/cups/model *.ppd
44 passthru.tests.vmtest = nixosTests.cups-pdf;
47 description = "CUPS backend that turns print jobs into searchable PDF files";
48 homepage = "https://github.com/alexivkin/CUPS-PDF-to-PDF";
49 license = licenses.gpl2Only;
50 maintainers = [ maintainers.yarny ];
52 cups-pdf is a CUPS backend that generates a PDF file for each print job and puts this file
53 into a folder on the local machine such that the print job's owner can access the file.
55 https://www.cups-pdf.de/
57 cups-pdf-to-pdf is a fork of cups-pdf which tries hard to preserve the original text of the print job by avoiding rasterization.
59 Note that in order to use this package, you have to make sure that the cups-pdf program is called with root privileges.