summaryrefslogtreecommitdiffstats
path: root/meta/classes/native.bbclass
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2021-05-31 22:34:04 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-01 14:03:49 +0100
commit9d1b332292a94cd4463f1e88dfe293847264714e (patch)
treeb65516b9bdd59dfee27601aab135d87d63f0e1e6 /meta/classes/native.bbclass
parent0b94e36b5fa868183394315e36a2bc6356af0fa8 (diff)
downloadpoky-9d1b332292a94cd4463f1e88dfe293847264714e.tar.gz
native.bbclass: Do not remove "-native" in the middle of recipe names
For dependencies such as "${PN}-foo", when modifying them for native recipes, it is expected that they become "${BPN}-foo-native" rather than "${BPN}-native-foo-native". This was previously done by removing all occurences of "-native" from the dependency before adding "-native" at the end. However, this fails for a recipe such as "crate-native-tls" that happens to contain the string "-native" in the middle of the name. Solve this by simply replacing ${PN} with ${BPN} in the name instead before adding "-native" at the end Also simplify adding "-native" to the end of names the recipe provides. In this case it is not necessary to replace ${PN} with ${BPN} as the recipes are expected to use ${BPN}-foo in the first place. (From OE-Core rev: edaf8ff278fc96b122c4fc3266b63856e3350f4c) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/native.bbclass')
-rw-r--r--meta/classes/native.bbclass8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index a0838e41b9..561cc23f68 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -119,6 +119,7 @@ python native_virtclass_handler () {
119 pn = e.data.getVar("PN") 119 pn = e.data.getVar("PN")
120 if not pn.endswith("-native"): 120 if not pn.endswith("-native"):
121 return 121 return
122 bpn = e.data.getVar("BPN")
122 123
123 # Set features here to prevent appends and distro features backfill 124 # Set features here to prevent appends and distro features backfill
124 # from modifying native distro features 125 # from modifying native distro features
@@ -146,7 +147,10 @@ python native_virtclass_handler () {
146 elif "-cross-" in dep: 147 elif "-cross-" in dep:
147 newdeps.append(dep.replace("-cross", "-native")) 148 newdeps.append(dep.replace("-cross", "-native"))
148 elif not dep.endswith("-native"): 149 elif not dep.endswith("-native"):
149 newdeps.append(dep.replace("-native", "") + "-native") 150 # Replace ${PN} with ${BPN} in the dependency to make sure
151 # dependencies on, e.g., ${PN}-foo become ${BPN}-foo-native
152 # rather than ${BPN}-native-foo-native.
153 newdeps.append(dep.replace(pn, bpn) + "-native")
150 else: 154 else:
151 newdeps.append(dep) 155 newdeps.append(dep)
152 d.setVar(varname, " ".join(newdeps), parsing=True) 156 d.setVar(varname, " ".join(newdeps), parsing=True)
@@ -166,7 +170,7 @@ python native_virtclass_handler () {
166 if prov.find(pn) != -1: 170 if prov.find(pn) != -1:
167 nprovides.append(prov) 171 nprovides.append(prov)
168 elif not prov.endswith("-native"): 172 elif not prov.endswith("-native"):
169 nprovides.append(prov.replace(prov, prov + "-native")) 173 nprovides.append(prov + "-native")
170 else: 174 else:
171 nprovides.append(prov) 175 nprovides.append(prov)
172 e.data.setVar("PROVIDES", ' '.join(nprovides)) 176 e.data.setVar("PROVIDES", ' '.join(nprovides))