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


stdenv.mkDerivation rec {
  name = "tabula-${version}";
  version = "1.2.1";


  src = fetchzip {
    url = "https://github.com/tabulapdf/tabula/releases/download/v${version}/tabula-jar-${version}.zip";
    sha256 = "0lkpv8hkji81fanyxm7ph8421fr9a6phqc3pbhw2bc4gljg7sgxi";
  };


  buildInputs = [ makeWrapper ];


  installPhase = ''
    mkdir -pv $out/share/tabula
    cp -v * $out/share/tabula

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


  meta = with stdenv.lib; {
    description = "A tool for liberating data tables locked inside PDF files";
    longDescription = ''
      If you’ve ever tried to do anything with data provided to you in PDFs, you
      know how painful it is — there's no easy way to copy-and-paste rows of data
      out of PDF files. Tabula allows you to extract that data into a CSV or
      Microsoft Excel spreadsheet using a simple, easy-to-use interface.
    '';
    homepage = https://tabula.technology/;
    license = licenses.mit;
    maintainers = [ maintainers.dpaetzel ];
    platforms = platforms.all;
  };
}