summary refs log tree commit diff
diff options
context:
space:
mode:
authorhqurve <hqurve@outlook.com>2021-07-23 16:37:28 -0400
committerhqurve <hqurve@outlook.com>2021-07-24 14:58:36 -0400
commit1fa65a8865c3b6cb326d88b4d395a5fb27934ae2 (patch)
tree172ed01440002673aef6cfd67107f7be90a51433
parentf102bcee7d1f3f607ad502dfe346f4d4066e534a (diff)
downloadnixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar.gz
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar.bz2
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar.lz
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar.xz
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.tar.zst
nixpkgs-1fa65a8865c3b6cb326d88b4d395a5fb27934ae2.zip
pdfchain: init at 0.4.4.2
-rw-r--r--pkgs/tools/typesetting/pdfchain/default.nix56
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/tools/typesetting/pdfchain/default.nix b/pkgs/tools/typesetting/pdfchain/default.nix
new file mode 100644
index 00000000000..09122d60bc0
--- /dev/null
+++ b/pkgs/tools/typesetting/pdfchain/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, autoconf, gtkmm3, glib, pdftk, pkg-config, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pdfchain";
+  version = "0.4.4.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config wrapGAppsHook autoconf
+  ];
+
+  buildInputs = [
+    gtkmm3 pdftk glib
+  ];
+
+  patches = let
+    fetchDebianPatch = {name, sha256}: fetchpatch {
+      url = "https://salsa.debian.org/debian/pdfchain/raw/2d29107756a3194fb522bdea8e9b9e393b15a8f3/debian/patches/${name}";
+      inherit name sha256;
+    };
+  in
+  [
+    (fetchDebianPatch {
+      name = "fix_crash_on_startup";
+      sha256 = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw=";
+    })
+    (fetchDebianPatch {
+      name = "fix_desktop_file";
+      sha256 = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw=";
+    })
+    (fetchDebianPatch {
+      name = "fix_spelling";
+      sha256 = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace src/constant.h \
+        --replace '"pdftk"' '"${pdftk}/bin/pdftk"' \
+        --replace "/usr/share" "$out/share"
+  '';
+
+  meta = with lib; {
+    description = "A graphical user interface for the PDF Toolkit (PDFtk)";
+    homepage = "https://pdfchain.sourceforge.io";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ hqurve ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c15ef4e4414..c57095aff05 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26383,6 +26383,8 @@ in
     inherit (gnome2) libgnomecanvas;
   };
 
+  pdfchain = callPackage ../tools/typesetting/pdfchain { };
+
   pdfcpu = callPackage ../applications/graphics/pdfcpu { };
   pdftk = callPackage ../tools/typesetting/pdftk {
     jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731