summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-09-24 16:25:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-10-27 09:44:54 +0100
commitea220105609de30498f4ba72f5aeec180de4be2f (patch)
tree0a0e16e1d0fd6c03fe8ed2af964e24ab0c3e1a0c
parent511f7f9d0422fe1a896361b53179c9f642c1fc0b (diff)
downloadpoky-ea220105609de30498f4ba72f5aeec180de4be2f.tar.gz
multilib: Add support for cross-canadian multilib packages
Add support for the generation of cross-canadian packages. Each cross-canadian package has: PN = "pkg-cross-canadian-${TRANSLATED_TARGET_ARCH}" in order for that to be evaluated properly with multilibs enabled, it was necessary to detect both the presence of the cross-canadian packages and then update the vars using the OVERRIDE for the multilib. Additional checks were made to ensure that any dependency that sais "cross-canadian" did not get prefixed with the MLPREFIX. Also, make sure that even when building multilib cross-canadian packages, we only use the single SDK PACKAGE_ARCH, we don't want or need variants. (From OE-Core rev: 132a182e2f6c330aa645de42c1aeb386e43bddd3) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass39
-rw-r--r--meta/classes/multilib.bbclass18
-rw-r--r--meta/lib/oe/classextend.py4
3 files changed, 53 insertions, 8 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f254306d3b..12a30c953c 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -183,6 +183,8 @@ def preferred_ml_updates(d):
183 providers.append(v) 183 providers.append(v)
184 184
185 for pkg, reason in blacklists.items(): 185 for pkg, reason in blacklists.items():
186 if pkg.endswith("-native") or pkg.startswith("nativesdk-") or 'cross-canadian' in pkg:
187 continue
186 for p in prefixes: 188 for p in prefixes:
187 newpkg = p + "-" + pkg 189 newpkg = p + "-" + pkg
188 if not d.getVarFlag('PNBLACKLIST', newpkg, True): 190 if not d.getVarFlag('PNBLACKLIST', newpkg, True):
@@ -193,6 +195,17 @@ def preferred_ml_updates(d):
193 pkg = v.replace("PREFERRED_VERSION_", "") 195 pkg = v.replace("PREFERRED_VERSION_", "")
194 if pkg.endswith("-native") or pkg.startswith("nativesdk-"): 196 if pkg.endswith("-native") or pkg.startswith("nativesdk-"):
195 continue 197 continue
198 if 'cross-canadian' in pkg:
199 for p in prefixes:
200 localdata = bb.data.createCopy(d)
201 override = ":virtclass-multilib-" + p
202 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
203 bb.data.update_data(localdata)
204 newname = localdata.expand(v)
205 if newname != v:
206 newval = localdata.getVar(v, True)
207 d.setVar(newname, newval)
208 continue
196 for p in prefixes: 209 for p in prefixes:
197 newname = "PREFERRED_VERSION_" + p + "-" + pkg 210 newname = "PREFERRED_VERSION_" + p + "-" + pkg
198 if not d.getVar(newname, False): 211 if not d.getVar(newname, False):
@@ -203,14 +216,36 @@ def preferred_ml_updates(d):
203 pkg = prov.replace("PREFERRED_PROVIDER_", "") 216 pkg = prov.replace("PREFERRED_PROVIDER_", "")
204 if pkg.endswith("-native") or pkg.startswith("nativesdk-"): 217 if pkg.endswith("-native") or pkg.startswith("nativesdk-"):
205 continue 218 continue
219 if 'cross-canadian' in pkg:
220 for p in prefixes:
221 localdata = bb.data.createCopy(d)
222 override = ":virtclass-multilib-" + p
223 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
224 bb.data.update_data(localdata)
225 newname = localdata.expand(prov)
226 if newname != prov:
227 newval = localdata.expand(val)
228 d.setVar(newname, newval)
229 continue
206 virt = "" 230 virt = ""
207 if pkg.startswith("virtual/"): 231 if pkg.startswith("virtual/"):
208 pkg = pkg.replace("virtual/", "") 232 pkg = pkg.replace("virtual/", "")
209 virt = "virtual/" 233 virt = "virtual/"
210 for p in prefixes: 234 for p in prefixes:
211 newname = "PREFERRED_PROVIDER_" + virt + p + "-" + pkg
212 if pkg != "kernel": 235 if pkg != "kernel":
213 val = p + "-" + val 236 val = p + "-" + val
237
238 # implement variable keys
239 localdata = bb.data.createCopy(d)
240 override = ":virtclass-multilib-" + p
241 localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
242 bb.data.update_data(localdata)
243 newname = localdata.expand(prov)
244 if newname != prov:
245 d.setVar(newname, localdata.expand(val))
246
247 # implement alternative multilib name
248 newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg)
214 if not d.getVar(newname, False): 249 if not d.getVar(newname, False):
215 d.setVar(newname, val) 250 d.setVar(newname, val)
216 251
@@ -218,7 +253,7 @@ def preferred_ml_updates(d):
218 mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split() 253 mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
219 extramp = [] 254 extramp = []
220 for p in mp: 255 for p in mp:
221 if p.endswith("-native") or p.startswith("nativesdk-"): 256 if p.endswith("-native") or p.startswith("nativesdk-") or 'cross-canadian' in p:
222 continue 257 continue
223 virt = "" 258 virt = ""
224 if p.startswith("virtual/"): 259 if p.startswith("virtual/"):
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
index 3824f3b117..de6e59e39d 100644
--- a/meta/classes/multilib.bbclass
+++ b/meta/classes/multilib.bbclass
@@ -18,6 +18,13 @@ python multilib_virtclass_handler () {
18 e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False)) 18 e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
19 return 19 return
20 20
21 if bb.data.inherits_class('cross-canadian', e.data):
22 e.data.setVar("MLPREFIX", variant + "-")
23 override = ":virtclass-multilib-" + variant
24 e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
25 bb.data.update_data(e.data)
26 return
27
21 if bb.data.inherits_class('native', e.data): 28 if bb.data.inherits_class('native', e.data):
22 raise bb.parse.SkipPackage("We can't extend native recipes") 29 raise bb.parse.SkipPackage("We can't extend native recipes")
23 30
@@ -69,12 +76,16 @@ python __anonymous () {
69 if bb.data.inherits_class('image', d) or bb.data.inherits_class('populate_sdk_base', d): 76 if bb.data.inherits_class('image', d) or bb.data.inherits_class('populate_sdk_base', d):
70 return 77 return
71 78
79 clsextend.map_depends_variable("DEPENDS")
80 clsextend.map_variable("PROVIDES")
81
82 if bb.data.inherits_class('cross-canadian', d):
83 return
84
72 clsextend.rename_packages() 85 clsextend.rename_packages()
73 clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split()) 86 clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
74 87
75 clsextend.map_depends_variable("DEPENDS")
76 clsextend.map_packagevars() 88 clsextend.map_packagevars()
77 clsextend.map_variable("PROVIDES")
78 clsextend.map_regexp_variable("PACKAGES_DYNAMIC") 89 clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
79 clsextend.map_variable("PACKAGE_INSTALL") 90 clsextend.map_variable("PACKAGE_INSTALL")
80 clsextend.map_variable("INITSCRIPT_PACKAGES") 91 clsextend.map_variable("INITSCRIPT_PACKAGES")
@@ -90,7 +101,7 @@ python do_package_qa_multilib() {
90 for i in values: 101 for i in values:
91 if i.startswith('virtual/'): 102 if i.startswith('virtual/'):
92 i = i[len('virtual/'):] 103 i = i[len('virtual/'):]
93 if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)): 104 if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)) and (not 'cross-canadian' in i):
94 candidates.append(i) 105 candidates.append(i)
95 if len(candidates) > 0: 106 if len(candidates) > 0:
96 bb.warn("Multilib QA Issue: %s package %s - suspicious values '%s' in %s" 107 bb.warn("Multilib QA Issue: %s package %s - suspicious values '%s' in %s"
@@ -109,4 +120,3 @@ python do_package_qa_multilib() {
109 check_mlprefix(pkg, 'RREPLACES', ml) 120 check_mlprefix(pkg, 'RREPLACES', ml)
110 check_mlprefix(pkg, 'RCONFLICTS', ml) 121 check_mlprefix(pkg, 'RCONFLICTS', ml)
111} 122}
112
diff --git a/meta/lib/oe/classextend.py b/meta/lib/oe/classextend.py
index 857a6c97ef..c982fb7c3f 100644
--- a/meta/lib/oe/classextend.py
+++ b/meta/lib/oe/classextend.py
@@ -50,7 +50,7 @@ class ClassExtender(object):
50 return newdata 50 return newdata
51 51
52 def map_depends(self, dep): 52 def map_depends(self, dep):
53 if dep.endswith(("-native", "-native-runtime")): 53 if dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('cross-canadian' in dep):
54 return dep 54 return dep
55 else: 55 else:
56 return self.extend_name(dep) 56 return self.extend_name(dep)
@@ -93,7 +93,7 @@ class ClassExtender(object):
93 93
94class NativesdkClassExtender(ClassExtender): 94class NativesdkClassExtender(ClassExtender):
95 def map_depends(self, dep): 95 def map_depends(self, dep):
96 if dep.endswith(("-native", "-native-runtime", "-cross")): 96 if dep.endswith(("-native", "-native-runtime", "-cross")) or ('nativesdk-' in dep):
97 return dep 97 return dep
98 elif dep.endswith(("-gcc-intermediate", "-gcc-initial", "-gcc", "-g++")): 98 elif dep.endswith(("-gcc-intermediate", "-gcc-initial", "-gcc", "-g++")):
99 return dep + "-crosssdk" 99 return dep + "-crosssdk"