blob: 9ecb87b86ff6520e7218beffd17b067510474b23 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
{ lib, stdenv, fetchFromGitLab, gradle, jre, runtimeShell }:
stdenv.mkDerivation rec {
pname = "pdftk";
version = "3.3.3";
src = fetchFromGitLab {
owner = "pdftk-java";
repo = "pdftk";
rev = "v${version}";
hash = "sha256-ciKotTHSEcITfQYKFZ6sY2LZnXGChBJy0+eno8B3YHY=";
};
nativeBuildInputs = [ gradle ];
mitmCache = gradle.fetchDeps {
inherit pname;
data = ./deps.json;
};
__darwinAllowLocalNetworking = true;
gradleFlags = [ "-Dfile.encoding=utf-8" ];
gradleBuildTask = "shadowJar";
installPhase = ''
mkdir -p $out/{bin,share/pdftk,share/man/man1}
cp build/libs/pdftk-all.jar $out/share/pdftk
cat << EOF > $out/bin/pdftk
#!${runtimeShell}
exec ${jre}/bin/java -jar "$out/share/pdftk/pdftk-all.jar" "\$@"
EOF
chmod a+x "$out/bin/pdftk"
cp ${src}/pdftk.1 $out/share/man/man1
'';
meta = with lib; {
description = "Command-line tool for working with PDFs";
homepage = "https://gitlab.com/pdftk-java/pdftk";
sourceProvenance = with sourceTypes; [
fromSource
binaryBytecode # deps
];
license = licenses.gpl2Plus;
maintainers = with maintainers; [ raskin averelld ];
platforms = platforms.unix;
mainProgram = "pdftk";
};
}
|