nixpkgs/pkgs/by-name/ta/tabula-java/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

51 lines
1.3 KiB
Nix

{ lib
, maven
, fetchFromGitHub
, makeWrapper
, jre
}:
maven.buildMavenPackage rec {
pname = "tabula-java";
version = "1.0.5";
src = fetchFromGitHub {
owner = "tabulapdf";
repo = "tabula-java";
rev = "v${version}";
hash = "sha256-lg8/diyGhfkUU0w7PEOlxb1WNpJZVDDllxMMsTIU/Cw=";
};
mvnHash = "sha256-CXJm9YlYsYViChFcH9e2P9pxK0q/tLWODOzZPXZ8hK0=";
mvnParameters = "compile assembly:single -Dmaven.test.skip=true";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib}
cp target/tabula-${version}-jar-with-dependencies.jar $out/lib/tabula.jar
makeWrapper ${jre}/bin/java $out/bin/tabula-java \
--add-flags "-cp $out/lib/tabula.jar" \
--add-flags "technology.tabula.CommandLineApp"
runHook postInstall
'';
meta = with lib; {
description = "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/";
license = licenses.mit;
maintainers = [ maintainers.jakewaksbaum ];
platforms = platforms.all;
mainProgram = "tabula-java";
};
}