2011-07-27 15:21:48 +00:00
|
|
|
python multilib_virtclass_handler () {
|
|
|
|
cls = e.data.getVar("BBEXTENDCURR", True)
|
|
|
|
variant = e.data.getVar("BBEXTENDVARIANT", True)
|
|
|
|
if cls != "multilib" or not variant:
|
|
|
|
return
|
2011-08-15 22:59:32 +00:00
|
|
|
|
2012-09-30 00:19:14 +00:00
|
|
|
e.data.setVar('STAGING_KERNEL_DIR', e.data.getVar('STAGING_KERNEL_DIR', True))
|
|
|
|
|
2011-08-15 22:59:32 +00:00
|
|
|
# There should only be one kernel in multilib configs
|
2013-01-31 18:31:04 +00:00
|
|
|
# We also skip multilib setup for module packages.
|
|
|
|
provides = (e.data.getVar("PROVIDES", True) or "").split()
|
|
|
|
if "virtual/kernel" in provides or bb.data.inherits_class('module-base', e.data):
|
2011-08-15 22:59:32 +00:00
|
|
|
raise bb.parse.SkipPackage("We shouldn't have multilib variants for the kernel")
|
|
|
|
|
2013-02-11 16:04:10 +00:00
|
|
|
save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
|
|
|
|
for name in save_var_name.split():
|
|
|
|
val=e.data.getVar(name, True)
|
|
|
|
if val:
|
|
|
|
e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
|
|
|
|
|
2015-05-02 09:04:37 +00:00
|
|
|
overrides = e.data.getVar("OVERRIDES", False)
|
|
|
|
pn = e.data.getVar("PN", False)
|
|
|
|
overrides = overrides.replace("pn-${PN}", "pn-${PN}:pn-" + pn)
|
|
|
|
e.data.setVar("OVERRIDES", overrides)
|
|
|
|
|
2011-09-22 21:15:58 +00:00
|
|
|
if bb.data.inherits_class('image', e.data):
|
2012-09-22 12:29:56 +00:00
|
|
|
e.data.setVar("MLPREFIX", variant + "-")
|
2011-09-22 21:15:58 +00:00
|
|
|
e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
|
2014-10-16 07:16:25 +00:00
|
|
|
target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False)
|
|
|
|
if target_vendor:
|
|
|
|
e.data.setVar("TARGET_VENDOR", target_vendor)
|
2011-09-22 21:15:58 +00:00
|
|
|
return
|
|
|
|
|
2012-09-24 21:25:37 +00:00
|
|
|
if bb.data.inherits_class('cross-canadian', e.data):
|
|
|
|
e.data.setVar("MLPREFIX", variant + "-")
|
|
|
|
override = ":virtclass-multilib-" + variant
|
|
|
|
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
|
|
|
|
bb.data.update_data(e.data)
|
|
|
|
return
|
|
|
|
|
2012-08-02 07:49:06 +00:00
|
|
|
if bb.data.inherits_class('native', e.data):
|
|
|
|
raise bb.parse.SkipPackage("We can't extend native recipes")
|
|
|
|
|
2012-09-26 23:01:04 +00:00
|
|
|
if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
|
2012-09-22 12:29:57 +00:00
|
|
|
raise bb.parse.SkipPackage("We can't extend nativesdk recipes")
|
|
|
|
|
2012-12-24 11:28:38 +00:00
|
|
|
if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
|
|
|
|
raise bb.parse.SkipPackage("Don't extend allarch recipes which are not packagegroups")
|
|
|
|
|
2012-04-14 21:46:17 +00:00
|
|
|
|
|
|
|
# Expand this since this won't work correctly once we set a multilib into place
|
|
|
|
e.data.setVar("ALL_MULTILIB_PACKAGE_ARCHS", e.data.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
|
2011-08-15 22:59:32 +00:00
|
|
|
|
2011-07-27 15:21:48 +00:00
|
|
|
override = ":virtclass-multilib-" + variant
|
|
|
|
|
|
|
|
e.data.setVar("MLPREFIX", variant + "-")
|
|
|
|
e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
|
|
|
|
e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
|
2013-02-13 00:21:53 +00:00
|
|
|
|
2013-08-02 09:46:40 +00:00
|
|
|
# Expand the WHITELISTs with multilib prefix
|
2014-07-16 21:08:14 +00:00
|
|
|
for whitelist in ["HOSTTOOLS_WHITELIST_GPL-3.0", "WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
|
2013-08-02 09:46:40 +00:00
|
|
|
pkgs = e.data.getVar(whitelist, True)
|
|
|
|
for pkg in pkgs.split():
|
|
|
|
pkgs += " " + variant + "-" + pkg
|
|
|
|
e.data.setVar(whitelist, pkgs)
|
|
|
|
|
2013-02-13 00:21:53 +00:00
|
|
|
# DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
|
|
|
|
newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
|
|
|
|
if newtune:
|
|
|
|
e.data.setVar("DEFAULTTUNE", newtune)
|
2014-10-15 12:31:14 +00:00
|
|
|
e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune)
|
2011-07-27 15:21:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
addhandler multilib_virtclass_handler
|
2013-06-12 16:31:57 +00:00
|
|
|
multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
|
2011-07-27 15:21:48 +00:00
|
|
|
|
|
|
|
STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
|
|
|
|
|
|
|
|
python __anonymous () {
|
|
|
|
variant = d.getVar("BBEXTENDVARIANT", True)
|
|
|
|
|
2011-12-21 13:52:46 +00:00
|
|
|
import oe.classextend
|
|
|
|
|
|
|
|
clsextend = oe.classextend.ClassExtender(variant, d)
|
2011-07-27 15:21:48 +00:00
|
|
|
|
2011-09-22 21:15:58 +00:00
|
|
|
if bb.data.inherits_class('image', d):
|
2011-12-21 13:52:46 +00:00
|
|
|
clsextend.map_depends_variable("PACKAGE_INSTALL")
|
|
|
|
clsextend.map_depends_variable("LINGUAS_INSTALL")
|
|
|
|
clsextend.map_depends_variable("RDEPENDS")
|
2011-11-08 06:19:37 +00:00
|
|
|
pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
|
|
|
|
d.setVar("PACKAGE_INSTALL", pinstall)
|
2011-09-27 07:28:02 +00:00
|
|
|
d.setVar("LINGUAS_INSTALL", "")
|
2011-09-22 21:15:58 +00:00
|
|
|
# FIXME, we need to map this to something, not delete it!
|
|
|
|
d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
|
2012-07-09 15:11:38 +00:00
|
|
|
|
|
|
|
if bb.data.inherits_class('populate_sdk_base', d):
|
|
|
|
clsextend.map_depends_variable("TOOLCHAIN_TARGET_TASK")
|
|
|
|
clsextend.map_depends_variable("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY")
|
|
|
|
|
2012-11-21 10:13:19 +00:00
|
|
|
if bb.data.inherits_class('image', d):
|
2011-09-22 21:15:58 +00:00
|
|
|
return
|
|
|
|
|
2012-09-24 21:25:37 +00:00
|
|
|
clsextend.map_depends_variable("DEPENDS")
|
|
|
|
clsextend.map_variable("PROVIDES")
|
|
|
|
|
|
|
|
if bb.data.inherits_class('cross-canadian', d):
|
|
|
|
return
|
|
|
|
|
2011-12-21 13:52:46 +00:00
|
|
|
clsextend.rename_packages()
|
|
|
|
clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
|
2011-07-27 15:21:48 +00:00
|
|
|
|
2011-12-21 13:52:46 +00:00
|
|
|
clsextend.map_packagevars()
|
2012-10-22 12:20:04 +00:00
|
|
|
clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
|
2011-12-21 13:52:46 +00:00
|
|
|
clsextend.map_variable("PACKAGE_INSTALL")
|
|
|
|
clsextend.map_variable("INITSCRIPT_PACKAGES")
|
2013-04-18 13:26:37 +00:00
|
|
|
clsextend.map_variable("USERADD_PACKAGES")
|
2013-12-10 05:46:16 +00:00
|
|
|
clsextend.map_variable("SYSTEMD_PACKAGES")
|
2011-07-27 15:21:48 +00:00
|
|
|
}
|
2012-05-18 14:18:13 +00:00
|
|
|
|
2013-05-28 05:46:16 +00:00
|
|
|
PACKAGEFUNCS_append = " do_package_qa_multilib"
|
2012-05-18 14:18:13 +00:00
|
|
|
|
|
|
|
python do_package_qa_multilib() {
|
|
|
|
|
|
|
|
def check_mlprefix(pkg, var, mlprefix):
|
2012-10-02 10:37:07 +00:00
|
|
|
values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "")
|
2012-05-18 14:18:13 +00:00
|
|
|
candidates = []
|
2012-10-02 10:37:07 +00:00
|
|
|
for i in values:
|
2012-05-18 14:18:13 +00:00
|
|
|
if i.startswith('virtual/'):
|
|
|
|
i = i[len('virtual/'):]
|
2012-12-11 15:29:41 +00:00
|
|
|
if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)) and \
|
|
|
|
(not 'cross-canadian' in i) and (not i.startswith("nativesdk-")) and \
|
2014-01-28 07:31:15 +00:00
|
|
|
(not i.startswith("rtld")) and (not i.startswith('kernel-vmlinux')):
|
2012-05-18 14:18:13 +00:00
|
|
|
candidates.append(i)
|
|
|
|
if len(candidates) > 0:
|
2015-06-10 05:13:45 +00:00
|
|
|
msg = "%s package %s - suspicious values '%s' in %s" \
|
|
|
|
% (d.getVar('PN', True), pkg, ' '.join(candidates), var)
|
|
|
|
package_qa_handle_error("multilib", msg, d)
|
2012-05-18 14:18:13 +00:00
|
|
|
|
|
|
|
ml = d.getVar('MLPREFIX', True)
|
|
|
|
if not ml:
|
|
|
|
return
|
|
|
|
|
|
|
|
packages = d.getVar('PACKAGES', True)
|
|
|
|
for pkg in packages.split():
|
|
|
|
check_mlprefix(pkg, 'RDEPENDS', ml)
|
|
|
|
check_mlprefix(pkg, 'RPROVIDES', ml)
|
|
|
|
check_mlprefix(pkg, 'RRECOMMENDS', ml)
|
|
|
|
check_mlprefix(pkg, 'RSUGGESTS', ml)
|
|
|
|
check_mlprefix(pkg, 'RREPLACES', ml)
|
|
|
|
check_mlprefix(pkg, 'RCONFLICTS', ml)
|
|
|
|
}
|