summaryrefslogtreecommitdiffstats
path: root/meta/packages/glibc/glibc-package.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/glibc/glibc-package.bbclass')
-rw-r--r--meta/packages/glibc/glibc-package.bbclass53
1 files changed, 30 insertions, 23 deletions
diff --git a/meta/packages/glibc/glibc-package.bbclass b/meta/packages/glibc/glibc-package.bbclass
index 680831e822..3ce10b54de 100644
--- a/meta/packages/glibc/glibc-package.bbclass
+++ b/meta/packages/glibc/glibc-package.bbclass
@@ -25,20 +25,21 @@ ENABLE_BINARY_LOCALE_GENERATION ?= "0"
25# BINARY_LOCALE_ARCHES is a space separated list of regular expressions 25# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
26BINARY_LOCALE_ARCHES ?= "arm.*" 26BINARY_LOCALE_ARCHES ?= "arm.*"
27 27
28PACKAGES = "glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile" 28PACKAGES = "glibc-dbg glibc catchsegv sln nscd ldd localedef glibc-utils glibc-dev glibc-doc glibc-locale libsegfault glibc-extra-nss glibc-thread-db glibc-pcprofile"
29PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-*" 29PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-* libc6*"
30 30
31libc_baselibs = "/lib/libc* /lib/libm* /lib/ld* /lib/libpthread* /lib/libresolv* /lib/librt* /lib/libutil* /lib/libnsl* /lib/libnss_files* /lib/libnss_compat* /lib/libnss_dns* /lib/libdl* /lib/libanl* /lib/libBrokenLocale*" 31libc_baselibs = "/lib/libc* /lib/libm* /lib/ld* /lib/libpthread* /lib/libresolv* /lib/librt* /lib/libutil* /lib/libnsl* /lib/libnss_files* /lib/libnss_compat* /lib/libnss_dns* /lib/libdl* /lib/libanl* /lib/libBrokenLocale*"
32 32
33FILES_${PN} = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir} ${datadir}/zoneinfo" 33FILES_${PN} = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
34FILES_ldd = "${bindir}/ldd" 34FILES_ldd = "${bindir}/ldd"
35FILES_libsegfault = "/lib/libSegFault*" 35FILES_libsegfault = "/lib/libSegFault*"
36FILES_glibc-extra-nss = "/lib/libnss*" 36FILES_glibc-extra-nss = "/lib/libnss*"
37FILES_sln = "/sbin/sln" 37FILES_sln = "/sbin/sln"
38FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen" 38FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen"
39FILES_nscd = "${sbindir}/nscd*" 39FILES_nscd = "${sbindir}/nscd*"
40FILES_glibc-utils = "${bindir} ${sbindir}" 40FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
41FILES_glibc-gconv = "${libdir}/gconv" 41FILES_glibc-gconv = "${libdir}/gconv/*"
42FILES_${PN}-dbg += " ${libdir}/gconv/.debug"
42FILES_catchsegv = "${bindir}/catchsegv" 43FILES_catchsegv = "${bindir}/catchsegv"
43RDEPENDS_catchsegv = "libsegfault" 44RDEPENDS_catchsegv = "libsegfault"
44FILES_glibc-pcprofile = "/lib/libpcprofile.so" 45FILES_glibc-pcprofile = "/lib/libpcprofile.so"
@@ -77,17 +78,10 @@ do_install() {
77 grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp 78 grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp
78 mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED 79 mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED
79 done 80 done
80 # If indicated, only build a limited selection of locales
81 if [ "${LIMIT_BUILT_LOCALES}" != "${LIMIT_BUILT_LOCALES}" ]; then
82 for i in ${LIMIT_BUILT_LOCALES}; do
83 grep $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp
84 mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED
85 done
86 fi
87 rm -f ${D}/etc/rpc 81 rm -f ${D}/etc/rpc
88} 82}
89 83
90TMP_LOCALE="/tmp/locale/${libdir}/locale" 84TMP_LOCALE="/tmp/locale${libdir}/locale"
91 85
92locale_base_postinst() { 86locale_base_postinst() {
93#!/bin/sh 87#!/bin/sh
@@ -102,6 +96,7 @@ if [ -f ${libdir}/locale/locale-archive ]; then
102 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ 96 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
103fi 97fi
104localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s 98localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
99mkdir -p ${libdir}/locale/
105mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ 100mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
106rm -rf ${TMP_LOCALE} 101rm -rf ${TMP_LOCALE}
107} 102}
@@ -204,12 +199,7 @@ python package_do_split_gconvs () {
204 if deps != []: 199 if deps != []:
205 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d) 200 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d)
206 201
207 use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) 202 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
208 if use_bin:
209 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')
210 else:
211 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
212 bb.note("generation of binary locales disabled. this may break i18n!")
213 bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d) 203 bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
214 204
215 f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r") 205 f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
@@ -248,8 +238,12 @@ python package_do_split_gconvs () {
248 target_arch = bb.data.getVar("TARGET_ARCH", d, 1) 238 target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
249 qemu = "qemu-%s" % target_arch 239 qemu = "qemu-%s" % target_arch
250 pkgname = 'locale-base-' + legitimize_package_name(name) 240 pkgname = 'locale-base-' + legitimize_package_name(name)
251 241 m = re.match("(.*)\.(.*)", name)
252 bb.data.setVar('RDEPENDS_%s' % pkgname, 'glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d) 242 if m:
243 glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
244 else:
245 glibc_name = name
246 bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d)
253 rprovides = 'virtual-locale-%s' % legitimize_package_name(name) 247 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
254 m = re.match("(.*)_(.*)", name) 248 m = re.match("(.*)_(.*)", name)
255 if m: 249 if m:
@@ -262,7 +256,7 @@ python package_do_split_gconvs () {
262 path = bb.data.getVar("PATH", d, 1) 256 path = bb.data.getVar("PATH", d, 1)
263 i18npath = os.path.join(treedir, datadir, "i18n") 257 i18npath = os.path.join(treedir, datadir, "i18n")
264 258
265 localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, locale) 259 localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name)
266 cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts) 260 cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts)
267 bb.note("generating locale %s (%s)" % (locale, encoding)) 261 bb.note("generating locale %s (%s)" % (locale, encoding))
268 if os.system(cmd): 262 if os.system(cmd):
@@ -281,20 +275,33 @@ python package_do_split_gconvs () {
281 bb.build.exec_func("do_prep_locale_tree", d) 275 bb.build.exec_func("do_prep_locale_tree", d)
282 276
283 # Reshuffle names so that UTF-8 is preferred over other encodings 277 # Reshuffle names so that UTF-8 is preferred over other encodings
278 non_utf8 = []
284 for l in encodings.keys(): 279 for l in encodings.keys():
285 if len(encodings[l]) == 1: 280 if len(encodings[l]) == 1:
286 output_locale(l, l, encodings[l][0]) 281 output_locale(l, l, encodings[l][0])
282 if encodings[l][0] != "UTF-8":
283 non_utf8.append(l)
287 else: 284 else:
288 if "UTF-8" in encodings[l]: 285 if "UTF-8" in encodings[l]:
289 output_locale(l, l, "UTF-8") 286 output_locale(l, l, "UTF-8")
290 encodings[l].remove("UTF-8") 287 encodings[l].remove("UTF-8")
288 else:
289 non_utf8.append(l)
291 for e in encodings[l]: 290 for e in encodings[l]:
292 output_locale('%s-%s' % (l, e), l, e) 291 output_locale('%s.%s' % (l, e), l, e)
292
293 if non_utf8 != []:
294 bb.note("the following locales are supported only in legacy encodings:")
295 bb.note(" " + " ".join(non_utf8))
293 296
294 use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1) 297 use_bin = bb.data.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", d, 1)
295 if use_bin: 298 if use_bin:
296 bb.note("collecting binary locales from locale tree") 299 bb.note("collecting binary locales from locale tree")
297 bb.build.exec_func("do_collect_bins_from_locale_tree", d) 300 bb.build.exec_func("do_collect_bins_from_locale_tree", d)
301 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)
302 else:
303 bb.note("generation of binary locales disabled. this may break i18n!")
304
298} 305}
299 306
300# We want to do this indirection so that we can safely 'return' 307# We want to do this indirection so that we can safely 'return'