diff options
Diffstat (limited to 'classes/base.bbclass')
-rw-r--r-- | classes/base.bbclass | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index d3bfa768c1..8bac509115 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -9,6 +9,32 @@ inherit utils inherit utility-tasks inherit metadata_scm +python sys_path_eh () { + if isinstance(e, bb.event.ConfigParsed): + import sys + import os + import time + + bbpath = e.data.getVar("BBPATH", True).split(":") + sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath] + + def inject(name, value): + """Make a python object accessible from everywhere for the metadata""" + if hasattr(bb.utils, "_context"): + bb.utils._context[name] = value + else: + __builtins__[name] = value + + import oe.path + import oe.utils + inject("bb", bb) + inject("sys", sys) + inject("time", time) + inject("oe", oe) +} + +addhandler sys_path_eh + die() { oefatal "$*" } @@ -37,11 +63,10 @@ def base_dep_prepend(d): # the case where host == build == target, for now we don't work in # that case though. # - deps = "shasum-native coreutils-native" - if bb.data.getVar('PN', d, True) == "shasum-native" or bb.data.getVar('PN', d, True) == "stagemanager-native": + deps = "coreutils-native" + if bb.data.getVar('PN', d, True) in ("shasum-native", "stagemanager-native", + "coreutils-native"): deps = "" - if bb.data.getVar('PN', d, True) == "coreutils-native": - deps = "shasum-native" # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not # we need that built is the responsibility of the patch function / class, not @@ -76,7 +101,6 @@ addtask setscene before do_fetch addtask fetch do_fetch[dirs] = "${DL_DIR}" -do_fetch[depends] = "shasum-native:do_populate_staging" python base_do_fetch() { import sys @@ -183,7 +207,7 @@ def oe_unpack_file(file, data, url = None): cmd = 'cp -pPR %s %s/%s/' % (file, os.getcwd(), destdir) else: (type, host, path, user, pswd, parm) = bb.decodeurl(url) - if not 'patch' in parm: + if not 'apply' in parm and not 'patch' in parm: # The "destdir" handling was specifically done for FILESPATH # items. So, only do so for file:// entries. if type == "file": @@ -225,10 +249,9 @@ python base_do_unpack() { localdata = bb.data.createCopy(d) bb.data.update_data(localdata) - src_uri = bb.data.getVar('SRC_URI', localdata) + src_uri = bb.data.getVar('SRC_URI', localdata, True) if not src_uri: return - src_uri = bb.data.expand(src_uri, localdata) for url in src_uri.split(): try: local = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) @@ -302,7 +325,7 @@ python base_eventhandler() { addtask configure after do_unpack do_patch do_configure[dirs] = "${S} ${B}" -do_configure[deptask] = "do_populate_staging" +do_configure[deptask] = "do_populate_sysroot" base_do_configure() { : } @@ -317,7 +340,6 @@ base_do_compile() { fi } - addtask install after do_compile do_install[dirs] = "${D} ${S} ${B}" # Remove and re-create ${D} so that is it guaranteed to be empty @@ -365,11 +387,13 @@ python () { if use_nls != None: bb.data.setVar('USE_NLS', use_nls, d) + setup_checksum_deps(d) + # Git packages should DEPEND on git-native srcuri = bb.data.getVar('SRC_URI', d, 1) if "git://" in srcuri: depends = bb.data.getVarFlag('do_fetch', 'depends', d) or "" - depends = depends + " git-native:do_populate_staging" + depends = depends + " git-native:do_populate_sysroot" bb.data.setVarFlag('do_fetch', 'depends', depends, d) # unzip-native should already be staged before unpacking ZIP recipes @@ -378,7 +402,7 @@ python () { if ".zip" in src_uri or need_unzip == "1": depends = bb.data.getVarFlag('do_unpack', 'depends', d) or "" - depends = depends + " unzip-native:do_populate_staging" + depends = depends + " unzip-native:do_populate_sysroot" bb.data.setVarFlag('do_unpack', 'depends', depends, d) # 'multimachine' handling |