mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
63 lines
1.8 KiB
Nix
63 lines
1.8 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cups
|
|
, coreutils
|
|
, nixosTests
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "cups-pdf-to-pdf";
|
|
version = "unstable-2021-12-22";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "alexivkin";
|
|
repo = "CUPS-PDF-to-PDF";
|
|
rev = "c14428c2ca8e95371daad7db6d11c84046b1a2d4";
|
|
hash = "sha256-pa4PFf8OAFSra0hSazmKUfbMYL/cVWvYA1lBf7c7jmY=";
|
|
};
|
|
|
|
buildInputs = [ cups ];
|
|
|
|
postPatch = ''
|
|
sed -r 's|(gscall, size, ")cp |\1${coreutils}/bin/cp |' cups-pdf.c -i
|
|
'';
|
|
|
|
# gcc command line is taken from original cups-pdf's README file
|
|
# https://fossies.org/linux/cups-pdf/README
|
|
# however, we replace gcc with $CC following
|
|
# https://nixos.org/manual/nixpkgs/stable/#sec-darwin
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
$CC -O9 -s cups-pdf.c -o cups-pdf -lcups
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -Dt $out/lib/cups/backend cups-pdf
|
|
install -Dm 0644 -t $out/etc/cups cups-pdf.conf
|
|
install -Dm 0644 -t $out/share/cups/model *.ppd
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.tests.vmtest = nixosTests.cups-pdf;
|
|
|
|
meta = with lib; {
|
|
description = "CUPS backend that turns print jobs into searchable PDF files";
|
|
homepage = "https://github.com/alexivkin/CUPS-PDF-to-PDF";
|
|
license = licenses.gpl2Only;
|
|
maintainers = [ maintainers.yarny ];
|
|
longDescription = ''
|
|
cups-pdf is a CUPS backend that generates a PDF file for each print job and puts this file
|
|
into a folder on the local machine such that the print job's owner can access the file.
|
|
|
|
https://www.cups-pdf.de/
|
|
|
|
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.
|
|
|
|
Note that in order to use this package, you have to make sure that the cups-pdf program is called with root privileges.
|
|
'';
|
|
};
|
|
}
|