diff options
Diffstat (limited to 'pkgs/by-name/ba/batik/package.nix')
-rw-r--r-- | pkgs/by-name/ba/batik/package.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/by-name/ba/batik/package.nix b/pkgs/by-name/ba/batik/package.nix new file mode 100644 index 0000000000000..18bdb7c37e195 --- /dev/null +++ b/pkgs/by-name/ba/batik/package.nix @@ -0,0 +1,55 @@ +{ + lib, + stdenvNoCC, + fetchurl, + jre, + rhino, + stripJavaArchivesHook, + makeWrapper, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "batik"; + version = "1.17"; + + src = fetchurl { + url = "mirror://apache/xmlgraphics/batik/binaries/batik-bin-${finalAttrs.version}.tar.gz"; + hash = "sha256-sEJphF3grlwZCEt3gHHm4JF8RpvKKBLLvKXf2lu/dhA="; + }; + + nativeBuildInputs = [ + stripJavaArchivesHook + makeWrapper + ]; + + buildInputs = [ + jre + rhino + ]; + + patchPhase = '' + # Vendored dependencies + rm lib/rhino-*.jar + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/java + cp *.jar lib/*.jar $out/share/java + chmod +x $out/share/java/*.jar + classpath="$(find $out/share/java -name '*.jar' -printf '${rhino}/share/java/js.jar:%h/%f')" + for appName in rasterizer slideshow squiggle svgpp ttf2svg; do + makeWrapper ${lib.getExe jre} $out/bin/batik-$appName \ + --add-flags "-jar $out/share/java/batik-all-${finalAttrs.version}.jar" \ + --add-flags "-classpath $classpath" \ + --add-flags "org.apache.batik.apps.$appName.Main" + done + ''; + + meta = with lib; { + description = "Java based toolkit for handling SVG"; + homepage = "https://xmlgraphics.apache.org/batik"; + license = licenses.asl20; + platforms = platforms.unix; + sourceProvenance = with sourceTypes; [ binaryBytecode ]; + }; +}) |