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