Loading nixos/tests/all-tests.nix +1 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ in crabfit = handleTest ./crabfit.nix { }; cri-o = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./cri-o.nix { }; cryptpad = runTest ./cryptpad.nix; cups-pdf = handleTest ./cups-pdf.nix { }; cups-pdf = runTest ./cups-pdf.nix; curl-impersonate = handleTest ./curl-impersonate.nix { }; custom-ca = handleTest ./custom-ca.nix { }; croc = handleTest ./croc.nix { }; Loading nixos/tests/cups-pdf.nix +40 −42 Original line number Diff line number Diff line import ./make-test-python.nix ( { lib, pkgs, ... }: { hostPkgs, lib, ... }: { name = "cups-pdf"; Loading Loading @@ -38,10 +37,9 @@ import ./make-test-python.nix ( machine.wait_until_succeeds(f"su - alice -c 'pdfinfo /var/spool/cups-pdf-{name}/users/alice/*.pdf'") machine.succeed(f"cp /var/spool/cups-pdf-{name}/users/alice/*.pdf /tmp/{name}.pdf") machine.copy_from_vm(f"/tmp/{name}.pdf", "") run(f"${pkgs.imagemagickBig}/bin/convert -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True) assert text.encode() in run(f"${lib.getExe pkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout run(f"${lib.getExe hostPkgs.imagemagickBig} -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True) assert text.encode() in run(f"${lib.getExe hostPkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout ''; meta.maintainers = [ lib.maintainers.yarny ]; } ) pkgs/by-name/cu/cups-pdf-to-pdf/package.nix +5 −4 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ stdenv.mkDerivation { buildInputs = [ cups ]; postPatch = '' sed -r 's|(gscall, size, ")cp |\1${coreutils}/bin/cp |' cups-pdf.c -i substituteInPlace cups-pdf.c \ --replace-fail '"cp ' '"${lib.getExe' coreutils "cp"} ' ''; # gcc command line is taken from original cups-pdf's README file Loading @@ -44,11 +45,11 @@ stdenv.mkDerivation { passthru.tests.vmtest = nixosTests.cups-pdf; meta = with lib; { meta = { 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 ]; license = lib.licenses.gpl2Only; maintainers = [ lib.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. Loading Loading
nixos/tests/all-tests.nix +1 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ in crabfit = handleTest ./crabfit.nix { }; cri-o = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./cri-o.nix { }; cryptpad = runTest ./cryptpad.nix; cups-pdf = handleTest ./cups-pdf.nix { }; cups-pdf = runTest ./cups-pdf.nix; curl-impersonate = handleTest ./curl-impersonate.nix { }; custom-ca = handleTest ./custom-ca.nix { }; croc = handleTest ./croc.nix { }; Loading
nixos/tests/cups-pdf.nix +40 −42 Original line number Diff line number Diff line import ./make-test-python.nix ( { lib, pkgs, ... }: { hostPkgs, lib, ... }: { name = "cups-pdf"; Loading Loading @@ -38,10 +37,9 @@ import ./make-test-python.nix ( machine.wait_until_succeeds(f"su - alice -c 'pdfinfo /var/spool/cups-pdf-{name}/users/alice/*.pdf'") machine.succeed(f"cp /var/spool/cups-pdf-{name}/users/alice/*.pdf /tmp/{name}.pdf") machine.copy_from_vm(f"/tmp/{name}.pdf", "") run(f"${pkgs.imagemagickBig}/bin/convert -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True) assert text.encode() in run(f"${lib.getExe pkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout run(f"${lib.getExe hostPkgs.imagemagickBig} -density 300 $out/{name}.pdf $out/{name}.jpeg", shell=True, check=True) assert text.encode() in run(f"${lib.getExe hostPkgs.tesseract} $out/{name}.jpeg stdout", shell=True, check=True, capture_output=True).stdout ''; meta.maintainers = [ lib.maintainers.yarny ]; } )
pkgs/by-name/cu/cups-pdf-to-pdf/package.nix +5 −4 Original line number Diff line number Diff line Loading @@ -21,7 +21,8 @@ stdenv.mkDerivation { buildInputs = [ cups ]; postPatch = '' sed -r 's|(gscall, size, ")cp |\1${coreutils}/bin/cp |' cups-pdf.c -i substituteInPlace cups-pdf.c \ --replace-fail '"cp ' '"${lib.getExe' coreutils "cp"} ' ''; # gcc command line is taken from original cups-pdf's README file Loading @@ -44,11 +45,11 @@ stdenv.mkDerivation { passthru.tests.vmtest = nixosTests.cups-pdf; meta = with lib; { meta = { 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 ]; license = lib.licenses.gpl2Only; maintainers = [ lib.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. Loading