diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2015-12-10 18:41:13 +0800 |
---|---|---|
committer | Dan McGregor <dan.mcgregor@usask.ca> | 2016-04-11 12:50:59 -0600 |
commit | 767b8599cc63f0d7d3157c0def103d06f76237d4 (patch) | |
tree | c8804d37c53087336b4877b0dda6fd9e601da97e | |
parent | 8f3d4a0a599933856c89af17e6293c93ea8629f8 (diff) | |
download | openembedded-core-contrib-767b8599cc63f0d7d3157c0def103d06f76237d4.tar.gz |
multilib.bbclass: install multilib and non-multilib locales in images
Previously if multilib enabled and IMAGE_LINGUAS is assigned,
according to the type of image (multilib or non-multilib),
only the mapped language pkgs (multilib or non-multilib)
is installed to the image. It caused the other part could
not work.
Such as qemux86-64, the multilib prefix is lib32, and assign
IMAGE_LINGUAS_append = " en-us". For core-image-minimal image,
only locale-base-en-us is installed; and for lib32-core-image-
minimal image, only lib32-locale-base-en-us is installed.
For the core-image-minimal image, it did not support the
multilib version app to invoke setlocale(LC_CTYPE, "en_US.UTF-8")
in C.
Install multilib and non-multilib language pkgs for image
recipes could fix it.
The fix in image.bbclass is for non-multilib image recipes
(such as core-image-minimal); the fix in multilib.bbclass
is for multilib image (such as lib32-core-image-minimal)
[YOCTO #8784]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta/classes/image.bbclass | 20 | ||||
-rw-r--r-- | meta/classes/multilib.bbclass | 9 |
2 files changed, 28 insertions, 1 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index ea77ab8878..c38d97075e 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -183,7 +183,25 @@ IMAGE_POSTPROCESS_COMMAND ?= "" # some default locales IMAGE_LINGUAS ?= "de-de fr-fr en-gb" -LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS', True).split()))}" +# Need all non-multilib and multilib of LINGUAS_INSTALL +LINGUAS_INSTALL ?= "${@locale_base_packages(d)}" +def locale_base_packages(d): + pkgs = [] + imagelinguas = (d.getVar('IMAGE_LINGUAS', True) or "").split() + mlvars = (d.getVar("MULTILIB_VARIANTS", True) or "").split() + for lang in imagelinguas: + # Add non-multilib packages + pkg = "locale-base-%s" % lang + if pkg not in pkgs: + pkgs.append(pkg) + + for prefix in mlvars: + # Add multilib packages + mlpkg = "%s-%s" % (prefix, pkg) + if mlpkg not in pkgs: + pkgs.append(mlpkg) + + return ' '.join(pkgs) # Prefer image, but use the fallback files for lookups if the image ones # aren't yet available. diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass index d5a31287a8..47f229af94 100644 --- a/meta/classes/multilib.bbclass +++ b/meta/classes/multilib.bbclass @@ -86,8 +86,17 @@ python __anonymous () { if bb.data.inherits_class('image', d): clsextend.map_depends_variable("PACKAGE_INSTALL") + + # Need all non-multilib and multilib of LINGUAS_INSTALL + linguasinstall = (d.getVar("LINGUAS_INSTALL", True) or "").split() clsextend.map_depends_variable("LINGUAS_INSTALL") + for lang in linguasinstall: + if lang not in (d.getVar("LINGUAS_INSTALL", True) or "").split(): + d.appendVar("LINGUAS_INSTALL", " " + lang) clsextend.map_depends_variable("RDEPENDS") + for lang in linguasinstall: + if lang not in (d.getVar("RDEPENDS", True) or "").split(): + d.appendVar("RDEPENDS", " " + lang) pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True) d.setVar("PACKAGE_INSTALL", pinstall) d.setVar("LINGUAS_INSTALL", "") |