summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--java/javacc/PKGBUILD47
-rw-r--r--libre/javacc/PKGBUILD59
-rw-r--r--libre/javacc/build-xml-bootstrap.patch65
3 files changed, 124 insertions, 47 deletions
diff --git a/java/javacc/PKGBUILD b/java/javacc/PKGBUILD
deleted file mode 100644
index 032fd7b25..000000000
--- a/java/javacc/PKGBUILD
+++ /dev/null
@@ -1,47 +0,0 @@
-# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
-
-pkgname=javacc
-pkgver=5.0
-pkgdesc="Java Compiler Compiler; a parser generator"
-url="http://javacc.java.net/"
-license=('BSD3')
-
-arch=('any')
-pkgrel=2.1
-depends=('java-runtime')
-makedepends=('apache-ant' 'junit' 'jh')
-source=("http://java.net/projects/${pkgname}/downloads/download/${pkgname}-${pkgver}src.tar.gz")
-
-prepare() {
- cd "$srcdir/$pkgname"
- rm lib/junit3.8.1/junit.jar
- ln -s /usr/share/java/junit.jar lib/junit3.8.1
- #rm bootstrap/javacc.jar
-}
-
-build() {
- cd "$srcdir/$pkgname"
-
- sed -i \
- -e 's|<modelVersion>.*</modelVersion>|<modelVersion>4.0.0</modelVersion>|' \
- -e "s|<version>.*</version>|<version>$pkgver</version>|" \
- pom.xml
-
- for prog in javacc jjdoc jjtree; do
- sed -i 's|JAR=.*|JAR=/usr/share/java/javacc.jar|' bin/$prog
- done
-
- CLASSPATH=/usr/share/java/junit.jar ant
-}
-
-package() {
- cd "$srcdir/$pkgname"
-
- for prog in javacc jjdoc jjrun jjtree; do
- install -Dm755 bin/$prog "$pkgdir"/usr/bin/$prog
- done
- install -Dm644 bin/lib/javacc.jar "$pkgdir"/usr/share/java/javacc.jar
- install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
-}
-
-md5sums=('871d78a2a5859c2eebc712c1f8135be5')
diff --git a/libre/javacc/PKGBUILD b/libre/javacc/PKGBUILD
new file mode 100644
index 000000000..5aa3b3c71
--- /dev/null
+++ b/libre/javacc/PKGBUILD
@@ -0,0 +1,59 @@
+# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
+
+pkgname=javacc
+pkgver=6.1.2
+pkgdesc="Java Compiler Compiler; a parser generator"
+url="http://javacc.java.net/"
+license=('BSD3')
+
+arch=('any')
+pkgrel=1
+depends=('java-runtime')
+makedepends=('apache-ant' 'junit' 'jh')
+source=("https://java.net/projects/${pkgname}/downloads/download/releases/Release%20${pkgver}/${pkgname}-${pkgver}-sources.jar"
+ 'build-xml-bootstrap.patch')
+md5sums=('a29fdd55ccb738dc07a489b80b74e062'
+ 'c863ce2ed275f36ff0eebfc9e2776592')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+ ln -sfT /usr/share/java/junit.jar lib/junit3.8.1/junit.jar
+ rm -f bootstrap/javacc.jar
+ sed -i "s|^ <version>.*</version>| <version>$pkgver</version>|" pom.xml
+ cd ..
+ cp -a "$pkgname-$pkgver" "$pkgname-$pkgver"-bootstrap
+ patch -i build-xml-bootstrap.patch "$pkgname-$pkgver"-bootstrap/build.xml
+ rm -rf "$pkgname-$pkgver"/src/main/generated-sources
+}
+
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver-bootstrap
+ ant
+ cd ../$pkgname-$pkgver
+ ln -srf "$PWD"-bootstrap/target/javacc-$pkgver.jar bootstrap/javacc.jar
+
+ ant
+
+ cd ..
+ local prog
+ for prog in javacc jjdoc jjtree; do
+ printf '#!/bin/sh\nexec java -classpath %q %s "$@"\n' \
+ /usr/share/java/javacc.jar $prog \
+ > $prog.sh
+ done
+}
+
+package() {
+ cd "$srcdir"
+
+ local prog
+ for prog in javacc jjdoc jjtree; do
+ install -Dm755 $prog.sh "$pkgdir"/usr/bin/$prog
+ done
+
+ cd "$pkgname-$pkgver"
+ DESTDIR="$pkgdir" jh mvn-install net.java.dev.javacc javacc "$pkgver" \
+ pom.xml target/javacc-$pkgver.jar javacc.jar
+ install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
diff --git a/libre/javacc/build-xml-bootstrap.patch b/libre/javacc/build-xml-bootstrap.patch
new file mode 100644
index 000000000..993aa82fd
--- /dev/null
+++ b/libre/javacc/build-xml-bootstrap.patch
@@ -0,0 +1,65 @@
+--- src/javacc-6.1.2/build.xml 2014-05-04 23:04:10.000000000 -0600
++++ build.xml 2015-06-14 20:30:21.775223860 -0600
+@@ -59,61 +59,7 @@
+ </target>
+
+
+- <target name="compile" depends="clean, clean_generated_sources">
+-
+- <!-- Create the folders we need in the generated sources folder -->
+-
+- <mkdir dir="${generated-sources-src}"/>
+- <mkdir dir="${generated-sources-src}/org/javacc/parser"/>
+- <mkdir dir="${generated-sources-src}/org/javacc/utils"/>
+- <mkdir dir="${generated-sources-src}/org/javacc/jjtree"/>
+-
+- <!-- Generate the Java CC Main Parser -->
+-
+- <java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/javacc" fork="true">
+- <arg value="JavaCC.jj"/>
+- </java>
+-
+- <!-- This class is overrriden -->
+- <delete file="${generated-sources-src}/org/javacc/parser/Token.java" />
+-
+- <!-- Generate the JJTree Parser Definition (from the tree definition) -->
+-
+- <java classname="${jjtree-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/jjtree" fork="true">
+- <arg value="JJTree.jjt"/>
+- </java>
+-
+- <!-- Generate the JJTree Parser -->
+-
+- <java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${generated-sources-src}/org/javacc/jjtree" fork="true">
+- <arg value="JJTree.jj"/>
+- </java>
+-
+- <!-- Delete the .jj file created by the jjtree program and the classes that were override and already added into the main source path -->
+-
+- <delete file="${generated-sources-src}/org/javacc/jjtree/JJTree.jj" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTBNF.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTBNFAction.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTBNFDeclaration.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTBNFNodeScope.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTCompilationUnit.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTExpansionNodeScope.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTGrammar.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTJavacode.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTJavacodeBody.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTNodeDescriptor.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTNodeDescriptorExpression.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTOptionBinding.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/ASTOptions.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/JJTreeParserVisitor.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/JJTreeParserDefaultVisitor.java" />
+- <delete file="${generated-sources-src}/org/javacc/jjtree/Token.java" />
+-
+- <!-- Generate the Condition Parser -->
+-
+- <java classname="${javacc-bootstrap-class}" classpath="${bootstrap-jar}" dir="${basedir}/src/main/javacc" fork="true">
+- <arg value="ConditionParser.jj"/>
+- </java>
++ <target name="compile" depends="clean">
+
+ <mkdir dir="classes"/>
+