From 96c8f0b866225166b435067b29daf2d8c7fb77b1 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Thu, 16 Oct 2008 11:59:20 +0200 Subject: java-library.bbclass: Remove superfluous quotes from BPN variable. --- classes/java-library.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass index eced939ef0..1e5534cbfe 100644 --- a/classes/java-library.bbclass +++ b/classes/java-library.bbclass @@ -49,7 +49,7 @@ FILES_${JPN} = "${datadir_java}" # Base package name # Automatically derives "foo" from "foo-native" -BPN ?= ""${@java_base_package_name(d)}"" +BPN ?= "${@java_base_package_name(d)}" BP ?= "${BPN}-${PV}" -- cgit v1.2.3 From c4cfa290f4e64299870ef9883aa9d3dd30f0e672 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Fri, 17 Oct 2008 11:36:50 +0200 Subject: native.bbclass: Run java_stage if JAVA_NATIVE_STAGE_INSTALL is set. --- classes/native.bbclass | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/native.bbclass b/classes/native.bbclass index 8f79935040..61048b6b14 100644 --- a/classes/native.bbclass +++ b/classes/native.bbclass @@ -80,11 +80,14 @@ export oldincludedir = "${STAGING_DIR_NATIVE}${layout_includedir}" do_stage () { if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ] then - if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ] + if [ "${JAVA_NATIVE_STAGE_INSTALL}" = "1" ] + then + java_stage + elif [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" = "1" ] then - oe_runmake install - else autotools_stage_all + else + oe_runmake install fi fi } -- cgit v1.2.3 From 9c991af9e1fb60fafa3c12d31ba87990b410e39f Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Fri, 17 Oct 2008 11:41:20 +0200 Subject: Added BPN/BP functionality (see #11716) base.bbclass: Added base_package_name python function. java-library.bbclass: Removed java_back_package_name function. bitbake.conf: Set BP/BPN and use it in FILESPATH and S --- classes/base.bbclass | 17 +++++++++++++++++ classes/java-library.bbclass | 21 +++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index b50bc8667c..071acfa015 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -157,6 +157,23 @@ def base_both_contain(variable1, variable2, checkvalue, d): DEPENDS_prepend="${@base_dep_prepend(d)} " +# Returns PN with various suffixes removed +# or PN if no matching suffix was found. +def base_package_name(d): + import bb; + + pn = bb.data.getVar('PN', d, 1) + if pn.endswith("-native"): + pn = pn[0:-7] + elif pn.endswith("-cross"): + pn = pn[0:-6] + elif pn.endswith("-initial"): + pn = pn[0:-8] + elif pn.endswith("-intermediate"): + pn = pn[0:-13] + + return pn + def base_set_filespath(path, d): import os, bb filespath = [] diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass index 1e5534cbfe..06c3170544 100644 --- a/classes/java-library.bbclass +++ b/classes/java-library.bbclass @@ -10,6 +10,9 @@ inherit java +# use java_stage for native packages +JAVA_NATIVE_STAGE_INSTALL = "1" + def java_package_name(d): import bb; @@ -25,18 +28,6 @@ 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 " @@ -47,12 +38,6 @@ 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 = "${BP}.jar" -- cgit v1.2.3 From 1d65c4922a7d93f3a5c8f385470b9c4e1d8d542c Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Fri, 17 Oct 2008 11:46:45 +0200 Subject: java.bbclass: Fixed indentation. --- classes/java.bbclass | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'classes') diff --git a/classes/java.bbclass b/classes/java.bbclass index 32415d5800..7b67bcd510 100644 --- a/classes/java.bbclass +++ b/classes/java.bbclass @@ -84,32 +84,32 @@ oe_makeclasspath() { # # oe_makeclasspath cp foo baz bar # Stores ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar - # in variable "cp". + # in variable "cp". # # oe_makeclasspath bootcp -s foo baz bar # Stores ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar - # in variable "bootcp". - # + # in variable "bootcp". + # # Provide the -s at the beginning otherwise strange things happen. - # If -s is given the function checks whether the requested jar file exists - # and exits with an error message if it cannot be found. - # + # If -s is given the function checks whether the requested jar file exists + # and exits with an error message if it cannot be found. + # dir=${datadir_java} - classpath= - delimiter= - retval=$1 + classpath= + delimiter= + retval=$1 - shift + shift while [ "$#" -gt 0 ]; do case "$1" in -s) - # take jar files from native staging if this is a -native recipe - if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then + # take jar files from native staging if this is a -native recipe + if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then dir=${STAGING_DATADIR_JAVA_NATIVE} - else + else dir=${STAGING_DATADIR_JAVA} - fi + fi ;; -*) oefatal "oe_makeclasspath: unknown option: $1" @@ -117,9 +117,9 @@ oe_makeclasspath() { *) file=$dir/$1.jar - if [ -z "$dir" -a ! -f $file ]; then - oefatal "oe_makeclasspath: Jar file for '$1' not found at $file" - fi + if [ -z "$dir" -a ! -f $file ]; then + oefatal "oe_makeclasspath: Jar file for '$1' not found at $file" + fi classpath=$classpath$delimiter$file delimiter=":" @@ -128,7 +128,7 @@ oe_makeclasspath() { shift done - eval $retval="$classpath" + eval $retval="$classpath" } # Creates a simple wrapper script for your Java program. -- cgit v1.2.3 From 419924e8e4f5a48be37ea8f59c89a96315178856 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Wed, 22 Oct 2008 14:51:32 +0200 Subject: base.bbclass: Add BPN- and BP-based search path to FILESPATH. --- classes/base.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/base.bbclass b/classes/base.bbclass index 071acfa015..93a76aa30f 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -184,7 +184,7 @@ def base_set_filespath(path, d): filespath.append(os.path.join(p, o)) return ":".join(filespath) -FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" +FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" def oe_filter(f, str, d): from re import match -- cgit v1.2.3