summary refs log tree commit diff
path: root/pkgs/applications/misc/tabula-java/default.nix
blob: 0b0163b054d7d6acac3c9144b6b1f64060355846 (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
{ stdenv, lib, fetchurl, jre, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "tabula-java";
  version = "1.0.5";

  src = fetchurl {
    url = "https://github.com/tabulapdf/tabula-java/releases/download/v${version}/tabula-${version}-jar-with-dependencies.jar";
    sha256 = "sha256-IWHj//ZZOdfOCBJHnPnKNoYNtWl/f8H6ARYe1AkqB0U=";
  };

  buildInputs = [ makeWrapper ];

  dontUnpack = true;
  dontBuild = true;

  installPhase = ''
    mkdir -pv $out/share/tabula-java
    cp -v $src $out/share/tabula-java/tabula-java.jar

    makeWrapper ${jre}/bin/java $out/bin/tabula-java --add-flags "-jar $out/share/tabula-java/tabula-java.jar"
  '';

  meta = with lib; {
    description = "A library for extracting tables from PDF files.";
    longDescription = ''
      tabula-java is the table extraction engine that powers
      Tabula. You can use tabula-java as a command-line tool to
      programmatically extract tables from PDFs.
    '';
    homepage = "https://tabula.technology/";
    sourceProvenance = with sourceTypes; [ binaryBytecode ];
    license = licenses.mit;
    maintainers = [ maintainers.jakewaksbaum ];
    platforms = platforms.all;
  };
}