summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/autotools.bbclass79
-rw-r--r--classes/base.bbclass302
-rw-r--r--classes/binconfig.bbclass43
-rw-r--r--classes/canadian-cross.bbclass43
-rw-r--r--classes/canadian-native.bbclass35
-rw-r--r--classes/canadian-sdk.bbclass4
-rw-r--r--classes/canadian.bbclass5
-rw-r--r--classes/cpan-base.bbclass6
-rw-r--r--classes/cpan.bbclass2
-rw-r--r--classes/cpan_build.bbclass2
-rw-r--r--classes/cross-canadian.bbclass46
-rw-r--r--classes/cross.bbclass25
-rw-r--r--classes/crosssdk.bbclass15
-rw-r--r--classes/debian.bbclass4
-rw-r--r--classes/distutils.bbclass8
-rw-r--r--classes/manifest.bbclass2
-rw-r--r--classes/native.bbclass92
-rw-r--r--classes/nativesdk.bbclass78
-rw-r--r--classes/package.bbclass81
-rw-r--r--classes/packaged-staging.bbclass40
-rw-r--r--classes/packagedata.bbclass73
-rw-r--r--classes/patch.bbclass4
-rw-r--r--classes/pkgconfig.bbclass8
-rw-r--r--classes/recipe_sanity.bbclass9
-rw-r--r--classes/scons.bbclass2
-rw-r--r--classes/sdk.bbclass5
-rw-r--r--classes/xlibs.bbclass4
27 files changed, 585 insertions, 432 deletions
diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 8236a27c76..a944f0ec9f 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -1,5 +1,3 @@
-inherit base
-
# use autotools_stage_all for native packages
AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
@@ -27,7 +25,11 @@ def autotools_dep_prepend(d):
return deps + 'gnu-config-native '
EXTRA_OEMAKE = ""
+
DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
+DEPENDS_virtclass-native_prepend = "${@autotools_dep_prepend(d)}"
+DEPENDS_virtclass-nativesdk_prepend = "${@autotools_dep_prepend(d)}"
+
acpaths = "default"
EXTRA_AUTORECONF = "--exclude=autopoint"
@@ -115,7 +117,7 @@ autotools_do_configure() {
else
CONFIGURE_AC=configure.ac
fi
- if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+ if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
: do nothing -- we still have an old unmodified configure.ac
else
@@ -123,12 +125,12 @@ autotools_do_configure() {
echo "no" | glib-gettextize --force --copy
fi
fi
- if grep "^[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
+ mkdir -p m4
+ if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
oenote Executing intltoolize --copy --force --automake
intltoolize --copy --force --automake
fi
oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
- mkdir -p m4
autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
cd $olddir
fi
@@ -145,8 +147,10 @@ autotools_do_install() {
oe_runmake 'DESTDIR=${D}' install
}
-do_install_append() {
- for i in `find ${D} -name "*.la"` ; do \
+PACKAGE_PREPROCESS_FUNCS += "autotools_prepackage_lamangler"
+
+autotools_prepackage_lamangler () {
+ for i in `find ${PKGD} -name "*.la"` ; do \
sed -i -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${libdir}/\1,g' $i
sed -i -e s:${CROSS_DIR}/${HOST_SYS}::g $i
sed -i -e s:${CROSS_DIR}::g $i
@@ -173,14 +177,11 @@ autotools_stage_includes() {
}
autotools_stage_dir() {
- from="$1"
- to="$2"
- # This will remove empty directories so we can ignore them
- rmdir "$from" 2> /dev/null || true
- if [ -d "$from" ]; then
- mkdir -p "$to"
- cp -fpPR "$from"/* "$to"
- fi
+ sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
+}
+
+autotools_stage_libdir() {
+ sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
}
autotools_stage_all() {
@@ -191,55 +192,9 @@ autotools_stage_all() {
rm -rf ${STAGE_TEMP}
mkdir -p ${STAGE_TEMP}
oe_runmake DESTDIR="${STAGE_TEMP}" install
- autotools_stage_dir ${STAGE_TEMP}/${includedir} ${STAGING_INCDIR}
- if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
- autotools_stage_dir ${STAGE_TEMP}/${bindir} ${STAGING_DIR_HOST}${layout_bindir}
- autotools_stage_dir ${STAGE_TEMP}/${sbindir} ${STAGING_DIR_HOST}${layout_sbindir}
- autotools_stage_dir ${STAGE_TEMP}/${base_bindir} ${STAGING_DIR_HOST}${layout_base_bindir}
- autotools_stage_dir ${STAGE_TEMP}/${base_sbindir} ${STAGING_DIR_HOST}${layout_base_sbindir}
- autotools_stage_dir ${STAGE_TEMP}/${libexecdir} ${STAGING_DIR_HOST}${layout_libexecdir}
- if [ "${prefix}/lib" != "${libdir}" ]; then
- # python puts its files in here, make sure they are staged as well
- autotools_stage_dir ${STAGE_TEMP}/${prefix}/lib ${STAGING_DIR_HOST}${layout_prefix}/lib
- fi
- fi
- if [ -d ${STAGE_TEMP}/${libdir} ]
- then
- olddir=`pwd`
- cd ${STAGE_TEMP}/${libdir}
- las=$(find . -name \*.la -type f)
- cd $olddir
- echo "Found la files: $las"
- for i in $las
- do
- sed -e 's/^installed=yes$/installed=no/' \
- -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*.la\),${STAGING_LIBDIR}/\1,g' \
- -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR},g' \
- -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${STAGING_LIBDIR},g" \
- -i ${STAGE_TEMP}/${libdir}/$i
- done
- autotools_stage_dir ${STAGE_TEMP}/${libdir} ${STAGING_LIBDIR}
- fi
- # Ok, this is nasty. pkgconfig.bbclass is usually used to install .pc files,
- # however some packages rely on the presence of .pc files to enable/disable
- # their configurataions in which case we better should not install everything
- # unconditionally, but rather depend on the actual results of make install.
- # The good news though: a) there are not many packages doing this and
- # b) packaged staging will fix that anyways. :M:
- if [ "${AUTOTOOLS_STAGE_PKGCONFIG}" = "1" ]
- then
- if [ -e ${STAGE_TEMP}/${libdir}/pkgconfig/ ] ; then
- echo "cp -f ${STAGE_TEMP}/${libdir}/pkgconfig/*.pc ${STAGING_LIBDIR}/pkgconfig/"
- cp -f ${STAGE_TEMP}/${libdir}/pkgconfig/*.pc ${STAGING_LIBDIR}/pkgconfig/
- fi
- if [ -e ${STAGE_TEMP}/${datadir}/pkgconfig/ ] ; then
- echo "cp -f ${STAGE_TEMP}/${datadir}/pkgconfig/*.pc ${STAGING_DATADIR}/pkgconfig/"
- cp -f ${STAGE_TEMP}/${datadir}/pkgconfig/*.pc ${STAGING_DATADIR}/pkgconfig/
- fi
- fi
rm -rf ${STAGE_TEMP}/${mandir} || true
rm -rf ${STAGE_TEMP}/${infodir} || true
- autotools_stage_dir ${STAGE_TEMP}/${datadir} ${STAGING_DATADIR}
+ sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
rm -rf ${STAGE_TEMP}
}
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 89ee917d20..e4fc2ac34f 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -49,7 +49,7 @@ def base_path_out(path, d):
# for MD5/SHA handling
def base_chk_load_parser(config_paths):
- import ConfigParser, os, bb
+ import ConfigParser
parser = ConfigParser.ConfigParser()
if len(parser.read(config_paths)) < 1:
raise ValueError("no ini files could be found")
@@ -57,7 +57,6 @@ def base_chk_load_parser(config_paths):
return parser
def base_chk_file(parser, pn, pv, src_uri, localpath, data):
- import os, bb
no_checksum = False
# Try PN-PV-SRC_URI first and then try PN-SRC_URI
# we rely on the get method to create errors
@@ -128,7 +127,6 @@ def base_chk_file(parser, pn, pv, src_uri, localpath, data):
def base_dep_prepend(d):
- import bb
#
# Ideally this will check a flag so we will operate properly in
# the case where host == build == target, for now we don't work in
@@ -150,7 +148,6 @@ def base_dep_prepend(d):
return deps
def base_read_file(filename):
- import bb
try:
f = file( filename, "r" )
except IOError, reason:
@@ -166,21 +163,18 @@ def base_ifelse(condition, iftrue = True, iffalse = False):
return iffalse
def base_conditional(variable, checkvalue, truevalue, falsevalue, d):
- import bb
if bb.data.getVar(variable,d,1) == checkvalue:
return truevalue
else:
return falsevalue
def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
- import bb
if float(bb.data.getVar(variable,d,1)) <= float(checkvalue):
return truevalue
else:
return falsevalue
def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
- import bb
result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue)
if result <= 0:
return truevalue
@@ -188,7 +182,6 @@ def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
return falsevalue
def base_contains(variable, checkvalues, truevalue, falsevalue, d):
- import bb
matches = 0
if type(checkvalues).__name__ == "str":
checkvalues = [checkvalues]
@@ -200,36 +193,24 @@ def base_contains(variable, checkvalues, truevalue, falsevalue, d):
return falsevalue
def base_both_contain(variable1, variable2, checkvalue, d):
- import bb
if bb.data.getVar(variable1,d,1).find(checkvalue) != -1 and bb.data.getVar(variable2,d,1).find(checkvalue) != -1:
return checkvalue
else:
return ""
DEPENDS_prepend="${@base_dep_prepend(d)} "
+DEPENDS_virtclass-native_prepend="${@base_dep_prepend(d)} "
+DEPENDS_virtclass-nativesdk_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]
- elif pn.endswith("-sdk"):
- pn = pn[0:-4]
-
-
- return pn
+def base_prune_suffix(var, suffixes, d):
+ # See if var ends with any of the suffixes listed and
+ # remove it if found
+ for suffix in suffixes:
+ if var.endswith(suffix):
+ return var.replace(suffix, "")
+ return var
def base_set_filespath(path, d):
- import os, bb
bb.note("base_set_filespath usage is deprecated, %s should be fixed" % d.getVar("P", 1))
filespath = []
# The ":" ensures we have an 'empty' override
@@ -448,7 +429,6 @@ oe_libinstall() {
}
def package_stagefile(file, d):
- import bb, os
if bb.data.getVar('PSTAGING_ACTIVE', d, True) == "1":
destfile = file.replace(bb.data.getVar("TMPDIR", d, 1), bb.data.getVar("PSTAGE_TMPDIR_STAGE", d, 1))
@@ -529,21 +509,11 @@ python do_cleanall() {
do_cleanall[recrdeptask] = "do_clean"
addtask cleanall after do_clean
-#Uncomment this for bitbake 1.8.12
-#addtask rebuild after do_${BB_DEFAULT_TASK}
-addtask rebuild
+addtask rebuild after do_${BB_DEFAULT_TASK}
do_rebuild[dirs] = "${TOPDIR}"
do_rebuild[nostamp] = "1"
python base_do_rebuild() {
"""rebuild a package"""
- from bb import __version__
- try:
- from distutils.version import LooseVersion
- except ImportError:
- def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
- if (LooseVersion(__version__) < LooseVersion('1.8.11')):
- bb.build.exec_func('do_clean', d)
- bb.build.exec_task('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1), d)
}
addtask mrproper
@@ -563,7 +533,6 @@ do_distclean[dirs] = "${TOPDIR}"
do_distclean[nostamp] = "1"
python base_do_distclean() {
"""clear downloaded sources, build and temp directories"""
- import os
bb.build.exec_func('do_clean', d)
@@ -741,7 +710,7 @@ def subprocess_setup():
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
def oe_unpack_file(file, data, url = None):
- import bb, os, subprocess
+ import subprocess
if not url:
url = "file://%s" % file
dots = file.split(".")
@@ -819,7 +788,7 @@ def oe_unpack_file(file, data, url = None):
addtask unpack after do_fetch
do_unpack[dirs] = "${WORKDIR}"
python base_do_unpack() {
- import re, os
+ import re
localdata = bb.data.createCopy(d)
bb.data.update_data(localdata)
@@ -846,7 +815,6 @@ METADATA_REVISION = "${@base_get_scm_revision(d)}"
METADATA_BRANCH = "${@base_get_scm_branch(d)}"
def base_get_scm(d):
- import os
from bb import which
baserepo = os.path.dirname(os.path.dirname(which(d.getVar("BBPATH", 1), "classes/base.bbclass")))
for (scm, scmpath) in {"svn": ".svn",
@@ -907,7 +875,6 @@ def base_get_metadata_svn_revision(path, d):
return revision
def base_get_metadata_git_branch(path, d):
- import os
branch = os.popen('cd %s; PATH=%s git symbolic-ref HEAD 2>/dev/null' % (path, d.getVar("PATH", 1))).read().rstrip()
if len(branch) != 0:
@@ -915,7 +882,6 @@ def base_get_metadata_git_branch(path, d):
return "<unknown>"
def base_get_metadata_git_revision(path, d):
- import os
rev = os.popen("cd %s; PATH=%s git show-ref HEAD 2>/dev/null" % (path, d.getVar("PATH", 1))).read().split(" ")[0].rstrip()
if len(rev) != 0:
return rev
@@ -926,7 +892,7 @@ addhandler base_eventhandler
python base_eventhandler() {
from bb import note, error, data
from bb.event import Handled, NotHandled, getName
- import os
+
name = getName(e)
if name == "TaskCompleted":
@@ -999,12 +965,86 @@ base_do_compile() {
fi
}
-base_do_stage () {
- :
+
+sysroot_stage_dir() {
+ src="$1"
+ dest="$2"
+ # This will remove empty directories so we can ignore them
+ rmdir "$src" 2> /dev/null || true
+ if [ -d "$src" ]; then
+ mkdir -p "$dest"
+ cp -fpPR "$src"/* "$dest"
+ fi
+}
+
+sysroot_stage_libdir() {
+ src="$1"
+ dest="$2"
+
+ olddir=`pwd`
+ cd $src
+ las=$(find . -name \*.la -type f)
+ cd $olddir
+ echo "Found la files: $las"
+ for i in $las
+ do
+ sed -e 's/^installed=yes$/installed=no/' \
+ -e '/^dependency_libs=/s,${WORKDIR}[[:alnum:]/\._+-]*/\([[:alnum:]\._+-]*\),${STAGING_LIBDIR}/\1,g' \
+ -e "/^dependency_libs=/s,\([[:space:]']\)${libdir},\1${STAGING_LIBDIR},g" \
+ -i $src/$i
+ done
+ sysroot_stage_dir $src $dest
+}
+
+sysroot_stage_dirs() {
+ from="$1"
+ to="$2"
+
+ sysroot_stage_dir $from${includedir} $to${STAGING_INCDIR}
+ if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+ sysroot_stage_dir $from${bindir} $to${STAGING_DIR_HOST}${bindir}
+ sysroot_stage_dir $from${sbindir} $to${STAGING_DIR_HOST}${sbindir}
+ sysroot_stage_dir $from${base_bindir} $to${STAGING_DIR_HOST}${base_bindir}
+ sysroot_stage_dir $from${base_sbindir} $to${STAGING_DIR_HOST}${base_sbindir}
+ sysroot_stage_dir $from${libexecdir} $to${STAGING_DIR_HOST}${libexecdir}
+ if [ "${prefix}/lib" != "${libdir}" ]; then
+ # python puts its files in here, make sure they are staged as well
+ autotools_stage_dir $from/${prefix}/lib $to${STAGING_DIR_HOST}${prefix}/lib
+ fi
+ fi
+ if [ -d $from${libdir} ]
+ then
+ sysroot_stage_libdir $from/${libdir} $to${STAGING_LIBDIR}
+ fi
+ if [ -d $from${base_libdir} ]
+ then
+ sysroot_stage_libdir $from${base_libdir} $to${STAGING_DIR_HOST}${base_libdir}
+ fi
+ sysroot_stage_dir $from${datadir} $to${STAGING_DATADIR}
}
-do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${layout_bindir} ${STAGING_DIR_TARGET}/${layout_libdir} \
- ${STAGING_DIR_TARGET}/${layout_includedir} \
+sysroot_stage_all() {
+ sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
+}
+
+def is_legacy_staging(d):
+ import bb
+ stagefunc = bb.data.getVar('do_stage', d, True)
+ legacy = True
+ if stagefunc is None:
+ legacy = False
+ elif stagefunc.strip() == "autotools_stage_all":
+ legacy = False
+ elif stagefunc.strip() == "do_stage_native" and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
+ legacy = False
+ elif bb.data.getVar('NATIVE_INSTALL_WORKS', d, 1) == "1":
+ legacy = False
+ if bb.data.getVar('PSTAGE_BROKEN_DESTDIR', d, 1) == "1":
+ legacy = True
+ return legacy
+
+do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGET}/${libdir} \
+ ${STAGING_DIR_TARGET}/${includedir} \
${STAGING_BINDIR_NATIVE} ${STAGING_LIBDIR_NATIVE} \
${STAGING_INCDIR_NATIVE} \
${STAGING_DATADIR} \
@@ -1013,8 +1053,61 @@ do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${layout_bindir} ${STAGING_DI
# Could be compile but populate_staging and do_install shouldn't run at the same time
addtask populate_staging after do_install
+SYSROOT_PREPROCESS_FUNCS ?= ""
+SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/"
+SYSROOT_LOCK = "${STAGING_DIR}/staging.lock"
+
+python populate_staging_prehook () {
+ return
+}
+
+python populate_staging_posthook () {
+ return
+}
+
+packagedstaging_fastpath () {
+ :
+}
+
python do_populate_staging () {
- bb.build.exec_func('do_stage', d)
+ #
+ # if do_stage exists, we're legacy. In that case run the do_stage,
+ # modify the SYSROOT_DESTDIR variable and then run the staging preprocess
+ # functions against staging directly.
+ #
+ # Otherwise setup a destdir, copy the results from do_install
+ # and run the staging preprocess against that
+ #
+ pstageactive = (bb.data.getVar("PSTAGING_ACTIVE", d, True) == "1")
+ lockfile = bb.data.getVar("SYSROOT_LOCK", d, True)
+ stagefunc = bb.data.getVar('do_stage', d, True)
+ legacy = is_legacy_staging(d)
+ if legacy:
+ bb.data.setVar("SYSROOT_DESTDIR", "", d)
+ bb.note("Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
+ if bb.data.getVarFlags('do_stage', d) is None:
+ bb.fatal("This recipe (%s) has a do_stage_prepend or do_stage_append and do_stage now doesn't exist. Please rename this to do_stage()" % bb.data.getVar("FILE", d, True))
+ lock = bb.utils.lockfile(lockfile)
+ bb.build.exec_func('do_stage', d)
+ bb.build.exec_func('populate_staging_prehook', d)
+ for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
+ bb.build.exec_func(f, d)
+ bb.build.exec_func('populate_staging_posthook', d)
+ bb.utils.unlockfile(lock)
+ else:
+ dest = bb.data.getVar('D', d, True)
+ sysrootdest = bb.data.expand('${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}', d)
+ bb.mkdirhier(sysrootdest)
+
+ bb.build.exec_func("sysroot_stage_all", d)
+ #os.system('cp -pPR %s/* %s/' % (dest, sysrootdest))
+ for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
+ bb.build.exec_func(f, d)
+ bb.build.exec_func("packagedstaging_fastpath", d)
+
+ lock = bb.utils.lockfile(lockfile)
+ os.system(bb.data.expand('cp -pPR ${SYSROOT_DESTDIR}${TMPDIR}/* ${TMPDIR}/', d))
+ bb.utils.unlockfile(lock)
}
addtask install after do_compile
@@ -1034,6 +1127,8 @@ addtask build after do_populate_staging
do_build = ""
do_build[func] = "1"
+inherit packagedata
+
# Functions that update metadata based on files outputted
# during the build process.
@@ -1054,88 +1149,6 @@ def explode_deps(s):
r.append(i)
return r
-def packaged(pkg, d):
- import os, bb
- return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
-
-def read_pkgdatafile(fn):
- pkgdata = {}
-
- def decode(str):
- import codecs
- c = codecs.getdecoder("string_escape")
- return c(str)[0]
-
- import os
- if os.access(fn, os.R_OK):
- import re
- f = file(fn, 'r')
- lines = f.readlines()
- f.close()
- r = re.compile("([^:]+):\s*(.*)")
- for l in lines:
- m = r.match(l)
- if m:
- pkgdata[m.group(1)] = decode(m.group(2))
-
- return pkgdata
-
-def get_subpkgedata_fn(pkg, d):
- import bb, os
- archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
- archs.reverse()
- pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
- targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
- for arch in archs:
- fn = pkgdata + arch + targetdir + pkg
- if os.path.exists(fn):
- return fn
- return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
-
-def has_subpkgdata(pkg, d):
- import bb, os
- return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
-
-def read_subpkgdata(pkg, d):
- import bb
- return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
-
-def has_pkgdata(pn, d):
- import bb, os
- fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
- return os.access(fn, os.R_OK)
-
-def read_pkgdata(pn, d):
- import bb
- fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
- return read_pkgdatafile(fn)
-
-python read_subpackage_metadata () {
- import bb
- data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
-
- for key in data.keys():
- bb.data.setVar(key, data[key], d)
-
- for pkg in bb.data.getVar('PACKAGES', d, 1).split():
- sdata = read_subpkgdata(pkg, d)
- for key in sdata.keys():
- bb.data.setVar(key, sdata[key], d)
-}
-
-
-#
-# Collapse FOO_pkg variables into FOO
-#
-def read_subpkgdata_dict(pkg, d):
- import bb
- ret = {}
- subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
- for var in subd:
- newvar = var.replace("_" + pkg, "")
- ret[newvar] = subd[var]
- return ret
-
# Make sure MACHINE isn't exported
# (breaks binutils at least)
MACHINE[unexport] = "1"
@@ -1151,7 +1164,7 @@ DISTRO[unexport] = "1"
def base_after_parse(d):
- import bb, os, exceptions
+ import exceptions
source_mirror_fetch = bb.data.getVar('SOURCE_MIRROR_FETCH', d, 0)
if not source_mirror_fetch:
@@ -1234,19 +1247,12 @@ def base_after_parse(d):
bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
python () {
- import bb
- from bb import __version__
base_after_parse(d)
+ if is_legacy_staging(d):
+ bb.debug(1, "Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
+ if bb.data.getVarFlags('do_stage', d) is None:
+ bb.error("This recipe (%s) has a do_stage_prepend or do_stage_append and do_stage now doesn't exist. Please rename this to do_stage()" % bb.data.getVar("FILE", d, True))
- # Remove this for bitbake 1.8.12
- try:
- from distutils.version import LooseVersion
- except ImportError:
- def LooseVersion(v): print "WARNING: sanity.bbclass can't compare versions without python-distutils"; return 1
- if (LooseVersion(__version__) >= LooseVersion('1.8.11')):
- deps = bb.data.getVarFlag('do_rebuild', 'deps', d) or []
- deps.append('do_' + bb.data.getVar('BB_DEFAULT_TASK', d, 1))
- bb.data.setVarFlag('do_rebuild', 'deps', deps, d)
}
def check_app_exists(app, d):
@@ -1276,7 +1282,7 @@ inherit patch
# Move to autotools.bbclass?
inherit siteinfo
-EXPORT_FUNCTIONS do_setscene do_clean do_mrproper do_distclean do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall
+EXPORT_FUNCTIONS do_setscene do_clean do_mrproper do_distclean do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_rebuild do_fetchall
MIRRORS[func] = "0"
MIRRORS () {
diff --git a/classes/binconfig.bbclass b/classes/binconfig.bbclass
index 5789903178..b3b2236709 100644
--- a/classes/binconfig.bbclass
+++ b/classes/binconfig.bbclass
@@ -1,10 +1,7 @@
-inherit base
-
FILES_${PN}-dev += "${bindir}/*-config"
# The namespaces can clash here hence the two step replace
def get_binconfig_mangle(d):
- import bb.data
s = "-e ''"
if not bb.data.inherits_class('native', d):
optional_quote = r"\(\"\?\)"
@@ -18,8 +15,8 @@ def get_binconfig_mangle(d):
s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
s += " -e 's:OEDATADIR:${STAGING_DATADIR}:'"
- s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${layout_prefix}:'"
- s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${layout_exec_prefix}:'"
+ s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${prefix}:'"
+ s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${exec_prefix}:'"
s += " -e 's:-I${WORKDIR}:-I${STAGING_INCDIR}:'"
s += " -e 's:-L${WORKDIR}:-L${STAGING_LIBDIR}:'"
if bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d):
@@ -28,34 +25,34 @@ def get_binconfig_mangle(d):
BINCONFIG_GLOB ?= "*-config"
-do_install_append() {
-
- #the 'if' protects native packages, since we can't easily check for bb.data.inherits_class('native', d) in shell
- if [ -e ${D}${bindir} ] ; then
- for config in `find ${S} -name '${BINCONFIG_GLOB}'`; do
- cat $config | sed \
- -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
- -e 's:${STAGING_INCDIR}:${includedir}:g;' \
- -e 's:${STAGING_DATADIR}:${datadir}:' \
- -e 's:${STAGING_DIR_HOST}${layout_prefix}:${prefix}:' > ${D}${bindir}/`basename $config`
- done
- fi
+PACKAGE_PREPROCESS_FUNCS += "binconfig_package_preprocess"
- for lafile in `find ${D} -name "*.la"` ; do
+binconfig_package_preprocess () {
+ for config in `find ${PKGD} -name '${BINCONFIG_GLOB}'`; do
+ sed -i \
+ -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+ -e 's:${STAGING_INCDIR}:${includedir}:g;' \
+ -e 's:${STAGING_DATADIR}:${datadir}:' \
+ -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
+ $config
+ done
+ for lafile in `find ${PKGD} -name "*.la"` ; do
sed -i \
-e 's:${STAGING_LIBDIR}:${libdir}:g;' \
-e 's:${STAGING_INCDIR}:${includedir}:g;' \
-e 's:${STAGING_DATADIR}:${datadir}:' \
- -e 's:${STAGING_DIR_HOST}${layout_prefix}:${prefix}:' \
+ -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
$lafile
done
}
-do_stage_append() {
+SYSROOT_PREPROCESS_FUNCS += "binconfig_sysroot_preprocess"
+
+binconfig_sysroot_preprocess () {
for config in `find ${S} -name '${BINCONFIG_GLOB}'`; do
configname=`basename $config`
- install -d ${STAGING_BINDIR_CROSS}
- cat $config | sed ${@get_binconfig_mangle(d)} > ${STAGING_BINDIR_CROSS}/$configname
- chmod u+x ${STAGING_BINDIR_CROSS}/$configname
+ install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
+ cat $config | sed ${@get_binconfig_mangle(d)} > ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/$configname
+ chmod u+x ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/$configname
done
}
diff --git a/classes/canadian-cross.bbclass b/classes/canadian-cross.bbclass
index 474fb1d2ba..514aaeb414 100644
--- a/classes/canadian-cross.bbclass
+++ b/classes/canadian-cross.bbclass
@@ -1,3 +1,8 @@
+#
+# Note this class is deprecated and replaced by cross-canadian.bbclass
+#
+
+
# Canadian cross packages are built indirectly via dependency,
# no need for them to be a direct target of 'world'
EXCLUDE_FROM_WORLD = "1"
@@ -41,31 +46,31 @@ oldincludedir = "${exec_prefix}/include"
# Path prefixes
export base_prefix = "${STAGING_DIR_HOST}"
-export prefix = "${STAGING_DIR_HOST}${layout_prefix}"
-export exec_prefix = "${STAGING_DIR_HOST}${layout_exec_prefix}"
+export prefix = "${STAGING_DIR_HOST}/usr"
+export exec_prefix = "${STAGING_DIR_HOST}/usr"
# Base paths
-export base_bindir = "${STAGING_DIR_HOST}${layout_base_bindir}"
-export base_sbindir = "${STAGING_DIR_HOST}${layout_base_sbindir}"
-export base_libdir = "${STAGING_DIR_HOST}${layout_base_libdir}"
+export base_bindir = "${STAGING_DIR_HOST}/bin"
+export base_sbindir = "${STAGING_DIR_HOST}/sbin"
+export base_libdir = "${STAGING_DIR_HOST}/lib"
# Architecture independent paths
-export datadir = "${STAGING_DIR_HOST}${layout_datadir}"
-export sysconfdir = "${STAGING_DIR_HOST}${layout_sysconfdir}"
-export sharedstatedir = "${STAGING_DIR_HOST}${layout_sharedstatedir}"
-export localstatedir = "${STAGING_DIR_HOST}${layout_localstatedir}"
-export infodir = "${STAGING_DIR_HOST}${layout_infodir}"
-export mandir = "${STAGING_DIR_HOST}${layout_mandir}"
-export docdir = "${STAGING_DIR_HOST}${layout_docdir}"
-export servicedir = "${STAGING_DIR_HOST}${layout_servicedir}"
+export datadir = "${STAGING_DIR_HOST}/usr/share"
+export sysconfdir = "${STAGING_DIR_HOST}/etc"
+export sharedstatedir = "${STAGING_DIR_HOST}/com"
+export localstatedir = "${STAGING_DIR_HOST}/var"
+export infodir = "${STAGING_DIR_HOST}/usr/info"
+export mandir = "${STAGING_DIR_HOST}/usr/man"
+export docdir = "${STAGING_DIR_HOST}/usr/doc"
+export servicedir = "${STAGING_DIR_HOST}/srv"
# Architecture dependent paths
-export bindir = "${STAGING_DIR_HOST}${layout_bindir}"
-export sbindir = "${STAGING_DIR_HOST}${layout_sbindir}"
-export libexecdir = "${STAGING_DIR_HOST}${layout_libexecdir}"
-export libdir = "${STAGING_DIR_HOST}${layout_libdir}"
-export includedir = "${STAGING_DIR_HOST}${layout_includedir}"
-export oldincludedir = "${STAGING_DIR_HOST}${layout_includedir}"
+export bindir = "${STAGING_DIR_HOST}/usr/bin"
+export sbindir = "${STAGING_DIR_HOST}/usr/sbin"
+export libexecdir = "${STAGING_DIR_HOST}/usr/libexec"
+export libdir = "${STAGING_DIR_HOST}/usr/lib"
+export includedir = "${STAGING_DIR_HOST}/usr/include"
+export oldincludedir = "${STAGING_DIR_HOST}/usr/include"
do_stage () {
oe_runmake install
diff --git a/classes/canadian-native.bbclass b/classes/canadian-native.bbclass
index d572ab5990..3cd003cb4b 100644
--- a/classes/canadian-native.bbclass
+++ b/classes/canadian-native.bbclass
@@ -1,4 +1,6 @@
-inherit base
+#
+# Note this class is deprecated and replaced by nativesdk.bbclass
+#
# Canadian native packages are built indirectly via dependency,
# no need for them to be a direct target of 'world'
@@ -43,33 +45,14 @@ export AS = "${SDK_PREFIX}as"
export RANLIB = "${SDK_PREFIX}ranlib"
export STRIP = "${SDK_PREFIX}strip"
-# Path prefixes
-export base_prefix = "${STAGING_DIR_HOST}"
-export prefix = "${STAGING_DIR_HOST}${layout_prefix}"
-export exec_prefix = "${STAGING_DIR_HOST}${layout_exec_prefix}"
-# Base paths
-export base_bindir = "${STAGING_DIR_HOST}${layout_base_bindir}"
-export base_sbindir = "${STAGING_DIR_HOST}${layout_base_sbindir}"
-export base_libdir = "${STAGING_DIR_HOST}${layout_base_libdir}"
+# Change to place files in SDKPATH
+prefix = "${SDKPATH}"
+exec_prefix = "${SDKPATH}"
+base_prefix = "${SDKPATH}"
-# Architecture independent paths
-export datadir = "${STAGING_DIR_HOST}${layout_datadir}"
-export sysconfdir = "${STAGING_DIR_HOST}${layout_sysconfdir}"
-export sharedstatedir = "${STAGING_DIR_HOST}${layout_sharedstatedir}"
-export localstatedir = "${STAGING_DIR_HOST}${layout_localstatedir}"
-export infodir = "${STAGING_DIR_HOST}${layout_infodir}"
-export mandir = "${STAGING_DIR_HOST}${layout_mandir}"
-export docdir = "${STAGING_DIR_HOST}${layout_docdir}"
-export servicedir = "${STAGING_DIR_HOST}${layout_servicedir}"
-
-# Architecture dependent paths
-export bindir = "${STAGING_DIR_HOST}${layout_bindir}"
-export sbindir = "${STAGING_DIR_HOST}${layout_sbindir}"
-export libexecdir = "${STAGING_DIR_HOST}${layout_libexecdir}"
-export libdir = "${STAGING_DIR_HOST}${layout_libdir}"
-export includedir = "${STAGING_DIR_HOST}${layout_includedir}"
-export oldincludedir = "${STAGING_DIR_HOST}${layout_includedir}"
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
do_stage () {
if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ]
diff --git a/classes/canadian-sdk.bbclass b/classes/canadian-sdk.bbclass
index a6c5552310..94db57796e 100644
--- a/classes/canadian-sdk.bbclass
+++ b/classes/canadian-sdk.bbclass
@@ -1,3 +1,7 @@
+#
+# Note this class is deprecated and replaced by crosssdk.bbclass
+#
+
# Canadian SDK packages are built either explicitly by the user,
# or indirectly via dependency. No need to be in 'world'.
EXCLUDE_FROM_WORLD = "1"
diff --git a/classes/canadian.bbclass b/classes/canadian.bbclass
index f359a8df7f..8edce1412c 100644
--- a/classes/canadian.bbclass
+++ b/classes/canadian.bbclass
@@ -1,3 +1,8 @@
+#
+# Note this class is deprecated
+#
+
+
# For Canadian SDKs we need to know what these values start out as, and use
# them as well as the updated ones.
OLD_PACKAGE_ARCH := "${PACKAGE_ARCH}"
diff --git a/classes/cpan-base.bbclass b/classes/cpan-base.bbclass
index 19d431ce72..82fd5b459a 100644
--- a/classes/cpan-base.bbclass
+++ b/classes/cpan-base.bbclass
@@ -9,8 +9,8 @@ RDEPENDS += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
# Determine the staged version of perl from the perl configuration file
def get_perl_version(d):
- import os, bb, re
- cfg = bb.data.expand('${STAGING_DIR_HOST}/perl/config.sh', d)
+ import re
+ cfg = bb.data.expand('${STAGING_LIBDIR}/perl/config.sh', d)
try:
f = open(cfg, 'r')
except IOError:
@@ -33,7 +33,6 @@ def is_new_perl(d):
# Determine where the library directories are
def perl_get_libdirs(d):
- import bb
libdir = bb.data.getVar('libdir', d, 1)
if is_new_perl(d) == "yes":
libdirs = libdir + '/perl5'
@@ -42,7 +41,6 @@ def perl_get_libdirs(d):
return libdirs
def is_target(d):
- import bb
if not bb.data.inherits_class('native', d):
return "yes"
return "no"
diff --git a/classes/cpan.bbclass b/classes/cpan.bbclass
index 7b3faa2561..66054bc755 100644
--- a/classes/cpan.bbclass
+++ b/classes/cpan.bbclass
@@ -16,7 +16,7 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}/perl/${@get_perl_version(d)}"
cpan_do_configure () {
yes '' | perl Makefile.PL ${EXTRA_CPANFLAGS}
if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
- . ${STAGING_DIR_TARGET}/perl/config.sh
+ . ${STAGING_LIBDIR}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
sed -i -e "s:\(SITELIBEXP = \).*:\1${sitelibexp}:" \
-e "s:\(SITEARCHEXP = \).*:\1${sitearchexp}:" \
diff --git a/classes/cpan_build.bbclass b/classes/cpan_build.bbclass
index c3804ff4cc..2ca01996a9 100644
--- a/classes/cpan_build.bbclass
+++ b/classes/cpan_build.bbclass
@@ -25,7 +25,7 @@ DEPENDS_prepend = "${@cpan_build_dep_prepend(d)}"
cpan_build_do_configure () {
if [ ${@is_target(d)} == "yes" ]; then
# build for target
- . ${STAGING_DIR_TARGET}/perl/config.sh
+ . ${STAGING_LIBDIR}/perl/config.sh
if [ "${IS_NEW_PERL}" = "yes" ]; then
perl Build.PL --installdirs vendor \
--destdir ${D} \
diff --git a/classes/cross-canadian.bbclass b/classes/cross-canadian.bbclass
new file mode 100644
index 0000000000..bd738ecd4d
--- /dev/null
+++ b/classes/cross-canadian.bbclass
@@ -0,0 +1,46 @@
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency. No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+
+# Save MULTIMACH_ARCH
+OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}"
+# Save PACKAGE_ARCH
+OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
+PACKAGE_ARCH = "${SDK_ARCH}-${TARGET_ARCH}-canadian"
+PACKAGE_ARCHS = "${PACKAGE_ARCH}"
+# Also save BASE_PACKAGE_ARCH since HOST_ARCH can influence it
+OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}"
+BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-nativesdk"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${BASEPKG_TARGET_SYS}"
+
+PATH_append = ":${TMPDIR}/cross/${HOST_ARCH}/${bindir_cross}"
+PKGDATA_DIR = "${TMPDIR}/pkgdata/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
+# Change to place files in SDKPATH
+prefix = "${SDKPATH}"
+exec_prefix = "${SDKPATH}"
+base_prefix = "${SDKPATH}"
+
+FILES_${PN} = "${prefix}"
+FILES_${PN}-dbg += "${prefix}/.debug \
+ ${prefix}/bin/.debug \
+ "
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
diff --git a/classes/cross.bbclass b/classes/cross.bbclass
index 68e3803f3e..1de157c0f5 100644
--- a/classes/cross.bbclass
+++ b/classes/cross.bbclass
@@ -28,34 +28,11 @@ LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}"
TOOLCHAIN_OPTIONS = ""
# Overrides for paths
-
-# Path prefixes
-base_prefix = "${exec_prefix}"
prefix = "${CROSS_DIR}"
+base_prefix = "${prefix}"
exec_prefix = "${prefix}"
-
-# Base paths
-base_bindir = "${base_prefix}/bin"
base_sbindir = "${base_prefix}/bin"
-base_libdir = "${base_prefix}/lib"
-
-# Architecture independent paths
-datadir = "${prefix}/share"
-sysconfdir = "${prefix}/etc"
-sharedstatedir = "${prefix}/com"
-localstatedir = "${prefix}/var"
-infodir = "${datadir}/info"
-mandir = "${datadir}/man"
-docdir = "${datadir}/doc"
-servicedir = "${prefix}/srv"
-
-# Architecture dependent paths
-bindir = "${exec_prefix}/bin"
sbindir = "${exec_prefix}/bin"
-libexecdir = "${exec_prefix}/libexec"
-libdir = "${exec_prefix}/lib"
-includedir = "${exec_prefix}/include"
-oldincludedir = "${exec_prefix}/include"
do_stage () {
oe_runmake install
diff --git a/classes/crosssdk.bbclass b/classes/crosssdk.bbclass
new file mode 100644
index 0000000000..0b1af8fc2f
--- /dev/null
+++ b/classes/crosssdk.bbclass
@@ -0,0 +1,15 @@
+inherit cross
+
+PACKAGES = ""
+
+BASE_PACKAGE_ARCH = "${SDK_ARCH}"
+PACKAGE_ARCH = "${BASE_PACKAGE_ARCH}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+
+
diff --git a/classes/debian.bbclass b/classes/debian.bbclass
index 0afe9fcc39..8f6e7d88cf 100644
--- a/classes/debian.bbclass
+++ b/classes/debian.bbclass
@@ -16,7 +16,7 @@ do_package_write_rpm[rdeptask] = "do_package"
python debian_package_name_hook () {
import glob, copy, stat, errno, re
- workdir = bb.data.getVar('WORKDIR', d, 1)
+ pkgdest = bb.data.getVar('PKGDEST', d, 1)
packages = bb.data.getVar('PACKAGES', d, 1)
def socrunch(s):
@@ -45,7 +45,7 @@ python debian_package_name_hook () {
sonames = []
has_bins = 0
has_libs = 0
- pkg_dir = os.path.join(workdir, "install", orig_pkg)
+ pkg_dir = os.path.join(pkgdest, orig_pkg)
for root, dirs, files in os.walk(pkg_dir):
if bin_re.match(root) and files:
has_bins = 1
diff --git a/classes/distutils.bbclass b/classes/distutils.bbclass
index ea4184b235..4d1fc8c6fc 100644
--- a/classes/distutils.bbclass
+++ b/classes/distutils.bbclass
@@ -2,7 +2,7 @@ inherit distutils-base
DISTUTILS_BUILD_ARGS ?= ""
DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
-DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${layout_prefix} \
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
--install-data=${STAGING_DATADIR}"
DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
--install-data=${D}/${datadir}"
@@ -16,7 +16,7 @@ distutils_do_compile() {
}
distutils_stage_headers() {
- install -d ${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages
+ install -d ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR}/site-packages
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
${STAGING_BINDIR_NATIVE}/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
oefatal "python setup.py install_headers execution failed."
@@ -25,8 +25,8 @@ distutils_stage_headers() {
distutils_stage_all() {
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
- install -d ${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages
- PYTHONPATH=${STAGING_DIR_HOST}${layout_libdir}/${PYTHON_DIR}/site-packages \
+ install -d ${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR}/site-packages
+ PYTHONPATH=${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR}/site-packages \
BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
oefatal "python setup.py install (stage) execution failed."
diff --git a/classes/manifest.bbclass b/classes/manifest.bbclass
index 687f4b756e..8d714d3bbc 100644
--- a/classes/manifest.bbclass
+++ b/classes/manifest.bbclass
@@ -1,6 +1,6 @@
python read_manifest () {
- import sys, bb.manifest
+ import sys
mfn = bb.data.getVar("MANIFEST", d, 1)
if os.access(mfn, os.R_OK):
# we have a manifest, so emit do_stage and do_populate_pkgs,
diff --git a/classes/native.bbclass b/classes/native.bbclass
index 69231e0b6b..6292e4b121 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -52,48 +52,66 @@ export RANLIB = "${HOST_PREFIX}ranlib"
export STRIP = "${HOST_PREFIX}strip"
# Path prefixes
-export base_prefix = "${STAGING_DIR_NATIVE}"
-export prefix = "${STAGING_DIR_NATIVE}${layout_prefix}"
-export exec_prefix = "${STAGING_DIR_NATIVE}${layout_exec_prefix}"
-
-# Base paths
-export base_bindir = "${STAGING_DIR_NATIVE}${layout_base_bindir}"
-export base_sbindir = "${STAGING_DIR_NATIVE}${layout_base_sbindir}"
-export base_libdir = "${STAGING_DIR_NATIVE}${layout_base_libdir}"
-
-# Architecture independent paths
-export datadir = "${STAGING_DIR_NATIVE}${layout_datadir}"
-export sysconfdir = "${STAGING_DIR_NATIVE}${layout_sysconfdir}"
-export sharedstatedir = "${STAGING_DIR_NATIVE}${layout_sharedstatedir}"
-export localstatedir = "${STAGING_DIR_NATIVE}${layout_localstatedir}"
-export infodir = "${STAGING_DIR_NATIVE}${layout_infodir}"
-export mandir = "${STAGING_DIR_NATIVE}${layout_mandir}"
-export docdir = "${STAGING_DIR_NATIVE}${layout_docdir}"
-export servicedir = "${STAGING_DIR_NATIVE}${layout_servicedir}"
-
-# Architecture dependent paths
-export bindir = "${STAGING_DIR_NATIVE}${layout_bindir}"
-export sbindir = "${STAGING_DIR_NATIVE}${layout_sbindir}"
-export libexecdir = "${STAGING_DIR_NATIVE}${layout_libexecdir}"
-export libdir = "${STAGING_DIR_NATIVE}${layout_libdir}"
-export includedir = "${STAGING_DIR_NATIVE}${layout_includedir}"
-export oldincludedir = "${STAGING_DIR_NATIVE}${layout_includedir}"
-
-do_stage () {
- if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ]
+base_prefix = "${STAGING_DIR_NATIVE}"
+prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+
+# Since we actually install these into situ there is no staging prefix
+STAGING_DIR_HOST = ""
+STAGING_DIR_TARGET = ""
+SHLIBSDIR = "${STAGING_DIR_NATIVE}/shlibs"
+PKG_CONFIG_DIR = "${libdir}/pkgconfig"
+
+do_stage_native () {
+ # If autotools is active, use the autotools staging function, else
+ # use our "make install" equivalent
+ if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" == "1" ]
then
- if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ]
- then
- oe_runmake install
- else
- autotools_stage_all
- fi
+ autotools_stage_all
+ else
+ oe_runmake install
fi
}
-do_install () {
- true
+do_stage () {
+ do_stage_native
}
PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
PKG_CONFIG_SYSROOT_DIR = ""
+
+ORIG_DEPENDS := "${DEPENDS}"
+
+DEPENDS_virtclass-native ?= "${ORIG_DEPENDS}"
+
+python __anonymous () {
+ # If we've a legacy native do_stage, we need to neuter do_install
+ stagefunc = bb.data.getVar('do_stage', d, True)
+ if (stagefunc.strip() != "do_stage_native" and stagefunc.strip() != "autotools_stage_all") and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
+ bb.data.setVar("do_install", " :", d)
+
+ if "native" in (bb.data.getVar('BBCLASSEXTEND', d, True) or ""):
+ pn = bb.data.getVar("PN", d, True)
+ depends = bb.data.getVar("DEPENDS_virtclass-native", d, True)
+ deps = bb.utils.explode_deps(depends)
+ newdeps = []
+ for dep in deps:
+ if dep.endswith("-cross"):
+ newdeps.append(dep.replace("-cross", "-native"))
+ elif not dep.endswith("-native"):
+
+ newdeps.append(dep + "-native")
+ else:
+ newdeps.append(dep)
+ bb.data.setVar("DEPENDS_virtclass-native", " ".join(newdeps), d)
+ provides = bb.data.getVar("PROVIDES", d, True)
+ for prov in provides.split():
+ if prov.find(pn) != -1:
+ continue
+ if not prov.endswith("-native"):
+
+ provides = provides.replace(prov, prov + "-native")
+ bb.data.setVar("PROVIDES", provides, d)
+ bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", d, False) + ":virtclass-native", d)
+}
+
diff --git a/classes/nativesdk.bbclass b/classes/nativesdk.bbclass
new file mode 100644
index 0000000000..080adc5d77
--- /dev/null
+++ b/classes/nativesdk.bbclass
@@ -0,0 +1,78 @@
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency. No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+
+#
+# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
+#
+OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH}
+BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+python () {
+ archs = bb.data.getVar('PACKAGE_ARCHS', d, True).split()
+ sdkarchs = []
+ for arch in archs:
+ sdkarchs.append(arch + '-nativesdk')
+ bb.data.setVar('PACKAGE_ARCHS', " ".join(sdkarchs), d)
+}
+
+#STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_SYS}-nativesdk"
+#STAGING_DIR_TARGET = "${STAGING_DIR}/${BASEPKG_TARGET_SYS}-nativesdk"
+
+CROSS_DIR = "${TMPDIR}/cross/${HOST_ARCH}"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
+# Change to place files in SDKPATH
+prefix = "${SDKPATH}"
+exec_prefix = "${SDKPATH}"
+base_prefix = "${SDKPATH}"
+
+FILES_${PN} += "${prefix}"
+FILES_${PN}-dbg += "${prefix}/.debug \
+ ${prefix}/bin/.debug \
+ "
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
+python __anonymous () {
+ pn = bb.data.getVar("PN", d, True)
+ depends = bb.data.getVar("DEPENDS", d, True)
+ deps = bb.utils.explode_deps(depends)
+ newdeps = []
+ for dep in deps:
+ if dep.endswith("-native") or dep.endswith("-cross"):
+ newdeps.append(dep)
+ elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc"):
+ newdeps.append(dep + "-crosssdk")
+ elif not dep.endswith("-nativesdk"):
+ newdeps.append(dep + "-nativesdk")
+ else:
+ newdeps.append(dep)
+ bb.data.setVar("DEPENDS", " ".join(newdeps), d)
+ provides = bb.data.getVar("PROVIDES", d, True)
+ for prov in provides.split():
+ if prov.find(pn) != -1:
+ continue
+ if not prov.endswith("-nativesdk"):
+ provides = provides.replace(prov, prov + "-nativesdk")
+ bb.data.setVar("PROVIDES", provides, d)
+}
+
+
diff --git a/classes/package.bbclass b/classes/package.bbclass
index e7865754eb..1c14908f1a 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -2,7 +2,8 @@
# General packaging help functions
#
-PKGDEST = "${WORKDIR}/install"
+PKGD = "${WORKDIR}/package"
+PKGDEST = "${WORKDIR}/packages-split"
def legitimize_package_name(s):
"""
@@ -28,10 +29,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst
"""
import os, os.path, bb
- dvar = bb.data.getVar('D', d, True)
- if not dvar:
- bb.error("D not defined")
- return
+ dvar = bb.data.getVar('PKGD', d, True)
packages = bb.data.getVar('PACKAGES', d, True).split()
@@ -302,15 +300,8 @@ python package_do_split_locales() {
bb.note("datadir not defined")
return
- dvar = bb.data.getVar('D', d, True)
- if not dvar:
- bb.error("D not defined")
- return
-
+ dvar = bb.data.getVar('PKGD', d, True)
pn = bb.data.getVar('PN', d, True)
- if not pn:
- bb.error("PN not defined")
- return
if pn + '-locale' in packages:
packages.remove(pn + '-locale')
@@ -343,34 +334,29 @@ python package_do_split_locales() {
bb.data.setVar('PACKAGES', ' '.join(packages), d)
}
-python populate_packages () {
- import glob, stat, errno, re
+python perform_packagecopy () {
+ import os
- workdir = bb.data.getVar('WORKDIR', d, True)
- if not workdir:
- bb.error("WORKDIR not defined, unable to package")
- return
+ dest = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
- import os # path manipulations
- outdir = bb.data.getVar('DEPLOY_DIR', d, True)
- if not outdir:
- bb.error("DEPLOY_DIR not defined, unable to package")
- return
- bb.mkdirhier(outdir)
-
- dvar = bb.data.getVar('D', d, True)
- if not dvar:
- bb.error("D not defined, unable to package")
- return
bb.mkdirhier(dvar)
- packages = bb.data.getVar('PACKAGES', d, True)
+ # Start by package population by taking a copy of the installed
+ # files to operate on
+ os.system('cp -pPR %s/* %s/' % (dest, dvar))
+}
+
+python populate_packages () {
+ import os, glob, stat, errno, re
+ workdir = bb.data.getVar('WORKDIR', d, True)
+ outdir = bb.data.getVar('DEPLOY_DIR', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
+ packages = bb.data.getVar('PACKAGES', d, True)
pn = bb.data.getVar('PN', d, True)
- if not pn:
- bb.error("PN not defined")
- return
+ bb.mkdirhier(outdir)
os.chdir(dvar)
def isexec(path):
@@ -542,6 +528,7 @@ python emit_pkgdata() {
return
packages = bb.data.getVar('PACKAGES', d, True)
+ pkgdest = bb.data.getVar('PKGDEST', d, 1)
pkgdatadir = bb.data.getVar('PKGDATA_DIR', d, True)
pstageactive = bb.data.getVar('PSTAGING_ACTIVE', d, True)
@@ -585,7 +572,7 @@ python emit_pkgdata() {
allow_empty = bb.data.getVar('ALLOW_EMPTY_%s' % pkg, d, True)
if not allow_empty:
allow_empty = bb.data.getVar('ALLOW_EMPTY', d, True)
- root = "%s/install/%s" % (workdir, pkg)
+ root = "%s/%s" % (pkgdest, pkg)
os.chdir(root)
g = glob('*') + glob('.[!.]*')
if g or allow_empty == "1":
@@ -621,9 +608,6 @@ python package_do_shlibs() {
packages = bb.data.getVar('PACKAGES', d, True)
workdir = bb.data.getVar('WORKDIR', d, True)
- if not workdir:
- bb.error("WORKDIR not defined")
- return
ver = bb.data.getVar('PV', d, True)
if not ver:
@@ -787,12 +771,7 @@ python package_do_pkgconfig () {
import re, os
packages = bb.data.getVar('PACKAGES', d, True)
-
workdir = bb.data.getVar('WORKDIR', d, True)
- if not workdir:
- bb.error("WORKDIR not defined")
- return
-
pkgdest = bb.data.getVar('PKGDEST', d, True)
shlibs_dir = bb.data.getVar('SHLIBSDIR', d, True)
@@ -1012,8 +991,10 @@ python package_depchains() {
pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
}
-
-PACKAGEFUNCS ?= "package_do_split_locales \
+PACKAGE_PREPROCESS_FUNCS ?= ""
+PACKAGEFUNCS ?= "perform_packagecopy \
+ ${PACKAGE_PREPROCESS_FUNCS} \
+ package_do_split_locales \
populate_packages \
package_do_shlibs \
package_do_pkgconfig \
@@ -1059,6 +1040,16 @@ python package_do_package () {
bb.debug(1, "No packages to build, skipping do_package")
return
+ workdir = bb.data.getVar('WORKDIR', d, True)
+ outdir = bb.data.getVar('DEPLOY_DIR', d, True)
+ dest = bb.data.getVar('D', d, True)
+ dvar = bb.data.getVar('PKGD', d, True)
+ pn = bb.data.getVar('PN', d, True)
+
+ if not workdir or not outdir or not dest or not dvar or not pn or not packages:
+ bb.error("WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package")
+ return
+
for f in (bb.data.getVar('PACKAGEFUNCS', d, True) or '').split():
bb.build.exec_func(f, d)
package_run_hooks(f, d)
diff --git a/classes/packaged-staging.bbclass b/classes/packaged-staging.bbclass
index 3b97f593b8..013f22dead 100644
--- a/classes/packaged-staging.bbclass
+++ b/classes/packaged-staging.bbclass
@@ -27,7 +27,6 @@ PSTAGE_NATIVEDEPENDS = "\
BB_STAMP_WHITELIST = "${PSTAGE_NATIVEDEPENDS}"
python () {
- import bb
pstage_allowed = True
# These classes encode staging paths into the binary data so can only be
@@ -110,7 +109,7 @@ def pstage_cleanpackage(pkgname, d):
list_cmd = bb.data.getVar("PSTAGE_LIST_CMD", d, True)
bb.debug(2, "Checking if staging package installed")
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+ lf = bb.utils.lockfile(bb.data.expand("${SYSROOT_LOCK}", d))
ret = os.system("PATH=\"%s\" %s | grep %s" % (path, list_cmd, pkgname))
if ret == 0:
bb.debug(1, "Uninstalling package from staging...")
@@ -152,12 +151,12 @@ staging_helper () {
done
echo "dest root /" >> $conffile
fi
- if [ ! -e ${TMPDIR}${layout_libdir}/opkg/info/ ]; then
- mkdir -p ${TMPDIR}${layout_libdir}/opkg/info/
+ if [ ! -e ${TMPDIR}${libdir}/opkg/info/ ]; then
+ mkdir -p ${TMPDIR}${libdir}/opkg/info/
fi
- if [ ! -e ${TMPDIR}${layout_libdir}/ipkg/ ]; then
- cd ${TMPDIR}${layout_libdir}/
- ln -sf opkg/ ipkg
+ if [ ! -e ${TMPDIR}${libdir}/ipkg/ ]; then
+ cd ${TMPDIR}${libdir}/
+ ln -sf opkg/ ipkg || true
fi
}
@@ -174,6 +173,7 @@ python packagestage_scenefunc () {
bb.build.exec_func("staging_helper", d)
removepkg = bb.data.expand("${PSTAGE_PKGPN}", d)
+
pstage_cleanpackage(removepkg, d)
stagepkg = bb.data.expand("${PSTAGE_PKG}", d)
@@ -187,7 +187,7 @@ python packagestage_scenefunc () {
#
# Install the staging package somewhere temporarily so we can extract the stamp files
#
- bb.mkdirhier(bb.data.expand("${WORKDIR}/tstage/${layout_libdir}/opkg/info/ ", d))
+ bb.mkdirhier(bb.data.expand("${WORKDIR}/tstage/${libdir_native}/opkg/info/ ", d))
cmd = bb.data.expand("${PSTAGE_PKGMANAGER} -f ${PSTAGE_MACHCONFIG} -force-depends -o ${WORKDIR}/tstage install", d)
ret = os.system("PATH=\"%s\" %s %s" % (path, cmd, stagepkg))
if ret != 0:
@@ -228,7 +228,7 @@ python packagestage_scenefunc () {
if stageok:
bb.note("Staging package found, using it for %s." % file)
installcmd = bb.data.getVar("PSTAGE_INSTALL_CMD", d, 1)
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+ lf = bb.utils.lockfile(bb.data.expand("${SYSROOT_LOCK}", d))
ret = os.system("PATH=\"%s\" %s %s" % (path, installcmd, stagepkg))
bb.utils.unlockfile(lf)
if ret != 0:
@@ -292,13 +292,21 @@ populate_staging_postamble () {
fi
}
-do_populate_staging[lockfiles] = "${STAGING_DIR}/staging.lock"
+packagedstaging_fastpath () {
+ if [ "$PSTAGING_ACTIVE" = "1" ]; then
+ mkdir -p ${PSTAGE_TMPDIR_STAGE}/staging/
+ mkdir -p ${PSTAGE_TMPDIR_STAGE}/cross/
+ cp -fpPR ${SYSROOT_DESTDIR}/${STAGING_DIR}/* ${PSTAGE_TMPDIR_STAGE}/staging/ || /bin/true
+ cp -fpPR ${SYSROOT_DESTDIR}/${CROSS_DIR}/* ${PSTAGE_TMPDIR_STAGE}/cross/ || /bin/true
+ fi
+}
+
do_populate_staging[dirs] =+ "${DEPLOY_DIR_PSTAGE}"
-python do_populate_staging_prepend() {
+python populate_staging_prehook() {
bb.build.exec_func("populate_staging_preamble", d)
}
-python do_populate_staging_append() {
+python populate_staging_posthook() {
bb.build.exec_func("populate_staging_postamble", d)
}
@@ -329,20 +337,20 @@ staging_packager () {
staging_package_installer () {
#${PSTAGE_INSTALL_CMD} ${PSTAGE_PKG}
- STATUSFILE=${TMPDIR}${layout_libdir}/opkg/status
+ STATUSFILE=${TMPDIR}${libdir}/opkg/status
echo "Package: ${PSTAGE_PKGPN}" >> $STATUSFILE
echo "Version: ${PSTAGE_PKGVERSION}" >> $STATUSFILE
echo "Status: install user installed" >> $STATUSFILE
echo "Architecture: ${PSTAGE_PKGARCH}" >> $STATUSFILE
echo "" >> $STATUSFILE
- CTRLFILE=${TMPDIR}${layout_libdir}/opkg/info/${PSTAGE_PKGPN}.control
+ CTRLFILE=${TMPDIR}${libdir}/opkg/info/${PSTAGE_PKGPN}.control
echo "Package: ${PSTAGE_PKGPN}" > $CTRLFILE
echo "Version: ${PSTAGE_PKGVERSION}" >> $CTRLFILE
echo "Architecture: ${PSTAGE_PKGARCH}" >> $CTRLFILE
cd ${PSTAGE_TMPDIR_STAGE}
- find -type f | grep -v ./CONTROL | sed -e 's/^\.//' > ${TMPDIR}${layout_libdir}/opkg/info/${PSTAGE_PKGPN}.list
+ find -type f | grep -v ./CONTROL | sed -e 's/^\.//' > ${TMPDIR}${libdir}/opkg/info/${PSTAGE_PKGPN}.list
}
python do_package_stage () {
@@ -420,7 +428,7 @@ python do_package_stage () {
pstage_set_pkgmanager(d)
bb.build.exec_func("staging_helper", d)
bb.build.exec_func("staging_packager", d)
- lf = bb.utils.lockfile(bb.data.expand("${STAGING_DIR}/staging.lock", d))
+ lf = bb.utils.lockfile(bb.data.expand("${SYSROOT_LOCK}", d))
bb.build.exec_func("staging_package_installer", d)
bb.utils.unlockfile(lf)
}
diff --git a/classes/packagedata.bbclass b/classes/packagedata.bbclass
new file mode 100644
index 0000000000..86f18a9e96
--- /dev/null
+++ b/classes/packagedata.bbclass
@@ -0,0 +1,73 @@
+def packaged(pkg, d):
+ return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
+
+def read_pkgdatafile(fn):
+ pkgdata = {}
+
+ def decode(str):
+ import codecs
+ c = codecs.getdecoder("string_escape")
+ return c(str)[0]
+
+ if os.access(fn, os.R_OK):
+ import re
+ f = file(fn, 'r')
+ lines = f.readlines()
+ f.close()
+ r = re.compile("([^:]+):\s*(.*)")
+ for l in lines:
+ m = r.match(l)
+ if m:
+ pkgdata[m.group(1)] = decode(m.group(2))
+
+ return pkgdata
+
+def get_subpkgedata_fn(pkg, d):
+ archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
+ archs.reverse()
+ pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
+ targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
+ for arch in archs:
+ fn = pkgdata + arch + targetdir + pkg
+ if os.path.exists(fn):
+ return fn
+ return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
+
+def has_subpkgdata(pkg, d):
+ return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
+
+def read_subpkgdata(pkg, d):
+ return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+
+def has_pkgdata(pn, d):
+ fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
+ return os.access(fn, os.R_OK)
+
+def read_pkgdata(pn, d):
+ fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
+ return read_pkgdatafile(fn)
+
+python read_subpackage_metadata () {
+ data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
+
+ for key in data.keys():
+ bb.data.setVar(key, data[key], d)
+
+ for pkg in bb.data.getVar('PACKAGES', d, 1).split():
+ sdata = read_subpkgdata(pkg, d)
+ for key in sdata.keys():
+ bb.data.setVar(key, sdata[key], d)
+}
+
+
+#
+# Collapse FOO_pkg variables into FOO
+#
+def read_subpkgdata_dict(pkg, d):
+ ret = {}
+ subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+ for var in subd:
+ newvar = var.replace("_" + pkg, "")
+ ret[newvar] = subd[var]
+ return ret
+
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index dfb8ec960f..bb49fed7a1 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -76,8 +76,6 @@ def patch_init(d):
def __str__(self):
return "Patch Error: %s" % self.msg
- import bb, bb.data, bb.fetch
-
class PatchSet(object):
defaults = {
"strippath": 1
@@ -457,8 +455,6 @@ do_patch[depends] = "${PATCHDEPENDENCY}"
python patch_do_patch() {
import re
- import bb.fetch
-
patch_init(d)
src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split()
diff --git a/classes/pkgconfig.bbclass b/classes/pkgconfig.bbclass
index 2a8199d135..de892b5413 100644
--- a/classes/pkgconfig.bbclass
+++ b/classes/pkgconfig.bbclass
@@ -9,10 +9,12 @@ for i in `find ${S}/ -name "*.pc" -type f` ; do \
done
}
-do_stage_append () {
- install -d ${PKG_CONFIG_DIR}
+SYSROOT_PREPROCESS_FUNCS += "pkgconfig_sysroot_preprocess"
+
+pkgconfig_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${PKG_CONFIG_DIR}
for pc in `find ${S} -name '*.pc' -type f | grep -v -- '-uninstalled.pc$'`; do
pcname=`basename $pc`
- cat $pc > ${PKG_CONFIG_DIR}/$pcname
+ cat $pc > ${SYSROOT_DESTDIR}${PKG_CONFIG_DIR}/$pcname
done
}
diff --git a/classes/recipe_sanity.bbclass b/classes/recipe_sanity.bbclass
index 29f4a8fada..d929da6319 100644
--- a/classes/recipe_sanity.bbclass
+++ b/classes/recipe_sanity.bbclass
@@ -1,10 +1,8 @@
def __note(msg, d):
- import bb
bb.note("%s: recipe_sanity: %s" % (d.getVar("P", 1), msg))
__recipe_sanity_badtargetvars = "RDEPENDS RPROVIDES"
def bad_target_vars(cfgdata, d):
- import bb.data
if bb.data.inherits_class("native", d) or \
bb.data.inherits_class("cross", d):
return
@@ -43,14 +41,12 @@ def var_renames_overwrite(cfgdata, d):
__note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d)
def incorrect_nonempty_PACKAGES(cfgdata, d):
- import bb.data
if bb.data.inherits_class("native", d) or \
bb.data.inherits_class("cross", d):
if d.getVar("PACKAGES", 1):
return True
def can_use_autotools_base(cfgdata, d):
- import bb
cfg = d.getVar("do_configure", 1)
if not bb.data.inherits_class("autotools", d):
return False
@@ -68,8 +64,6 @@ def can_use_autotools_base(cfgdata, d):
return True
def can_remove_FILESPATH(cfgdata, d):
- import os
- import bb
expected = cfgdata.get("FILESPATH")
#expected = "${@':'.join([os.path.normpath(os.path.join(fp, p, o)) for fp in d.getVar('FILESPATHBASE', 1).split(':') for p in d.getVar('FILESPATHPKG', 1).split(':') for o in (d.getVar('OVERRIDES', 1) + ':').split(':') if os.path.exists(os.path.join(fp, p, o))])}:${FILESDIR}"
expectedpaths = bb.data.expand(expected, d)
@@ -84,8 +78,6 @@ def can_remove_FILESPATH(cfgdata, d):
return expected != unexpanded
def can_remove_FILESDIR(cfgdata, d):
- import os
- import bb
expected = cfgdata.get("FILESDIR")
#expected = "${@bb.which(d.getVar('FILESPATH', 1), '.')}"
unexpanded = d.getVar("FILESDIR", 0)
@@ -102,7 +94,6 @@ def can_remove_FILESDIR(cfgdata, d):
expanded == bb.data.expand(expected, d))
def can_remove_others(p, cfgdata, d):
- import bb
for k in ["S", "PV", "PN", "DESCRIPTION", "LICENSE", "DEPENDS",
"SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
#for k in cfgdata:
diff --git a/classes/scons.bbclass b/classes/scons.bbclass
index cd5de61e6d..b139411c19 100644
--- a/classes/scons.bbclass
+++ b/classes/scons.bbclass
@@ -13,7 +13,7 @@ scons_do_install() {
scons_do_stage() {
install -d ${D}${prefix}
- ${STAGING_BINDIR_NATIVE}/scons PREFIX=${STAGING_DIR_HOST}/${layout_prefix} prefix=${STAGING_DIR_HOST}/${layout_prefix} install || \
+ ${STAGING_BINDIR_NATIVE}/scons PREFIX=${STAGING_DIR_HOST}/${prefix} prefix=${STAGING_DIR_HOST}/${prefix} install || \
oefatal "scons stage execution failed."
}
diff --git a/classes/sdk.bbclass b/classes/sdk.bbclass
index eb34bd04b5..198d147cb3 100644
--- a/classes/sdk.bbclass
+++ b/classes/sdk.bbclass
@@ -1,3 +1,8 @@
+#
+# Note this class is deprecated and replaced by nativesdk.bbclass
+#
+
+
# SDK packages are built either explicitly by the user,
# or indirectly via dependency. No need to be in 'world'.
EXCLUDE_FROM_WORLD = "1"
diff --git a/classes/xlibs.bbclass b/classes/xlibs.bbclass
index ae8f928f1e..fc52400b9f 100644
--- a/classes/xlibs.bbclass
+++ b/classes/xlibs.bbclass
@@ -6,10 +6,10 @@ XLIBS_CVS = "${FREEDESKTOP_CVS}/xlibs"
inherit autotools pkgconfig
do_stage() {
- oe_runmake install prefix=${STAGING_DIR_HOST}${layout_prefix} \
+ oe_runmake install prefix=${STAGING_DIR_HOST}${prefix} \
bindir=${STAGING_BINDIR} \
includedir=${STAGING_INCDIR} \
libdir=${STAGING_LIBDIR} \
datadir=${STAGING_DATADIR} \
- mandir=${STAGING_DIR_HOST}${layout_mandir}
+ mandir=${STAGING_DIR_HOST}${mandir}
}