2024-06-27 03:57:35 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-06-28 06:00:58 +00:00
|
|
|
stdenvNoCC,
|
2024-06-27 03:57:35 +00:00
|
|
|
fetchurl,
|
2024-06-28 06:00:58 +00:00
|
|
|
jre,
|
|
|
|
rhino,
|
|
|
|
stripJavaArchivesHook,
|
|
|
|
makeWrapper,
|
2024-06-27 03:57:35 +00:00
|
|
|
}:
|
2005-09-07 14:57:30 +00:00
|
|
|
|
2024-06-28 06:00:58 +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
|
|
|
|
2005-09-07 14:57:30 +00:00
|
|
|
src = fetchurl {
|
2024-06-28 06:00:58 +00:00
|
|
|
url = "mirror://apache/xmlgraphics/batik/binaries/batik-bin-${finalAttrs.version}.tar.gz";
|
2024-10-13 21:56:46 +00:00
|
|
|
hash = "sha256-k2kC/441o0qizY9nwbWJh3Hv45FJeuDgrhynPhvZg0Y=";
|
2005-09-07 14:57:30 +00:00
|
|
|
};
|
|
|
|
|
2024-06-28 06:00:58 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-22 21:40:22 +00:00
|
|
|
description = "Java based toolkit for handling SVG";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://xmlgraphics.apache.org/batik";
|
2018-08-22 21:40:22 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
2022-09-24 11:58:44 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2016-08-02 16:06:29 +00:00
|
|
|
};
|
2024-06-28 06:00:58 +00:00
|
|
|
})
|