summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/nativesdk.bbclass49
1 files changed, 13 insertions, 36 deletions
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
index 7deaafc670..8c0cd5bea1 100644
--- a/meta/classes/nativesdk.bbclass
+++ b/meta/classes/nativesdk.bbclass
@@ -59,51 +59,28 @@ python nativesdk_virtclass_handler () {
59 return 59 return
60 60
61 pn = e.data.getVar("PN", True) 61 pn = e.data.getVar("PN", True)
62 if not pn.endswith("-nativesdk"): 62 if not pn.endswith("-nativesdk") or pn.startswith("nativesdk-"):
63 return 63 return
64 64
65 e.data.setVar("MLPREFIX", "nativesdk-")
66 e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", ""))
65 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk") 67 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
66} 68}
67 69
68python () { 70python () {
69 pn = d.getVar("PN", True) 71 pn = d.getVar("PN", True)
70 if not pn.endswith("-nativesdk"): 72 if not pn.startswith("nativesdk-"):
71 return 73 return
72 74
73 def map_dependencies(varname, d, suffix = ""): 75 import oe.classextend
74 if suffix: 76
75 varname = varname + "_" + suffix 77 clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
76 deps = d.getVar(varname, True) 78 clsextend.rename_packages()
77 if not deps: 79 clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
78 return 80
79 deps = bb.utils.explode_deps(deps) 81 clsextend.map_depends_variable("DEPENDS")
80 newdeps = [] 82 clsextend.map_packagevars()
81 for dep in deps: 83 clsextend.map_variable("PROVIDES")
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 d.setVar(varname, " ".join(newdeps))
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 = d.getVar("PROVIDES", True)
101 for prov in provides.split():
102 if prov.find(pn) != -1:
103 continue
104 if not prov.endswith("-nativesdk"):
105 provides = provides.replace(prov, prov + "-nativesdk")
106 d.setVar("PROVIDES", provides)
107} 84}
108 85
109addhandler nativesdk_virtclass_handler 86addhandler nativesdk_virtclass_handler