nixpkgs/pkgs/by-name/pd/pdfsandwich/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
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.
2024-11-09 20:04:51 +08:00

34 lines
979 B
Nix

{ lib, stdenv, ocaml, makeWrapper, fetchsvn, ghostscript, imagemagick, perl, poppler_utils, tesseract, unpaper }:
stdenv.mkDerivation {
version = "0.1.7";
pname = "pdfsandwich";
src = fetchsvn {
url = "svn://svn.code.sf.net/p/pdfsandwich/code/trunk/src";
rev = "75";
sha256 = "1420c33divch087xrr61lvyf975bapqkgjqaighl581i69nlzsm6";
};
strictDeps = true;
nativeBuildInputs = [ makeWrapper ocaml perl ];
installPhase = ''
mkdir -p $out/bin
cp -p pdfsandwich $out/bin
wrapProgram $out/bin/pdfsandwich --prefix PATH : ${lib.makeBinPath [ imagemagick ghostscript poppler_utils unpaper tesseract ]}
mkdir -p $out/man/man1
cp -p pdfsandwich.1.gz $out/man/man1
'';
meta = with lib; {
description = "OCR tool for scanned PDFs";
homepage = "http://www.tobias-elze.de/pdfsandwich/";
license = licenses.gpl2Plus;
maintainers = [ maintainers.rps ];
platforms = platforms.linux;
mainProgram = "pdfsandwich";
};
}