diff options
| -rw-r--r-- | meta/classes/libc-package.bbclass | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 2dc90c44d7..071978b519 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | 9 | ||
| 10 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" | 10 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice" |
| 11 | 11 | ||
| 12 | GLIBC_SPLIT_LC_PACKAGES ?= "0" | ||
| 13 | |||
| 12 | python __anonymous () { | 14 | python __anonymous () { |
| 13 | enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True) | 15 | enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True) |
| 14 | 16 | ||
| @@ -219,13 +221,12 @@ python package_do_split_gconvs () { | |||
| 219 | (locale, encoding, locale)) | 221 | (locale, encoding, locale)) |
| 220 | 222 | ||
| 221 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): | 223 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): |
| 222 | m = re.match("(.*)\.(.*)", name) | 224 | dep = legitimize_package_name('%s-binary-localedata-%s' % (bpn, name)) |
| 223 | if m: | 225 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True) |
| 224 | libc_name = "%s.%s" % (m.group(1), m.group(2).lower()) | 226 | if lcsplit and int(lcsplit): |
| 225 | else: | 227 | d.appendVar('PACKAGES', ' ' + dep) |
| 226 | libc_name = name | 228 | d.setVar('ALLOW_EMPTY_%s' % dep, '1') |
| 227 | d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \ | 229 | d.setVar('RDEPENDS_%s' % pkgname, mlprefix + dep) |
| 228 | % (mlprefix+bpn, libc_name))) | ||
| 229 | 230 | ||
| 230 | commands = {} | 231 | commands = {} |
| 231 | 232 | ||
| @@ -337,6 +338,11 @@ python package_do_split_gconvs () { | |||
| 337 | else: | 338 | else: |
| 338 | output_locale('%s.%s' % (base, charset), base, charset) | 339 | output_locale('%s.%s' % (base, charset), base, charset) |
| 339 | 340 | ||
| 341 | def metapkg_hook(file, pkg, pattern, format, basename): | ||
| 342 | name = basename.split('/', 1)[0] | ||
| 343 | metapkg = legitimize_package_name('%s-binary-localedata-%s' % (mlprefix+bpn, name)) | ||
| 344 | d.appendVar('RDEPENDS_%s' % metapkg, ' ' + pkg) | ||
| 345 | |||
| 340 | if use_bin == "compile": | 346 | if use_bin == "compile": |
| 341 | makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile") | 347 | makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile") |
| 342 | m = open(makefile, "w") | 348 | m = open(makefile, "w") |
| @@ -350,13 +356,18 @@ python package_do_split_gconvs () { | |||
| 350 | bb.build.exec_func("oe_runmake", d) | 356 | bb.build.exec_func("oe_runmake", d) |
| 351 | bb.note("collecting binary locales from locale tree") | 357 | bb.note("collecting binary locales from locale tree") |
| 352 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) | 358 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) |
| 353 | do_split_packages(d, binary_locales_dir, file_regex='(.*)', \ | 359 | |
| 354 | output_pattern=bpn+'-binary-localedata-%s', \ | 360 | if use_bin in ('compile', 'precompiled'): |
| 355 | description='binary locale definition for %s', extra_depends='', allow_dirs=True) | 361 | lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES', True) |
| 356 | elif use_bin == "precompiled": | 362 | if lcsplit and int(lcsplit): |
| 357 | do_split_packages(d, binary_locales_dir, file_regex='(.*)', \ | 363 | do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \ |
| 358 | output_pattern=bpn+'-binary-localedata-%s', \ | 364 | output_pattern=bpn+'-binary-localedata-%s', \ |
| 359 | description='binary locale definition for %s', extra_depends='', allow_dirs=True) | 365 | description='binary locale definition for %s', recursive=True, |
| 366 | hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True) | ||
| 367 | else: | ||
| 368 | do_split_packages(d, binary_locales_dir, file_regex='(.*)', \ | ||
| 369 | output_pattern=bpn+'-binary-localedata-%s', \ | ||
| 370 | description='binary locale definition for %s', extra_depends='', allow_dirs=True) | ||
| 360 | else: | 371 | else: |
| 361 | bb.note("generation of binary locales disabled. this may break i18n!") | 372 | bb.note("generation of binary locales disabled. this may break i18n!") |
| 362 | 373 | ||
