From 09b8460da85218de1638cee345fb1c5c601163c8 Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Fri, 18 Aug 2006 00:25:53 +0200 Subject: glibc: fix locale naming so UTF8 locales are packaged correctly. Signed-off-by: Rene Wagner --- .../packages/glibc/glibc-package.bbclass | 32 +++++++++++++++------- .../packages/glibc/glibc_2.3.5+cvs20050627.bb | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/org.handhelds.familiar/packages/glibc/glibc-package.bbclass b/org.handhelds.familiar/packages/glibc/glibc-package.bbclass index 20222bf..bbd8882 100644 --- a/org.handhelds.familiar/packages/glibc/glibc-package.bbclass +++ b/org.handhelds.familiar/packages/glibc/glibc-package.bbclass @@ -196,12 +196,7 @@ python package_do_split_gconvs () { if deps != []: bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) - use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) - if use_bin: - do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='', aux_files_pattern_verbatim=binary_locales_dir + '/%s') - else: - do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') - bb.note("generation of binary locales disabled. this may break i18n!") + do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d) f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") @@ -240,8 +235,12 @@ python package_do_split_gconvs () { target_arch = bb.data.getVar("TARGET_ARCH", d, 1) qemu = "qemu-%s" % target_arch pkgname = 'locale-base-' + legitimize_package_name(name) - - bb.data.setVar('RDEPENDS_%s' % pkgname, 'glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) + m = re.match("(.*)\.(.*)", name) + if m: + glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) + else: + glibc_name = name + bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d) rprovides = 'virtual-locale-%s' % legitimize_package_name(name) m = re.match("(.*)_(.*)", name) if m: @@ -254,7 +253,7 @@ python package_do_split_gconvs () { path = bb.data.getVar("PATH", d, 1) i18npath = os.path.join(treedir, datadir, "i18n") - localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, locale) + localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name) cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts) bb.note("generating locale %s (%s)" % (locale, encoding)) if os.system(cmd): @@ -273,20 +272,33 @@ python package_do_split_gconvs () { bb.build.exec_func("do_prep_locale_tree", d) # Reshuffle names so that UTF-8 is preferred over other encodings + non_utf8 = [] for l in encodings.keys(): if len(encodings[l]) == 1: output_locale(l, l, encodings[l][0]) + if encodings[l][0] != "UTF-8": + non_utf8.append(l) else: if "UTF-8" in encodings[l]: output_locale(l, l, "UTF-8") encodings[l].remove("UTF-8") + else: + non_utf8.append(l) for e in encodings[l]: - output_locale('%s-%s' % (l, e), l, e) + output_locale('%s.%s' % (l, e), l, e) + + if non_utf8 != []: + bb.note("the following locales are supported only in legacy encodings:") + bb.note(" " + " ".join(non_utf8)) use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) if use_bin: bb.note("collecting binary locales from locale tree") bb.build.exec_func("do_collect_bins_from_locale_tree", d) + do_split_packages(d, binary_locales_dir, file_regex='(.*)', output_pattern='glibc-binary-localedata-%s', description='binary locale definition for %s', extra_depends='', allow_dirs=True) + else: + bb.note("generation of binary locales disabled. this may break i18n!") + } # We want to do this indirection so that we can safely 'return' diff --git a/org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb b/org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb index 0d1d073..b4fe7a9 100644 --- a/org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb +++ b/org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb @@ -7,7 +7,7 @@ MAINTAINER = "Phil Blundell " FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-cvs-2.3.5" CVSDATE = "20050627" -PR = "r4" +PR = "r5" GLIBC_ADDONS ?= "ports,linuxthreads" GLIBC_EXTRA_OECONF ?= "" -- cgit v1.2.3-18-g5258