1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 01:20:40 +00:00
nixpkgs/pkgs/applications/misc/diffpdf/default.nix
Will Dietz 2286c9b315 diffpdf: move to using qt5
Patch is used by Gentoo, Debian, etc.
2018-02-09 07:04:37 -06:00

61 lines
1.9 KiB
Nix

{ stdenv, fetchurl, fetchpatch, qmake, qttools, qtbase, poppler_qt5 }:
stdenv.mkDerivation rec {
version = "2.1.3";
name = "diffpdf-${version}";
src = fetchurl {
url = "http://www.qtrac.eu/${name}.tar.gz";
sha256 = "0cr468fi0d512jjj23r5flfzx957vibc9c25gwwhi0d773h2w566";
};
patches = [
(fetchpatch {
url = https://raw.githubusercontent.com/gentoo/gentoo/9b971631588ff46e7c2d501bc35cd0d9ce2d98e2/app-text/diffpdf/files/diffpdf-2.1.3-qt5.patch;
sha256 = "0sax8gcqcmzf74hmdr3rarqs4nsxmml9qmh6pqyjmgl3lypxhafg";
})
./fix_path_poppler_qt5.patch
];
nativeBuildInputs = [ qmake qttools ];
buildInputs = [ qtbase poppler_qt5 ];
preConfigure = ''
substituteInPlace diffpdf.pro --replace @@NIX_POPPLER_QT5@@ ${poppler_qt5.dev}
lrelease diffpdf.pro
'';
installPhase = ''
mkdir -p $out/bin $out/share/man/man1
install -Dpm755 -D diffpdf $out/bin/diffpdf
install -Dpm644 -D diffpdf.1 $out/share/man/man1/diffpdf.1
install -dpm755 $out/share/doc/${name} $out/share/licenses/${name} $out/share/icons $out/share/pixmaps $out/share/applications
install -Dpm644 CHANGES README help.html $out/share/doc/${name}/
install -Dpm644 gpl-2.0.txt $out/share/licenses/${name}/
install -Dpm644 images/icon.png $out/share/icons/diffpdf.png
install -Dpm644 images/icon.png $out/share/pixmaps/diffpdf.png
cat > $out/share/applications/diffpdf.desktop <<EOF
[Desktop Entry]
Type=Application
Version=1.0
Name=diffpdf
Icon=diffpdf
Comment=PDF diffing tool
Exec=$out/bin/diffpdf
Terminal=false
EOF
'';
meta = {
homepage = http://www.qtrac.eu/diffpdfc.html;
description = "Tool for diffing pdf files visually or textually";
license = stdenv.lib.licenses.gpl2Plus;
maintainers = with stdenv.lib.maintainers; [ tstrobel ];
platforms = with stdenv.lib.platforms; linux;
inherit version;
};
}