summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes/jlex/files/jlex5
-rw-r--r--recipes/jlex/jlex-native_1.2.6.bb23
-rw-r--r--recipes/jlex/jlex_1.2.6.bb39
3 files changed, 67 insertions, 0 deletions
diff --git a/recipes/jlex/files/jlex b/recipes/jlex/files/jlex
new file mode 100755
index 0000000000..7a9e756239
--- /dev/null
+++ b/recipes/jlex/files/jlex
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cp=OE_STAGING_DATADIR_JAVA/OE_JLEX_JAR
+
+exec OE_STAGING_BINDIR/java -cp $cp JLex.Main "$@"
diff --git a/recipes/jlex/jlex-native_1.2.6.bb b/recipes/jlex/jlex-native_1.2.6.bb
new file mode 100644
index 0000000000..6f8194b145
--- /dev/null
+++ b/recipes/jlex/jlex-native_1.2.6.bb
@@ -0,0 +1,23 @@
+require jlex_${PV}.bb
+
+inherit java-native
+
+DEPENDS += "virtual/java-native"
+RDEPENDS = ""
+
+do_configure() {
+ sed -i \
+ -e "s|OE_STAGING_BINDIR|${STAGING_BINDIR_NATIVE}|" \
+ -e "s|OE_STAGING_DATADIR_JAVA|${STAGING_DATADIR_JAVA_NATIVE}|" \
+ -e "s|OE_JLEX_JAR|${BP}.jar|" \
+ ${WORKDIR}/jlex
+}
+
+do_install_append() {
+ :
+}
+
+do_stage_append() {
+ install -d ${STAGING_BINDIR}
+ install -m 0755 jlex ${STAGING_BINDIR}
+}
diff --git a/recipes/jlex/jlex_1.2.6.bb b/recipes/jlex/jlex_1.2.6.bb
new file mode 100644
index 0000000000..05401df972
--- /dev/null
+++ b/recipes/jlex/jlex_1.2.6.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Lexical analyzer generator for Java"
+AUTHOR = "Elliot Berk, A. Appel, C. Scott Ananian"
+
+DEPENDS = "fastjar-native"
+RDEPENDS = "java2-runtime"
+
+inherit java-library
+
+SRC_URI = "\
+ http://www.cs.princeton.edu/~appel/modern/java/JLex/Archive/${PV}/Main.java \
+ file://jlex \
+ "
+
+S = "${WORKDIR}"
+
+do_configure() {
+ sed -i \
+ -e "s|OE_STAGING_BINDIR|${bindir}|" \
+ -e "s|OE_STAGING_DATADIR_JAVA|${datadir_java}|" \
+ -e "s|OE_JLEX_JAR|${BP}.jar|" \
+ ${WORKDIR}/jlex
+}
+
+do_compile() {
+ mkdir -p build
+
+ javac -d build Main.java
+
+ fastjar -C build -c -f ${BP}.jar .
+}
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 jlex ${D}${bindir}/
+}
+
+PACKAGES = "${PN}"
+
+FILES_${PN} += "${datadir_java}"