nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchDebianPatch,
6 autoconf,
7 gtkmm3,
8 glib,
9 pdftk,
10 pkg-config,
11 wrapGAppsHook3,
12}:
13
14stdenv.mkDerivation rec {
15 pname = "pdfchain";
16 version = "0.4.4.2";
17
18 src = fetchurl {
19 url = "mirror://sourceforge/${pname}/${pname}-${version}/${pname}-${version}.tar.gz";
20 hash = "sha256-Hu4Pk9voyc75+f5OwKEOCkXKjN5nzWzv+izmyEN1Lz0=";
21 };
22
23 nativeBuildInputs = [
24 pkg-config
25 wrapGAppsHook3
26 autoconf
27 ];
28
29 buildInputs = [
30 gtkmm3
31 pdftk
32 glib
33 ];
34
35 patches =
36 let
37 fetchDebianPatch' =
38 args:
39 fetchDebianPatch (
40 {
41 inherit pname;
42 version = "1:0.4.4.2";
43 debianRevision = "2";
44 }
45 // args
46 );
47 in
48 [
49 (fetchDebianPatch' {
50 patch = "fix_crash_on_startup";
51 hash = "sha256-1UyMHHGrmUIFhY53ILdMMsyocSIbcV6CKQ7sLVNhNQw=";
52 })
53 (fetchDebianPatch' {
54 patch = "fix_desktop_file";
55 hash = "sha256-L6lhUs7GqVN1XOQO6bbz6BT29n4upsJtlHCAIGzk1Bw=";
56 })
57 (fetchDebianPatch' {
58 patch = "fix_spelling";
59 hash = "sha256-sOUUslPfcOo2K3zuaLcux+CNdgfWM0phsfe6g4GUFes=";
60 })
61 ];
62
63 postPatch = ''
64 substituteInPlace src/constant.h \
65 --replace '"pdftk"' '"${pdftk}/bin/pdftk"' \
66 --replace "/usr/share" "$out/share"
67 '';
68
69 meta = {
70 description = "Graphical user interface for the PDF Toolkit (PDFtk)";
71 homepage = "https://pdfchain.sourceforge.io";
72 license = lib.licenses.gpl3Plus;
73 maintainers = with lib.maintainers; [ hqurve ];
74 platforms = lib.platforms.unix;
75 mainProgram = "pdfchain";
76 };
77}