mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

In multilib_script.bbclass it renames script file which listed in MULTILIB_SCRIPTS. It may mix up packages split. Take package curl as example, ${bindir}/curl-config is packaged to curl-dev originally. But it is renamed to curl-config-${MULTILIB_SUFFIX} and packaged to curl when multilib is enabled. And expand 'pkg' to fix QA warning: | WARNING: Variable key FILES_${PN}-dev ( | ${bindir}/curl-config-${MULTILIB_SUFFIX}) replaces original key | FILES_curl-dev (${includedir} ${FILES_SOLIBSDEV} ... ${bindir}/*-config) Insert a necessary space to the argument 'value' of d.appendVar() as well. (From OE-Core rev: 841bcbe429dcab54de3b89a927394750f9ccae60) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
#
|
|
# Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
|
|
# MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
|
|
# to indicate which script files to process from which packages.
|
|
#
|
|
|
|
inherit update-alternatives
|
|
|
|
MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
|
|
|
|
PACKAGE_PREPROCESS_FUNCS += "multilibscript_rename"
|
|
|
|
multilibscript_rename() {
|
|
:
|
|
}
|
|
|
|
python () {
|
|
# Do nothing if multilib isn't being used
|
|
if not d.getVar("MULTILIB_VARIANTS"):
|
|
return
|
|
# Do nothing for native/cross
|
|
if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d):
|
|
return
|
|
|
|
for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split():
|
|
pkg, script = entry.split(":")
|
|
epkg = d.expand(pkg)
|
|
scriptname = os.path.basename(script)
|
|
d.appendVar("ALTERNATIVE_" + epkg, " " + scriptname + " ")
|
|
d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script)
|
|
d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}")
|
|
d.appendVar("multilibscript_rename", "\n mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}")
|
|
d.appendVar("FILES_" + epkg, " " + script + "-${MULTILIB_SUFFIX}")
|
|
}
|