summaryrefslogtreecommitdiff
path: root/libre/ditaa
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2016-03-05 21:30:55 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2016-03-05 21:30:55 -0500
commitbb0877fc7adeadbafe317a362153767ab3c0ccef (patch)
tree8c0d5a6e9b1d03be92691cc890d71f77058e9e54 /libre/ditaa
parent04f7aa23b718f50aeac285acee7e19f280303254 (diff)
downloadabslibre-bb0877fc7adeadbafe317a362153767ab3c0ccef.tar.gz
abslibre-bb0877fc7adeadbafe317a362153767ab3c0ccef.tar.bz2
abslibre-bb0877fc7adeadbafe317a362153767ab3c0ccef.zip
ditaa: add new package to [libre]
Diffstat (limited to 'libre/ditaa')
-rw-r--r--libre/ditaa/PKGBUILD43
-rw-r--r--libre/ditaa/ditaa-fix_imports.patch27
-rw-r--r--libre/ditaa/ditaa.sh3
3 files changed, 73 insertions, 0 deletions
diff --git a/libre/ditaa/PKGBUILD b/libre/ditaa/PKGBUILD
new file mode 100644
index 000000000..275554437
--- /dev/null
+++ b/libre/ditaa/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
+
+pkgname=ditaa
+pkgver=0.9
+pkgrel=2.parabola1
+pkgdesc='Java utility to convert diagrams drawn using ascii art to bitmap'
+arch=('any')
+url='http://ditaa.sf.net/'
+license=('GPL')
+depends=('java-environment' 'java-commons-cli' 'gsfonts')
+makedepends=('apache-ant' 'java-commons-cli' 'java-batik')
+source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname${pkgver/./_}-src.zip"
+ 'ditaa.sh' 'ditaa-fix_imports.patch')
+sha256sums=('0c6b92ddbeb435a1b0180b4728284e7d98e1bd94ec4619e73911875026ef63de'
+ '8640917f1241e26b3104e733b083eb099dc2b5be87e34348479130c3987e7883'
+ '4c24b233dca2ddd2c9a588f09b2aca421706daab68df3304f6ca4f4cd1a79372')
+
+prepare() {
+ rm -v lib/*.jar
+ patch -Np1 -i "${srcdir}/ditaa-fix_imports.patch"
+ mkdir -p bin
+}
+
+build() {
+ cd "${srcdir}/build"
+ ant -f release.xml release-jar \
+ -lib "/usr/share/java/batik-anim.jar" \
+ -lib "/usr/share/java/batik-awt-util.jar" \
+ -lib "/usr/share/java/batik-bridge.jar" \
+ -lib "/usr/share/java/batik-codec.jar" \
+ -lib "/usr/share/java/batik-dom.jar" \
+ -lib "/usr/share/java/batik-gvt.jar" \
+ -lib "/usr/share/java/batik-svg-dom.jar" \
+ -lib "/usr/share/java/commons-cli.jar" \
+ -lib "/usr/share/java/xml-apis-ext.jar"
+}
+
+package() {
+ install -Dm644 "${srcdir}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
+ install -Dm755 "releases/$pkgname${pkgver/./_}.jar" "$pkgdir/usr/share/java/$pkgname/ditaa-${pkgver/./_}.jar"
+ install -Dm755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
+ sed -i "s:VERSION:${pkgver/./_}:" "$pkgdir/usr/bin/$pkgname"
+}
diff --git a/libre/ditaa/ditaa-fix_imports.patch b/libre/ditaa/ditaa-fix_imports.patch
new file mode 100644
index 000000000..6db2c1e55
--- /dev/null
+++ b/libre/ditaa/ditaa-fix_imports.patch
@@ -0,0 +1,27 @@
+--- ditaa-0.9.orig/src/org/stathissideris/ascii2image/graphics/ImageHandler.java 2009-11-12 22:32:30.000000000 -0500
++++ ditaa-0.9/src/org/stathissideris/ascii2image/graphics/ImageHandler.java 2016-03-05 19:04:12.782829526 -0500
+@@ -43,10 +43,10 @@
+ import org.apache.batik.bridge.BridgeContext;
+ import org.apache.batik.bridge.GVTBuilder;
+ import org.apache.batik.bridge.UserAgentAdapter;
+-import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
++import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
+ import org.apache.batik.dom.util.DocumentFactory;
+-import org.apache.batik.ext.awt.image.codec.PNGEncodeParam;
+-import org.apache.batik.ext.awt.image.codec.PNGImageEncoder;
++import org.apache.batik.ext.awt.image.codec.png.PNGEncodeParam;
++import org.apache.batik.ext.awt.image.codec.png.PNGImageEncoder;
+ import org.apache.batik.gvt.GraphicsNode;
+ import org.apache.batik.gvt.renderer.ConcreteImageRendererFactory;
+ import org.apache.batik.gvt.renderer.ImageRenderer;
+--- ditaa-0.9.orig/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java 2009-11-12 22:32:30.000000000 -0500
++++ ditaa-0.9/src/org/stathissideris/ascii2image/graphics/OffScreenSVGRenderer.java 2016-03-05 19:04:27.829414678 -0500
+@@ -30,7 +30,7 @@
+ import org.apache.batik.bridge.BridgeContext;
+ import org.apache.batik.bridge.GVTBuilder;
+ import org.apache.batik.bridge.UserAgentAdapter;
+-import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
++import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
+ import org.apache.batik.gvt.GraphicsNode;
+ import org.apache.batik.gvt.renderer.ConcreteImageRendererFactory;
+ import org.apache.batik.gvt.renderer.ImageRenderer;
diff --git a/libre/ditaa/ditaa.sh b/libre/ditaa/ditaa.sh
new file mode 100644
index 000000000..c3f3ffad9
--- /dev/null
+++ b/libre/ditaa/ditaa.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+DIR=/usr/share/java
+${JAVA_HOME}/bin/java -cp "$DIR/commons-cli.jar:$DIR/ditaa/ditaa-VERSION.jar" org.stathissideris.ascii2image.core.CommandLineConverter "$@"