summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2009-11-11 09:13:32 +0100
committerStefan Schmidt <stefan@datenfreihafen.org>2009-11-11 09:13:32 +0100
commite51de62ba9a8ee53f6df29ab682598348496ee66 (patch)
treee2b32db587e5ae1314cc7142245c3dc49ff116ac /classes
parenta8352578a40067db10fee76f0c910d007311376c (diff)
parentcaec0ee3d05082277c1af4863b6d653109f5714e (diff)
Merge branch 'org.openembedded.dev' of git.openembedded.org:openembedded into org.openembedded.dev
Diffstat (limited to 'classes')
-rw-r--r--classes/autotools.bbclass79
-rw-r--r--classes/base.bbclass299
-rw-r--r--classes/binconfig.bbclass42
-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.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/native.bbclass92
-rw-r--r--classes/nativesdk.bbclass78
-rw-r--r--classes/package.bbclass81
-rw-r--r--classes/packaged-staging.bbclass39
-rw-r--r--classes/packagedata.bbclass73
-rw-r--r--classes/pkgconfig.bbclass8
-rw-r--r--classes/scons.bbclass2
-rw-r--r--classes/sdk.bbclass5
-rw-r--r--classes/xlibs.bbclass4
22 files changed, 577 insertions, 412 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..aa1037e472 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
}
-do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${layout_bindir} ${STAGING_DIR_TARGET}/${layout_libdir} \
- ${STAGING_DIR_TARGET}/${layout_includedir} \
+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}
+}
+
+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,59 @@ 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))
+ 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 +1125,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 +1147,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 +1162,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 +1245,9 @@ def base_after_parse(d):
bb.data.setVar('MULTIMACH_ARCH', multiarch, d)
python () {
- import bb
- from bb import __version__
base_after_parse(d)
-
- # 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)
+ if is_legacy_staging(d):
+ bb.debug(1, "Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
}
def check_app_exists(app, d):
@@ -1276,7 +1277,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..dad54a5f56 100644
--- a/classes/binconfig.bbclass
+++ b/classes/binconfig.bbclass
@@ -1,5 +1,3 @@
-inherit base
-
FILES_${PN}-dev += "${bindir}/*-config"
# The namespaces can clash here hence the two step replace
@@ -18,8 +16,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 +26,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 19d431c