summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 644e73121b..3fe4bf9a07 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