nixpkgs/pkgs/by-name/ba/batik/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.3 KiB
Nix
Raw Normal View History

2024-06-27 03:57:35 +00:00
{
lib,
stdenvNoCC,
2024-06-27 03:57:35 +00:00
fetchurl,
jre,
rhino,
stripJavaArchivesHook,
makeWrapper,
2024-06-27 03:57:35 +00:00
}:
stdenvNoCC.mkDerivation (finalAttrs: {
2020-11-14 20:35:40 +00:00
pname = "batik";
2024-10-13 21:56:46 +00:00
version = "1.18";
2020-11-14 20:35:40 +00:00
src = fetchurl {
url = "mirror://apache/xmlgraphics/batik/binaries/batik-bin-${finalAttrs.version}.tar.gz";
2024-10-13 21:56:46 +00:00
hash = "sha256-k2kC/441o0qizY9nwbWJh3Hv45FJeuDgrhynPhvZg0Y=";
};
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; {
2018-08-22 21:40:22 +00:00
description = "Java based toolkit for handling SVG";
homepage = "https://xmlgraphics.apache.org/batik";
2018-08-22 21:40:22 +00:00
license = licenses.asl20;
platforms = platforms.unix;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
};
})