]> pilppa.com Git - familiar-h63xx-build.git/commitdiff
glibc: fix locale naming so UTF8 locales are packaged correctly.
authorPhil Blundell <pb@handhelds.org>
Thu, 17 Aug 2006 22:25:53 +0000 (00:25 +0200)
committerRene Wagner <rw@handhelds.org>
Thu, 17 Aug 2006 22:25:53 +0000 (00:25 +0200)
Signed-off-by: Rene Wagner <rw@handhelds.org>
org.handhelds.familiar/packages/glibc/glibc-package.bbclass
org.handhelds.familiar/packages/glibc/glibc_2.3.5+cvs20050627.bb

index 20222bf2ff49dba24ca703e3b7af4a3fd362bf14..bbd8882876187dbbb2791ee9c2475bddba295b45 100644 (file)
@@ -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'
index 0d1d073f4789e623e4ffc50494d6134e5cc2aba0..b4fe7a98b74930332916c150694f77331b0e4c8d 100644 (file)
@@ -7,7 +7,7 @@ MAINTAINER = "Phil Blundell <pb@handhelds.org>"
 
 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 ?= ""