diff --git a/pkgs/applications/misc/pdfdiff/default.nix b/pkgs/applications/misc/pdfdiff/default.nix index e21b06bf25ca..c80396840e41 100644 --- a/pkgs/applications/misc/pdfdiff/default.nix +++ b/pkgs/applications/misc/pdfdiff/default.nix @@ -1,37 +1,40 @@ -{ lib, python2Packages, fetchurl, xpdf }: +{ lib +, fetchFromGitHub +, python3Packages +, xpdf +}: -python2Packages.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "pdfdiff"; - version = "0.92"; + version = "0.93"; - src = fetchurl { - url = "https://www.cs.ox.ac.uk/people/cas.cremers/downloads/software/pdfdiff.py"; - sha256 = "0zxwjjbklz87wkbhkmsvhc7xmv5php7m2a9vm6ydhmhlxsybf836"; + src = fetchFromGitHub { + owner = "cascremers"; + repo = "pdfdiff"; + rev = version; + hash = "sha256-NPki/PFm0b71Ksak1mimR4w6J2a0jBCbQDTMQR4uZFI="; }; - buildInputs = [ python2Packages.wrapPython ]; + format = "other"; dontConfigure = true; dontBuild = true; 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 + substituteInPlace pdfdiff.py \ + --replace 'pdftotextProgram = "pdftotext"' 'pdftotextProgram = "${xpdf}/bin/pdftotext"' \ + --replace 'progName = "pdfdiff.py"' 'progName = "pdfdiff"' ''; installPhase = '' mkdir -p $out/bin cp pdfdiff.py $out/bin/pdfdiff chmod +x $out/bin/pdfdiff - - substituteInPlace $out/bin/pdfdiff --replace "#!/usr/bin/python" "#!${python2Packages.python.interpreter}" ''; meta = with lib; { - homepage = "http://www.cs.ox.ac.uk/people/cas.cremers/misc/pdfdiff.html"; + homepage = "https://github.com/cascremers/pdfdiff"; description = "Tool to view the difference between two PDF or PS files"; license = licenses.gpl2Plus; platforms = platforms.linux;