1{
2 lib,
3 maven,
4 fetchFromGitHub,
5 makeWrapper,
6 jre,
7}:
8
9maven.buildMavenPackage rec {
10 pname = "tabula-java";
11 version = "1.0.5";
12
13 src = fetchFromGitHub {
14 owner = "tabulapdf";
15 repo = "tabula-java";
16 rev = "v${version}";
17 hash = "sha256-lg8/diyGhfkUU0w7PEOlxb1WNpJZVDDllxMMsTIU/Cw=";
18 };
19
20 mvnHash = "sha256-CXJm9YlYsYViChFcH9e2P9pxK0q/tLWODOzZPXZ8hK0=";
21 mvnParameters = "compile assembly:single -Dmaven.test.skip=true";
22
23 nativeBuildInputs = [ makeWrapper ];
24
25 installPhase = ''
26 runHook preInstall
27
28 mkdir -p $out/{bin,lib}
29 cp target/tabula-${version}-jar-with-dependencies.jar $out/lib/tabula.jar
30
31 makeWrapper ${jre}/bin/java $out/bin/tabula-java \
32 --add-flags "-cp $out/lib/tabula.jar" \
33 --add-flags "technology.tabula.CommandLineApp"
34
35 runHook postInstall
36 '';
37
38 meta = with lib; {
39 description = "Library for extracting tables from PDF files";
40 longDescription = ''
41 tabula-java is the table extraction engine that powers
42 Tabula. You can use tabula-java as a command-line tool to
43 programmatically extract tables from PDFs.
44 '';
45 homepage = "https://tabula.technology/";
46 license = licenses.mit;
47 maintainers = [ maintainers.jakewaksbaum ];
48 platforms = platforms.all;
49 mainProgram = "tabula-java";
50 };
51}