2022-01-19 23:45:15 +00:00
|
|
|
{ lib, python2Packages, fetchurl, xpdf }:
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
python2Packages.buildPythonApplication rec {
|
|
|
|
pname = "pdfdiff";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "0.92";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.cs.ox.ac.uk/people/cas.cremers/downloads/software/pdfdiff.py";
|
|
|
|
sha256 = "0zxwjjbklz87wkbhkmsvhc7xmv5php7m2a9vm6ydhmhlxsybf836";
|
|
|
|
};
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
buildInputs = [ python2Packages.wrapPython ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
substituteInPlace $out/bin/pdfdiff --replace "#!/usr/bin/python" "#!${python2Packages.python.interpreter}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.cs.ox.ac.uk/people/cas.cremers/misc/pdfdiff.html";
|
|
|
|
description = "Tool to view the difference between two PDF or PS files";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|