diff options
Diffstat (limited to 'meta/classes/glibc-package.bbclass')
-rw-r--r-- | meta/classes/glibc-package.bbclass | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/meta/classes/glibc-package.bbclass b/meta/classes/glibc-package.bbclass index b16daa47f7..e64b5b8956 100644 --- a/meta/classes/glibc-package.bbclass +++ b/meta/classes/glibc-package.bbclass | |||
@@ -19,7 +19,9 @@ FILES_ldd = "${bindir}/ldd" | |||
19 | FILES_libsegfault = "${base_libdir}/libSegFault*" | 19 | FILES_libsegfault = "${base_libdir}/libSegFault*" |
20 | FILES_glibc-extra-nss = "${base_libdir}/libnss*" | 20 | FILES_glibc-extra-nss = "${base_libdir}/libnss*" |
21 | FILES_sln = "${base_sbindir}/sln" | 21 | FILES_sln = "${base_sbindir}/sln" |
22 | FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen" | 22 | FILES_glibc-dev = "${bindir}/rpcgen ${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \ |
23 | ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig \ | ||
24 | ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal" | ||
23 | FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/nscd* ${sysconfdir}/init.d/nscd*" | 25 | FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/nscd* ${sysconfdir}/init.d/nscd*" |
24 | FILES_glibc-utils = "${bindir}/* ${sbindir}/*" | 26 | FILES_glibc-utils = "${bindir}/* ${sbindir}/*" |
25 | FILES_glibc-gconv = "${libdir}/gconv/*" | 27 | FILES_glibc-gconv = "${libdir}/gconv/*" |
@@ -141,12 +143,24 @@ python package_do_split_gconvs () { | |||
141 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') | 143 | do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='') |
142 | bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d) | 144 | bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d) |
143 | 145 | ||
144 | f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") | 146 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) |
145 | supported = f.readlines() | ||
146 | f.close() | ||
147 | 147 | ||
148 | dot_re = re.compile("(.*)\.(.*)") | 148 | dot_re = re.compile("(.*)\.(.*)") |
149 | 149 | ||
150 | if use_bin != "precompiled": | ||
151 | f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") | ||
152 | supported = f.readlines() | ||
153 | f.close() | ||
154 | else: | ||
155 | supported = [] | ||
156 | full_bin_path = bb.data.getVar('PKGD', d, True) + binary_locales_dir | ||
157 | for dir in os.listdir(full_bin_path): | ||
158 | dbase = dir.split(".") | ||
159 | d2 = " " | ||
160 | if len(dbase) > 1: | ||
161 | d2 = "." + dbase[1].upper() + " " | ||
162 | supported.append(dbase[0] + d2) | ||
163 | |||
150 | # Collate the locales by base and encoding | 164 | # Collate the locales by base and encoding |
151 | utf8_only = int(bb.data.getVar('LOCALE_UTF8_ONLY', d, 1) or 0) | 165 | utf8_only = int(bb.data.getVar('LOCALE_UTF8_ONLY', d, 1) or 0) |
152 | encodings = {} | 166 | encodings = {} |
@@ -162,42 +176,25 @@ python package_do_split_gconvs () { | |||
162 | encodings[locale] = [] | 176 | encodings[locale] = [] |
163 | encodings[locale].append(charset) | 177 | encodings[locale].append(charset) |
164 | 178 | ||
165 | def output_locale_source(name, locale, encoding): | 179 | def output_locale_source(name, pkgname, locale, encoding): |
166 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
167 | |||
168 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) | 180 | bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) |
169 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
170 | m = re.match("(.*)_(.*)", name) | ||
171 | if m: | ||
172 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
173 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
174 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
175 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
176 | bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d) | 181 | bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d) |
177 | bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d) | 182 | bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d) |
178 | 183 | ||
179 | def output_locale_binary(name, locale, encoding): | 184 | def output_locale_binary_rdepends(name, pkgname, locale, encoding): |
180 | target_arch = bb.data.getVar("TARGET_ARCH", d, 1) | ||
181 | qemu = "qemu-%s" % target_arch | ||
182 | pkgname = 'locale-base-' + legitimize_package_name(name) | ||
183 | m = re.match("(.*)\.(.*)", name) | 185 | m = re.match("(.*)\.(.*)", name) |
184 | if m: | 186 | if m: |
185 | glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) | 187 | glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-","")) |
186 | else: | 188 | else: |
187 | glibc_name = name | 189 | glibc_name = name |
188 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d) | 190 | bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d) |
189 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
190 | m = re.match("(.*)_(.*)", name) | ||
191 | if m: | ||
192 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
193 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
194 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
195 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
196 | 191 | ||
192 | def output_locale_binary(name, pkgname, locale, encoding): | ||
197 | treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") | 193 | treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree") |
198 | path = bb.data.getVar("PATH", d, 1) | 194 | path = bb.data.getVar("PATH", d, 1) |
199 | i18npath = base_path_join(treedir, datadir, "i18n") | 195 | i18npath = base_path_join(treedir, datadir, "i18n") |
200 | 196 | target_arch = bb.data.getVar("TARGET_ARCH", d, 1) | |
197 | qemu = "qemu-%s" % target_arch | ||
201 | localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name) | 198 | localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name) |
202 | 199 | ||
203 | qemu_options = bb.data.getVar("QEMU_OPTIONS_%s" % bb.data.getVar('PACKAGE_ARCH', d, 1), d, 1) | 200 | qemu_options = bb.data.getVar("QEMU_OPTIONS_%s" % bb.data.getVar('PACKAGE_ARCH', d, 1), d, 1) |
@@ -210,13 +207,22 @@ python package_do_split_gconvs () { | |||
210 | raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd) | 207 | raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd) |
211 | 208 | ||
212 | def output_locale(name, locale, encoding): | 209 | def output_locale(name, locale, encoding): |
213 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | 210 | pkgname = 'locale-base-' + legitimize_package_name(name) |
211 | bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d) | ||
212 | bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d) | ||
213 | rprovides = 'virtual-locale-%s' % legitimize_package_name(name) | ||
214 | m = re.match("(.*)_(.*)", name) | ||
215 | if m: | ||
216 | rprovides += ' virtual-locale-%s' % m.group(1) | ||
217 | bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d) | ||
214 | if use_bin == "compile": | 218 | if use_bin == "compile": |
215 | output_locale_binary(name, locale, encoding) | 219 | output_locale_binary_rdepends(name, pkgname, locale, encoding) |
220 | output_locale_binary(name, pkgname, locale, encoding) | ||
221 | elif use_bin == "precompiled": | ||
222 | output_locale_binary_rdepends(name, pkgname, locale, encoding) | ||
216 | else: | 223 | else: |
217 | output_locale_source(name, locale, encoding) | 224 | output_locale_source(name, pkgname, locale, encoding) |
218 | 225 | ||
219 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | ||
220 | if use_bin == "compile": | 226 | if use_bin == "compile": |
221 | bb.note("preparing tree for binary locale generation") | 227 | bb.note("preparing tree for binary locale generation") |
222 | bb.build.exec_func("do_prep_locale_tree", d) | 228 | bb.build.exec_func("do_prep_locale_tree", d) |
@@ -237,15 +243,16 @@ python package_do_split_gconvs () { | |||
237 | for e in encodings[l]: | 243 | for e in encodings[l]: |
238 | output_locale('%s.%s' % (l, e), l, e) | 244 | output_locale('%s.%s' % (l, e), l, e) |
239 | 245 | ||
240 | if non_utf8 != []: | 246 | if non_utf8 != [] and use_bin != "precompiled": |
241 | bb.note("the following locales are supported only in legacy encodings:") | 247 | bb.note("the following locales are supported only in legacy encodings:") |
242 | bb.note(" " + " ".join(non_utf8)) | 248 | bb.note(" " + " ".join(non_utf8)) |
243 | 249 | ||
244 | use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) | ||
245 | if use_bin == "compile": | 250 | if use_bin == "compile": |
246 | bb.note("collecting binary locales from locale tree") | 251 | bb.note("collecting binary locales from locale tree") |
247 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) | 252 | bb.build.exec_func("do_collect_bins_from_locale_tree", d) |
248 | 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) | 253 | 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) |
254 | elif use_bin == "precompiled": | ||
255 | 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) | ||
249 | else: | 256 | else: |
250 | bb.note("generation of binary locales disabled. this may break i18n!") | 257 | bb.note("generation of binary locales disabled. this may break i18n!") |
251 | 258 | ||