2021-01-25 08:26:54 +00:00
|
|
|
{ lib, pythonPackages, fetchurl, xpdf }:
|
2015-07-07 23:22:57 +01:00
|
|
|
let
|
|
|
|
py = pythonPackages;
|
|
|
|
in
|
2016-02-19 12:12:11 +00:00
|
|
|
py.buildPythonApplication rec {
|
2015-07-07 23:22:57 +01:00
|
|
|
name = "pdfdiff-${version}";
|
|
|
|
version = "0.92";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.cs.ox.ac.uk/people/cas.cremers/downloads/software/pdfdiff.py";
|
2015-07-07 23:22:57 +01:00
|
|
|
sha256 = "0zxwjjbklz87wkbhkmsvhc7xmv5php7m2a9vm6ydhmhlxsybf836";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ pythonPackages.wrapPython ];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "patchPhase" "installPhase" ];
|
|
|
|
|
|
|
|
unpackPhase = "cp $src pdfdiff.py";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -r 's|pdftotextProgram = "pdftotext"|pdftotextProgram = "${xpdf}/bin/pdftotext"|' pdfdiff.py
|
|
|
|
sed -i -r 's|progName = "pdfdiff.py"|progName = "pdfdiff"|' pdfdiff.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp pdfdiff.py $out/bin/pdfdiff
|
|
|
|
chmod +x $out/bin/pdfdiff
|
|
|
|
|
|
|
|
substituteInPlace $out/bin/pdfdiff --replace "#!/usr/bin/python" "#!${pythonPackages.python.interpreter}"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.cs.ox.ac.uk/people/cas.cremers/misc/pdfdiff.html";
|
2015-07-07 23:22:57 +01:00
|
|
|
description = "Tool to view the difference between two PDF or PS files";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|