summaryrefslogtreecommitdiffstats
path: root/meta/classes/nativesdk.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-13 13:36:12 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-13 21:38:06 (GMT)
commit0a641fea281f4634c377596398e4e876dbfb4af4 (patch)
tree0fade6926aec52358f41c9ab409cbb84170287cd /meta/classes/nativesdk.bbclass
parente112d46c9fdf4f2c834a6c50627767479a1da43c (diff)
downloadpoky-0a641fea281f4634c377596398e4e876dbfb4af4.tar.gz
nativesdk.bbclass: Correct ordering of manipulations
OVERDIDES is the key variable that needs to be set prior to data finalisation. The other variables should be manipulated after finalisation so any DEPENDS_prepend and _append are accounted for. This patch ensures this is the case. The PACKAGES maniupulations are not enabled at this time as they don't function 100% correctly yet. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/nativesdk.bbclass')
-rw-r--r--meta/classes/nativesdk.bbclass53
1 files changed, 37 insertions, 16 deletions
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 644e731..3fe4bf9 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -62,27 +62,48 @@ python nativesdk_virtclass_handler () {
62 if not pn.endswith("-nativesdk"): 62 if not pn.endswith("-nativesdk"):
63 return 63 return
64 64
65 depends = bb.data.getVar("DEPENDS", e.data, True) 65 bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", e.data, False) + ":virtclass-nativesdk", e.data)
66 deps = bb.utils.explode_deps(depends) 66}
67 newdeps = [] 67
68 for dep in deps: 68python () {
69 if dep.endswith("-native") or dep.endswith("-cross"): 69 pn = bb.data.getVar("PN", d, True)
70 newdeps.append(dep) 70 if not pn.endswith("-nativesdk"):
71 elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc") or dep.endswith("-g++"): 71 return
72 newdeps.append(dep + "-crosssdk") 72
73 elif not dep.endswith("-nativesdk"): 73 def map_dependencies(varname, d, suffix = ""):
74 newdeps.append(dep + "-nativesdk") 74 if suffix:
75 else: 75 varname = varname + "_" + suffix
76 newdeps.append(dep) 76 deps = bb.data.getVar(varname, d, True)
77 bb.data.setVar("DEPENDS", " ".join(newdeps), e.data) 77 if not deps:
78 provides = bb.data.getVar("PROVIDES", e.data, True) 78 return
79 deps = bb.utils.explode_deps(deps)
80 newdeps = []
81 for dep in deps:
82 if dep.endswith("-native") or dep.endswith("-cross"):
83 newdeps.append(dep)
84 elif dep.endswith("-gcc-intermediate") or dep.endswith("-gcc-initial") or dep.endswith("-gcc") or dep.endswith("-g++"):
85 newdeps.append(dep + "-crosssdk")
86 elif not dep.endswith("-nativesdk"):
87 newdeps.append(dep.replace("-nativesdk", "") + "-nativesdk")
88 else:
89 newdeps.append(dep)
90 bb.data.setVar(varname, " ".join(newdeps), d)
91
92 map_dependencies("DEPENDS", d)
93 #for pkg in (d.getVar("PACKAGES", True).split() + [""]):
94 # map_dependencies("RDEPENDS", d, pkg)
95 # map_dependencies("RRECOMMENDS", d, pkg)
96 # map_dependencies("RSUGGESTS", d, pkg)
97 # map_dependencies("RPROVIDES", d, pkg)
98 # map_dependencies("RREPLACES", d, pkg)
99
100 provides = bb.data.getVar("PROVIDES", d, True)
79 for prov in provides.split(): 101 for prov in provides.split():
80 if prov.find(pn) != -1: 102 if prov.find(pn) != -1:
81 continue 103 continue
82 if not prov.endswith("-nativesdk"): 104 if not prov.endswith("-nativesdk"):
83 provides = provides.replace(prov, prov + "-nativesdk") 105 provides = provides.replace(prov, prov + "-nativesdk")
84 bb.data.setVar("PROVIDES", provides, e.data) 106 bb.data.setVar("PROVIDES", provides, d)
85 bb.data.setVar("OVERRIDES", bb.data.getVar("OVERRIDES", e.data, False) + ":virtclass-nativesdk", e.data)
86} 107}
87 108
88addhandler nativesdk_virtclass_handler 109addhandler nativesdk_virtclass_handler