Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / pdfdiff / default.nix
blobc80396840e4109df56234a31d2477f27c262da05
1 { lib
2 , fetchFromGitHub
3 , python3Packages
4 , xpdf
5 }:
7 python3Packages.buildPythonApplication rec {
8   pname = "pdfdiff";
9   version = "0.93";
11   src = fetchFromGitHub {
12     owner = "cascremers";
13     repo = "pdfdiff";
14     rev = version;
15     hash = "sha256-NPki/PFm0b71Ksak1mimR4w6J2a0jBCbQDTMQR4uZFI=";
16   };
18   format = "other";
20   dontConfigure = true;
21   dontBuild = true;
22   doCheck = false;
24   postPatch = ''
25     substituteInPlace pdfdiff.py \
26       --replace 'pdftotextProgram = "pdftotext"' 'pdftotextProgram = "${xpdf}/bin/pdftotext"' \
27       --replace 'progName = "pdfdiff.py"' 'progName = "pdfdiff"'
28     '';
30   installPhase = ''
31     mkdir -p $out/bin
32     cp pdfdiff.py $out/bin/pdfdiff
33     chmod +x $out/bin/pdfdiff
34     '';
36   meta = with lib; {
37     homepage = "https://github.com/cascremers/pdfdiff";
38     description = "Tool to view the difference between two PDF or PS files";
39     license = licenses.gpl2Plus;
40     platforms = platforms.linux;
41   };