summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorRobert Schuster <thebohemian@gmx.net>2008-10-10 14:47:38 +0000
committerRobert Schuster <thebohemian@gmx.net>2008-10-10 14:47:38 +0000
commit22daad61fa11c387f78a1c6852bf8d812c835c88 (patch)
tree658a2b86007ca17af785bb05db77d9f79a0dc66f /classes
parent684e77b0e2f27b33eb7f7c64543ca04598101011 (diff)
parent6ccf5eedbd5ac0bd452ce89adedf2afc0009438d (diff)
merge of '3a46b29cc934022c7df085ba522531c57df6de56'
and 'b1dff4fe794bb68455321c0742b9a83e38afa5b3'
Diffstat (limited to 'classes')
-rw-r--r--classes/java-library.bbclass31
-rw-r--r--classes/java.bbclass18
2 files changed, 45 insertions, 4 deletions
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
index b6cb5dcbde..eced939ef0 100644
--- a/classes/java-library.bbclass
+++ b/classes/java-library.bbclass
@@ -25,6 +25,18 @@ def java_package_name(d):
return pre + pn + post
+def java_base_package_name(d):
+ import bb;
+
+ pre=""
+ post=""
+
+ pn = bb.data.getVar('PN', d, 1)
+ if pn.endswith("-native"):
+ pn = pn[0:-7]
+
+ return pn
+
JPN ?= "${@java_package_name(d)}"
DEPENDS_prepend = "virtual/javac-native fastjar-native "
@@ -35,11 +47,26 @@ PACKAGE_ARCH_${JPN} = "all"
FILES_${JPN} = "${datadir_java}"
+# Base package name
+# Automatically derives "foo" from "foo-native"
+BPN ?= ""${@java_base_package_name(d)}""
+
+BP ?= "${BPN}-${PV}"
+
# File name of the libraries' main Jar file
-JARFILENAME = "${P}.jar"
+JARFILENAME = "${BP}.jar"
# Space-separated list of alternative file names.
-ALTJARFILENAMES = "${PN}.jar"
+ALTJARFILENAMES = "${BPN}.jar"
+
+# Java "source" distributions often contain precompiled things
+# we want to delete first.
+do_removebinaries() {
+ find ${WORKDIR} -name "*.jar" -exec rm {} \;
+ find ${WORKDIR} -name "*.class" -exec rm {} \;
+}
+
+addtask removebinaries after do_unpack before do_patch
java_install() {
oe_jarinstall ${JARFILENAME} ${ALTJARFILENAMES}
diff --git a/classes/java.bbclass b/classes/java.bbclass
index 620dae79fb..32415d5800 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -17,6 +17,10 @@ STAGING_DATADIR_JAVA ?= ${STAGING_DATADIR}/java
STAGING_LIBDIR_JNI ?= ${STAGING_LIBDIR}/jni
STAGING_LIBDIR_JVM ?= ${STAGING_LIBDIR}/jvm
+STAGING_DATADIR_JAVA_NATIVE ?= ${STAGING_DATADIR_NATIVE}/java
+STAGING_LIBDIR_JNI_NATIVE ?= ${STAGING_LIBDIR_NATIVE}/jni
+STAGING_LIBDIR_JVM_NATIVE ?= ${STAGING_LIBDIR_NATIVE}/jvm
+
oe_jarinstall() {
# Purpose: Install a jar file and create all the given symlinks to it.
# Example:
@@ -34,7 +38,12 @@ oe_jarinstall() {
while [ "$#" -gt 0 ]; do
case "$1" in
-s)
- dir=${STAGING_DATADIR_JAVA}
+ # put jar files to native staging if this is a -native recipe
+ if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
+ dir=${STAGING_DATADIR_JAVA_NATIVE}
+ else
+ dir=${STAGING_DATADIR_JAVA}
+ fi
;;
-r)
shift
@@ -95,7 +104,12 @@ oe_makeclasspath() {
while [ "$#" -gt 0 ]; do
case "$1" in
-s)
- dir=${STAGING_DATADIR_JAVA}
+ # take jar files from native staging if this is a -native recipe
+ if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
+ dir=${STAGING_DATADIR_JAVA_NATIVE}
+ else
+ dir=${STAGING_DATADIR_JAVA}
+ fi
;;
-*)
oefatal "oe_makeclasspath: unknown option: $1"