mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
libc-package.bbclass: split binary localedata even more if asked to
If GLIBC_SPLIT_LC_PACKAGES is set to a non-zero value, convert glibc-binary-localedata-XX-YY to be a meta package depending on glibc-binary-localedata-XX-YY-lc-address and so on. This enables saving quite some space if someone doesn't need LC_COLLATE for example. Some regex code was removed from output_locale_binary_rdepends, because legitimize_package_name already converts to lowercase. (From OE-Core rev: 40b4b31092058f8833ada3dfc254d362dd3139c1) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
f7b318ba36
commit
0dffc09058
@@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
|
GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
|
||||||
|
|
||||||
|
GLIBC_SPLIT_LC_PACKAGES ?= "0"
|
||||||
|
|
||||||
python __anonymous () {
|
python __anonymous () {
|
||||||
enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
|
enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
|
||||||
|
|
||||||
@@ -219,13 +221,12 @@ python package_do_split_gconvs () {
|
|||||||
(locale, encoding, locale))
|
(locale, encoding, locale))
|
||||||
|
|
||||||
def output_locale_binary_rdepends(name, pkgname, locale, encoding):
|
def output_locale_binary_rdepends(name, pkgname, locale, encoding):
|
||||||
m = re.match("(.*)\.(.*)", name)
|
dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name))
|
||||||
if m:
|
lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
|
||||||
libc_name = "%s.%s" % (m.group(1), m.group(2).lower())
|
if lcsplit and int(lcsplit):
|
||||||
else:
|
d.appendVar('PACKAGES', ' ' + dep)
|
||||||
libc_name = name
|
d.setVar('ALLOW_EMPTY_%s' % dep, '1')
|
||||||
d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
|
d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep)
|
||||||
% (mlprefix+bpn, libc_name)))
|
|
||||||
|
|
||||||
commands = {}
|
commands = {}
|
||||||
|
|
||||||
@@ -337,6 +338,11 @@ python package_do_split_gconvs () {
|
|||||||
else:
|
else:
|
||||||
output_locale('%s.%s' % (base, charset), base, charset)
|
output_locale('%s.%s' % (base, charset), base, charset)
|
||||||
|
|
||||||
|
def metapkg_hook(file, pkg, pattern, format, basename):
|
||||||
|
name = basename.split('/', 1)[0]
|
||||||
|
metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name))
|
||||||
|
d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg)
|
||||||
|
|
||||||
if use_bin == "compile":
|
if use_bin == "compile":
|
||||||
makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
|
makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
|
||||||
m = open(makefile, "w")
|
m = open(makefile, "w")
|
||||||
@@ -350,13 +356,18 @@ python package_do_split_gconvs () {
|
|||||||
bb.build.exec_func("oe_runmake", d)
|
bb.build.exec_func("oe_runmake", d)
|
||||||
bb.note("collecting binary locales from locale tree")
|
bb.note("collecting binary locales from locale tree")
|
||||||
bb.build.exec_func("do_collect_bins_from_locale_tree", d)
|
bb.build.exec_func("do_collect_bins_from_locale_tree", d)
|
||||||
do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
|
|
||||||
output_pattern=bpn+'-binary-localedata-%s', \
|
if use_bin in ('compile', 'precompiled'):
|
||||||
description='binary locale definition for %s', extra_depends='', allow_dirs=True)
|
lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True)
|
||||||
elif use_bin == "precompiled":
|
if lcsplit and int(lcsplit):
|
||||||
do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
|
do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
|
||||||
output_pattern=bpn+'-binary-localedata-%s', \
|
output_pattern=bpn+'-binary-localedata-%s', \
|
||||||
description='binary locale definition for %s', extra_depends='', allow_dirs=True)
|
description='binary locale definition for %s', recursive=True,
|
||||||
|
hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
|
||||||
|
else:
|
||||||
|
do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
|
||||||
|
output_pattern=bpn+'-binary-localedata-%s', \
|
||||||
|
description='binary locale definition for %s', extra_depends='', allow_dirs=True)
|
||||||
else:
|
else:
|
||||||
bb.note("generation of binary locales disabled. this may break i18n!")
|
bb.note("generation of binary locales disabled. this may break i18n!")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user