Patchwork [1/2] cross.bbclass: add virtclass handler

login
register
mail settings
Submitter Otavio Salvador
Date Feb. 8, 2012, 12:22 p.m.
Message ID <05b7171b30b32b1915be322ff43c7be5f5b8e84f.1328703672.git.otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/21009/
State Accepted
Commit 9624a817bb7d2d9fce10704b1c1a047f93260f36
Headers show

Comments

Otavio Salvador - Feb. 8, 2012, 12:22 p.m.
Allow use of BBCLASSEXTEND with 'cross' and use of virtclass-cross in
recipes.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/cross.bbclass |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 5681ab9..8da3048 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -55,6 +55,23 @@  libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}"
 
+python cross_virtclass_handler () {
+    if not isinstance(e, bb.event.RecipePreFinalise):
+        return
+
+    classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
+    if "cross" not in classextend:
+        return
+
+    pn = e.data.getVar("PN", True)
+    if not pn.endswith("-cross"):
+        return
+
+    bb.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-cross", e.data)
+}
+
+addhandler cross_virtclass_handler
+
 do_install () {
 	oe_runmake 'DESTDIR=${D}' install
 }