about summary refs log tree commit diff
path: root/pkgs/applications/misc/diffpdf
diff options
context:
space:
mode:
authorThomas Strobel <ts468@cam.ac.uk>2015-07-07 23:32:54 +0200
committerThomas Strobel <ts468@cam.ac.uk>2015-07-07 23:32:54 +0200
commit528fae6dd304ac3c2db4e49fa894b9c7ef575d08 (patch)
treef8a514463d0f6fbeb78cc18612e7f56ce495231e /pkgs/applications/misc/diffpdf
parent08ff83eab3ade9c923e36f03bc09d297bbe5e9f3 (diff)
downloadnixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar.gz
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar.bz2
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar.lz
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar.xz
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.tar.zst
nixlib-528fae6dd304ac3c2db4e49fa894b9c7ef575d08.zip
diffpdf: init at 2.1.3
Diffstat (limited to 'pkgs/applications/misc/diffpdf')
-rw-r--r--pkgs/applications/misc/diffpdf/default.nix53
-rw-r--r--pkgs/applications/misc/diffpdf/fix_path_poppler_qt4.patch16
2 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/applications/misc/diffpdf/default.nix b/pkgs/applications/misc/diffpdf/default.nix
new file mode 100644
index 000000000000..88952f5eb761
--- /dev/null
+++ b/pkgs/applications/misc/diffpdf/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchurl, qt4, poppler_qt4 }:
+
+stdenv.mkDerivation rec {
+  version = "2.1.3";
+  name = "diffpdf-${version}";
+
+  src = fetchurl {
+    url = "http://www.qtrac.eu/${name}.tar.gz";
+    sha256 = "0cr468fi0d512jjj23r5flfzx957vibc9c25gwwhi0d773h2w566";
+  };
+
+  patches = [ ./fix_path_poppler_qt4.patch ];
+
+  buildInputs = [ qt4 poppler_qt4 ];
+
+  preBuild = ''
+    substituteInPlace diffpdf.pro --replace @@NIX_POPPLER_QT4@@ ${poppler_qt4}
+    [ -e "*.qm" ] && make clean
+    lrelease diffpdf.pro
+    qmake -makefile PREFIX=\$out
+    '';
+
+  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/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/pixmaps/${name}.png
+
+    cat > $out/share/applications/diffpdf.desktop <<EOF
+    [Desktop Entry]
+    Type=Application
+    Version=1.0
+    Name=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;
+  };
+}
diff --git a/pkgs/applications/misc/diffpdf/fix_path_poppler_qt4.patch b/pkgs/applications/misc/diffpdf/fix_path_poppler_qt4.patch
new file mode 100644
index 000000000000..e72cad8b7a25
--- /dev/null
+++ b/pkgs/applications/misc/diffpdf/fix_path_poppler_qt4.patch
@@ -0,0 +1,16 @@
+diff -uNr diffpdf-2.1.3/diffpdf.pro diffpdf-2.1.3-new/diffpdf.pro
+--- diffpdf-2.1.3/diffpdf.pro	2013-10-15 09:01:22.000000000 +0200
++++ diffpdf-2.1.3-new/diffpdf.pro	2015-07-07 23:13:36.445572148 +0200
+@@ -47,9 +47,9 @@
+ 	INCLUDEPATH += /c/poppler_lib/include/poppler/qt4
+ 	LIBS += -Wl,-rpath -Wl,/c/poppler_lib/bin -Wl,-L/c/poppler_lib/bin
+     } else {
+-	exists(/usr/include/poppler/qt4) {
+-	    INCLUDEPATH += /usr/include/poppler/cpp
+-	    INCLUDEPATH += /usr/include/poppler/qt4
++	exists(@@NIX_POPPLER_QT4@@/include/poppler/qt4) {
++	    INCLUDEPATH += @@NIX_POPPLER_QT4@@/include/poppler/cpp
++	    INCLUDEPATH += @@NIX_POPPLER_QT4@@/include/poppler/qt4
+ 	} else {
+ 	    INCLUDEPATH += /usr/local/include/poppler/cpp
+ 	    INCLUDEPATH += /usr/local/include/poppler/qt4