summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-20 17:32:23 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-20 17:32:23 +0000
commit5892090c1c5846c8fc384c2070ee24edde5a4340 (patch)
treee8cef8d1f732bcb377edd853685905b2a36a0a87 /meta
parent246dbec86852444e930b2fd84827ddf6f0edc592 (diff)
downloadpoky-5892090c1c5846c8fc384c2070ee24edde5a4340.tar.gz
external-toolchain-csl: Convert to use glibc-package
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/meta/external-csl-toolchain_2006q3-27.bb207
-rw-r--r--meta/packages/meta/external-csl-toolchain_2007q3-51.bb208
-rw-r--r--meta/packages/meta/external-csl-toolchain_2008q3-72.bb208
3 files changed, 15 insertions, 608 deletions
diff --git a/meta/packages/meta/external-csl-toolchain_2006q3-27.bb b/meta/packages/meta/external-csl-toolchain_2006q3-27.bb
index 973dad78b2..02deefacdb 100644
--- a/meta/packages/meta/external-csl-toolchain_2006q3-27.bb
+++ b/meta/packages/meta/external-csl-toolchain_2006q3-27.bb
@@ -31,7 +31,11 @@ do_install() {
31 cp -a ${S}/arm-none-linux-gnueabi/libc/usr/* ${D}/usr 31 cp -a ${S}/arm-none-linux-gnueabi/libc/usr/* ${D}/usr
32} 32}
33 33
34PACKAGES = "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" 34GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile"
35
36inherit glibc-package
37
38PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers"
35FILES_libgcc = "${base_libdir}/libgcc_s.so.1" 39FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
36FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" 40FILES_libgcc-dev = "${base_libdir}/libgcc_s.so"
37FILES_libstdc++ = "${libdir}/libstdc++.so.*" 41FILES_libstdc++ = "${libdir}/libstdc++.so.*"
@@ -50,205 +54,4 @@ FILES_linux-libc-headers = "${includedir}/asm* \
50 ${includedir}/video \ 54 ${includedir}/video \
51" 55"
52 56
53PACKAGES += "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"
54
55libc_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*"
56
57FILES_glibc = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
58FILES_glibc-dev = "${includedir}"
59FILES_ldd = "${bindir}/ldd"
60FILES_libsegfault = "/lib/libSegFault*"
61FILES_glibc-extra-nss = "/lib/libnss*"
62FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen ${libdir}/*.so"
63FILES_nscd = "${sbindir}/nscd*"
64FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
65FILES_glibc-gconv = "${libdir}/gconv/*"
66FILES_glibc-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug ${base_libdir}/.debug ${libdir}/.debug"
67FILES_catchsegv = "${bindir}/catchsegv"
68RDEPENDS_catchsegv = "libsegfault"
69FILES_glibc-pcprofile = "/lib/libpcprofile.so"
70FILES_glibc-thread-db = "/lib/libthread_db*"
71RPROVIDES_glibc-dev += "libc-dev"
72LEAD_SONAME = "libc.so.6"
73
74DESCRIPTION_sln = "glibc: create symbolic links between files"
75DESCRIPTION_nscd = "glibc: name service cache daemon for passwd, group, and hosts"
76DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services"
77DESCRIPTION_ldd = "glibc: print shared library dependencies"
78DESCRIPTION_localedef = "glibc: compile locale definition files"
79DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
80
81FILES_sln = "${base_sbindir}/sln"
82FILES_localedef = "${bindir}/localedef"
83
84
85TMP_LOCALE="/tmp/locale${libdir}/locale"
86
87locale_base_postinst() {
88#!/bin/sh
89
90if [ "x$D" != "x" ]; then
91 exit 1
92fi
93
94rm -rf ${TMP_LOCALE}
95mkdir -p ${TMP_LOCALE}
96if [ -f ${libdir}/locale/locale-archive ]; then
97 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
98fi
99localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
100mkdir -p ${libdir}/locale/
101mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
102rm -rf ${TMP_LOCALE}
103}
104
105locale_base_postrm() {
106#!/bin/sh
107
108rm -rf ${TMP_LOCALE}
109mkdir -p ${TMP_LOCALE}
110if [ -f ${libdir}/locale/locale-archive ]; then
111 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
112fi
113localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
114mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
115rm -rf ${TMP_LOCALE}
116}
117
118python package_do_split_gconvs () {
119 import os, re
120 if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
121 bb.note("package requested not splitting gconvs")
122 return
123
124 if not bb.data.getVar('PACKAGES', d, 1):
125 return
126
127 libdir = bb.data.getVar('libdir', d, 1)
128 if not libdir:
129 bb.error("libdir not defined")
130 return
131 datadir = bb.data.getVar('datadir', d, 1)
132 if not datadir:
133 bb.error("datadir not defined")
134 return
135 57
136 gconv_libdir = os.path.join(libdir, "gconv")
137 charmap_dir = os.path.join(datadir, "i18n", "charmaps")
138 locales_dir = os.path.join(datadir, "i18n", "locales")
139 binary_locales_dir = os.path.join(libdir, "locale")
140
141 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s', extra_depends='glibc-gconv')
142
143 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='glibc-charmap-%s', description='character map for %s encoding', extra_depends='')
144
145 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
146 deps = []
147 f = open(fn, "r")
148 c_re = re.compile('^copy "(.*)"')
149 i_re = re.compile('^include "(\w+)".*')
150 for l in f.readlines():
151 m = c_re.match(l) or i_re.match(l)
152 if m:
153 dp = legitimize_package_name('glibc-localedata-%s' % m.group(1))
154 if not dp in deps:
155 deps.append(dp)
156 f.close()
157 if deps != []:
158 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d)
159
160 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
161 bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
162
163 f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
164 supported = f.readlines()
165 f.close()
166
167 dot_re = re.compile("(.*)\.(.*)")
168
169 # Collate the locales by base and encoding
170 encodings = {}
171 for l in supported:
172 l = l[:-1]
173 (locale, charset) = l.split(" ")
174 m = dot_re.match(locale)
175 if m:
176 locale = m.group(1)
177 if not encodings.has_key(locale):
178 encodings[locale] = []
179 encodings[locale].append(charset)
180
181 def output_locale_source(name, locale, encoding):
182 pkgname = 'locale-base-' + legitimize_package_name(name)
183
184 bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d)
185 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
186 m = re.match("(.*)_(.*)", name)
187 if m:
188 rprovides += ' virtual-locale-%s' % m.group(1)
189 bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
190 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
191 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
192 bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d)
193 bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d)
194
195 def output_locale_binary(name, locale, encoding):
196 target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
197 qemu = "qemu-%s" % target_arch
198 pkgname = 'locale-base-' + legitimize_package_name(name)
199 m = re.match("(.*)\.(.*)", name)
200 if m:
201 glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
202 else:
203 glibc_name = name
204 bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d)
205 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
206 m = re.match("(.*)_(.*)", name)
207 if m:
208 rprovides += ' virtual-locale-%s' % m.group(1)
209 bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
210 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
211 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
212
213 treedir = os.path.join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
214 path = bb.data.getVar("PATH", d, 1)
215 i18npath = os.path.join(treedir, datadir, "i18n")
216
217 localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name)
218 cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts)
219 bb.note("generating locale %s (%s)" % (locale, encoding))
220 if os.system(cmd):
221 raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd)
222
223 def output_locale(name, locale, encoding):
224 output_locale_source(name, locale, encoding)
225
226 # Reshuffle names so that UTF-8 is preferred over other encodings
227 non_utf8 = []
228 for l in encodings.keys():
229 if len(encodings[l]) == 1:
230 output_locale(l, l, encodings[l][0])
231 if encodings[l][0] != "UTF-8":
232 non_utf8.append(l)
233 else:
234 if "UTF-8" in encodings[l]:
235 output_locale(l, l, "UTF-8")
236 encodings[l].remove("UTF-8")
237 else:
238 non_utf8.append(l)
239 for e in encodings[l]:
240 output_locale('%s.%s' % (l, e), l, e)
241
242 if non_utf8 != []:
243 bb.note("the following locales are supported only in legacy encodings:")
244 bb.note(" " + " ".join(non_utf8))
245}
246
247# We want to do this indirection so that we can safely 'return'
248# from the called function even though we're prepending
249python populate_packages_prepend () {
250 if bb.data.getVar('DEBIAN_NAMES', d, 1):
251 bb.data.setVar('PKG_glibc', 'libc6', d)
252 bb.data.setVar('PKG_glibc-dev', 'libc6-dev', d)
253 bb.build.exec_func('package_do_split_gconvs', d)
254}
diff --git a/meta/packages/meta/external-csl-toolchain_2007q3-51.bb b/meta/packages/meta/external-csl-toolchain_2007q3-51.bb
index 8ef8911143..d1ab1ab0bf 100644
--- a/meta/packages/meta/external-csl-toolchain_2007q3-51.bb
+++ b/meta/packages/meta/external-csl-toolchain_2007q3-51.bb
@@ -31,7 +31,11 @@ do_install() {
31 cp -a ${S}/arm-none-linux-gnueabi/libc/usr/* ${D}/usr 31 cp -a ${S}/arm-none-linux-gnueabi/libc/usr/* ${D}/usr
32} 32}
33 33
34PACKAGES = "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" 34GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile"
35
36inherit glibc-package
37
38PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers"
35FILES_libgcc = "${base_libdir}/libgcc_s.so.1" 39FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
36FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" 40FILES_libgcc-dev = "${base_libdir}/libgcc_s.so"
37FILES_libstdc++ = "${libdir}/libstdc++.so.*" 41FILES_libstdc++ = "${libdir}/libstdc++.so.*"
@@ -50,205 +54,3 @@ FILES_linux-libc-headers = "${includedir}/asm* \
50 ${includedir}/video \ 54 ${includedir}/video \
51" 55"
52 56
53PACKAGES += "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"
54
55libc_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*"
56
57FILES_glibc = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
58FILES_glibc-dev = "${includedir}"
59FILES_ldd = "${bindir}/ldd"
60FILES_libsegfault = "/lib/libSegFault*"
61FILES_glibc-extra-nss = "/lib/libnss*"
62FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen ${libdir}/*.so"
63FILES_nscd = "${sbindir}/nscd*"
64FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
65FILES_glibc-gconv = "${libdir}/gconv/*"
66FILES_glibc-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug ${base_libdir}/.debug ${libdir}/.debug"
67FILES_catchsegv = "${bindir}/catchsegv"
68RDEPENDS_catchsegv = "libsegfault"
69FILES_glibc-pcprofile = "/lib/libpcprofile.so"
70FILES_glibc-thread-db = "/lib/libthread_db*"
71RPROVIDES_glibc-dev += "libc-dev"
72LEAD_SONAME = "libc.so.6"
73
74DESCRIPTION_sln = "glibc: create symbolic links between files"
75DESCRIPTION_nscd = "glibc: name service cache daemon for passwd, group, and hosts"
76DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services"
77DESCRIPTION_ldd = "glibc: print shared library dependencies"
78DESCRIPTION_localedef = "glibc: compile locale definition files"
79DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
80
81FILES_sln = "${base_sbindir}/sln"
82FILES_localedef = "${bindir}/localedef"
83
84
85TMP_LOCALE="/tmp/locale${libdir}/locale"
86
87locale_base_postinst() {
88#!/bin/sh
89
90if [ "x$D" != "x" ]; then
91 exit 1
92fi
93
94rm -rf ${TMP_LOCALE}
95mkdir -p ${TMP_LOCALE}
96if [ -f ${libdir}/locale/locale-archive ]; then
97 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
98fi
99localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
100mkdir -p ${libdir}/locale/
101mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
102rm -rf ${TMP_LOCALE}
103}
104
105locale_base_postrm() {
106#!/bin/sh
107
108rm -rf ${TMP_LOCALE}
109mkdir -p ${TMP_LOCALE}
110if [ -f ${libdir}/locale/locale-archive ]; then
111 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
112fi
113localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
114mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
115rm -rf ${TMP_LOCALE}
116}
117
118python package_do_split_gconvs () {
119 import os, re
120 if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
121 bb.note("package requested not splitting gconvs")
122 return
123
124 if not bb.data.getVar('PACKAGES', d, 1):
125 return
126
127 libdir = bb.data.getVar('libdir', d, 1)
128 if not libdir:
129 bb.error("libdir not defined")
130 return
131 datadir = bb.data.getVar('datadir', d, 1)
132 if not datadir:
133 bb.error("datadir not defined")
134 return
135
136 gconv_libdir = os.path.join(libdir, "gconv")
137 charmap_dir = os.path.join(datadir, "i18n", "charmaps")
138 locales_dir = os.path.join(datadir, "i18n", "locales")
139 binary_locales_dir = os.path.join(libdir, "locale")
140
141 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s', extra_depends='glibc-gconv')
142
143 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='glibc-charmap-%s', description='character map for %s encoding', extra_depends='')
144
145 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
146 deps = []
147 f = open(fn, "r")
148 c_re = re.compile('^copy "(.*)"')
149 i_re = re.compile('^include "(\w+)".*')
150 for l in f.readlines():
151 m = c_re.match(l) or i_re.match(l)
152 if m:
153 dp = legitimize_package_name('glibc-localedata-%s' % m.group(1))
154 if not dp in deps:
155 deps.append(dp)
156 f.close()
157 if deps != []:
158 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d)
159
160 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
161 bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
162
163 f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
164 supported = f.readlines()
165 f.close()
166
167 dot_re = re.compile("(.*)\.(.*)")
168
169 # Collate the locales by base and encoding
170 encodings = {}
171 for l in supported:
172 l = l[:-1]
173 (locale, charset) = l.split(" ")
174 m = dot_re.match(locale)
175 if m:
176 locale = m.group(1)
177 if not encodings.has_key(locale):
178 encodings[locale] = []
179 encodings[locale].append(charset)
180
181 def output_locale_source(name, locale, encoding):
182 pkgname = 'locale-base-' + legitimize_package_name(name)
183
184 bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d)
185 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
186 m = re.match("(.*)_(.*)", name)
187 if m:
188 rprovides += ' virtual-locale-%s' % m.group(1)
189 bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
190 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
191 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
192 bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d)
193 bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d)
194
195 def output_locale_binary(name, locale, encoding):
196 target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
197 qemu = "qemu-%s" % target_arch
198 pkgname = 'locale-base-' + legitimize_package_name(name)
199 m = re.match("(.*)\.(.*)", name)
200 if m:
201 glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
202 else:
203 glibc_name = name
204 bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d)
205 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
206 m = re.match("(.*)_(.*)", name)
207 if m:
208 rprovides += ' virtual-locale-%s' % m.group(1)
209 bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
210 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
211 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
212
213 treedir = os.path.join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
214 path = bb.data.getVar("PATH", d, 1)
215 i18npath = os.path.join(treedir, datadir, "i18n")
216
217 localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name)
218 cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts)
219 bb.note("generating locale %s (%s)" % (locale, encoding))
220 if os.system(cmd):
221 raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd)
222
223 def output_locale(name, locale, encoding):
224 output_locale_source(name, locale, encoding)
225
226 # Reshuffle names so that UTF-8 is preferred over other encodings
227 non_utf8 = []
228 for l in encodings.keys():
229 if len(encodings[l]) == 1:
230 output_locale(l, l, encodings[l][0])
231 if encodings[l][0] != "UTF-8":
232 non_utf8.append(l)
233 else:
234 if "UTF-8" in encodings[l]:
235 output_locale(l, l, "UTF-8")
236 encodings[l].remove("UTF-8")
237 else:
238 non_utf8.append(l)
239 for e in encodings[l]:
240 output_locale('%s.%s' % (l, e), l, e)
241
242 if non_utf8 != []:
243 bb.note("the following locales are supported only in legacy encodings:")
244 bb.note(" " + " ".join(non_utf8))
245}
246
247# We want to do this indirection so that we can safely 'return'
248# from the called function even though we're prepending
249python populate_packages_prepend () {
250 if bb.data.getVar('DEBIAN_NAMES', d, 1):
251 bb.data.setVar('PKG_glibc', 'libc6', d)
252 bb.data.setVar('PKG_glibc-dev', 'libc6-dev', d)
253 bb.build.exec_func('package_do_split_gconvs', d)
254}
diff --git a/meta/packages/meta/external-csl-toolchain_2008q3-72.bb b/meta/packages/meta/external-csl-toolchain_2008q3-72.bb
index d5230bf3d9..650da54d3e 100644
--- a/meta/packages/meta/external-csl-toolchain_2008q3-72.bb
+++ b/meta/packages/meta/external-csl-toolchain_2008q3-72.bb
@@ -35,7 +35,11 @@ do_install() {
35 sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so 35 sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so
36} 36}
37 37
38PACKAGES = "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" 38GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile"
39
40inherit glibc-package
41
42PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers"
39FILES_libgcc = "${base_libdir}/libgcc_s.so.1" 43FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
40FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" 44FILES_libgcc-dev = "${base_libdir}/libgcc_s.so"
41FILES_libstdc++ = "${libdir}/libstdc++.so.*" 45FILES_libstdc++ = "${libdir}/libstdc++.so.*"
@@ -54,205 +58,3 @@ FILES_linux-libc-headers = "${includedir}/asm* \
54 ${includedir}/video \ 58 ${includedir}/video \
55" 59"
56 60
57PACKAGES += "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"
58
59libc_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*"
60
61FILES_glibc = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo"
62FILES_glibc-dev = "${includedir}"
63FILES_ldd = "${bindir}/ldd"
64FILES_libsegfault = "/lib/libSegFault*"
65FILES_glibc-extra-nss = "/lib/libnss*"
66FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen ${libdir}/*.so"
67FILES_nscd = "${sbindir}/nscd*"
68FILES_glibc-utils = "${bindir}/* ${sbindir}/*"
69FILES_glibc-gconv = "${libdir}/gconv/*"
70FILES_glibc-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug ${base_libdir}/.debug ${libdir}/.debug"
71FILES_catchsegv = "${bindir}/catchsegv"
72RDEPENDS_catchsegv = "libsegfault"
73FILES_glibc-pcprofile = "/lib/libpcprofile.so"
74FILES_glibc-thread-db = "/lib/libthread_db*"
75RPROVIDES_glibc-dev += "libc-dev"
76LEAD_SONAME = "libc.so.6"
77
78DESCRIPTION_sln = "glibc: create symbolic links between files"
79DESCRIPTION_nscd = "glibc: name service cache daemon for passwd, group, and hosts"
80DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services"
81DESCRIPTION_ldd = "glibc: print shared library dependencies"
82DESCRIPTION_localedef = "glibc: compile locale definition files"
83DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..."
84
85FILES_sln = "${base_sbindir}/sln"
86FILES_localedef = "${bindir}/localedef"
87
88
89TMP_LOCALE="/tmp/locale${libdir}/locale"
90
91locale_base_postinst() {
92#!/bin/sh
93
94if [ "x$D" != "x" ]; then
95 exit 1
96fi
97
98rm -rf ${TMP_LOCALE}
99mkdir -p ${TMP_LOCALE}
100if [ -f ${libdir}/locale/locale-archive ]; then
101 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
102fi
103localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
104mkdir -p ${libdir}/locale/
105mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
106rm -rf ${TMP_LOCALE}
107}
108
109locale_base_postrm() {
110#!/bin/sh
111
112rm -rf ${TMP_LOCALE}
113mkdir -p ${TMP_LOCALE}
114if [ -f ${libdir}/locale/locale-archive ]; then
115 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
116fi
117localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
118mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
119rm -rf ${TMP_LOCALE}
120}
121
122python package_do_split_gconvs () {
123 import os, re
124 if (bb.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
125 bb.note("package requested not splitting gconvs")
126 return
127
128 if not bb.data.getVar('PACKAGES', d, 1):
129 return
130
131 libdir = bb.data.getVar('libdir', d, 1)
132 if not libdir:
133 bb.error("libdir not defined")
134 return
135 datadir = bb.data.getVar('datadir', d, 1)
136 if not datadir:
137 bb.error("datadir not defined")
138 return
139
140 gconv_libdir = os.path.join(libdir, "gconv")
141 charmap_dir = os.path.join(datadir, "i18n", "charmaps")
142 locales_dir = os.path.join(datadir, "i18n", "locales")
143 binary_locales_dir = os.path.join(libdir, "locale")
144
145 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s', extra_depends='glibc-gconv')
146
147 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='glibc-charmap-%s', description='character map for %s encoding', extra_depends='')
148
149 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
150 deps = []
151 f = open(fn, "r")
152 c_re = re.compile('^copy "(.*)"')
153 i_re = re.compile('^include "(\w+)".*')
154 for l in f.readlines():
155 m = c_re.match(l) or i_re.match(l)
156 if m:
157 dp = legitimize_package_name('glibc-localedata-%s' % m.group(1))
158 if not dp in deps:
159 deps.append(dp)
160 f.close()
161 if deps != []:
162 bb.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d)
163
164 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
165 bb.data.setVar('PACKAGES', bb.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
166
167 f = open(os.path.join(bb.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
168 supported = f.readlines()
169 f.close()
170
171 dot_re = re.compile("(.*)\.(.*)")
172
173 # Collate the locales by base and encoding
174 encodings = {}
175 for l in supported:
176 l = l[:-1]
177 (locale, charset) = l.split(" ")
178 m = dot_re.match(locale)
179 if m:
180 locale = m.group(1)
181 if not encodings.has_key(locale):
182 encodings[locale] = []
183 encodings[locale].append(charset)
184
185 def output_locale_source(name, locale, encoding):
186 pkgname = 'locale-base-' + legitimize_package_name(name)
187
188 bb.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), 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('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
195 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
196 bb.data.setVar('pkg_postinst_%s' % pkgname, bb.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d)
197 bb.data.setVar('pkg_postrm_%s' % pkgname, bb.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d)
198
199 def output_locale_binary(name, locale, encoding):
200 target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
201 qemu = "qemu-%s" % target_arch
202 pkgname = 'locale-base-' + legitimize_package_name(name)
203 m = re.match("(.*)\.(.*)", name)
204 if m:
205 glibc_name = "%s.%s" % (m.group(1), m.group(2).lower().replace("-",""))
206 else:
207 glibc_name = name
208 bb.data.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('glibc-binary-localedata-%s' % glibc_name), d)
209 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
210 m = re.match("(.*)_(.*)", name)
211 if m:
212 rprovides += ' virtual-locale-%s' % m.group(1)
213 bb.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
214 bb.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
215 bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
216
217 treedir = os.path.join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
218 path = bb.data.getVar("PATH", d, 1)
219 i18npath = os.path.join(treedir, datadir, "i18n")
220
221 localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name)
222 cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts)
223 bb.note("generating locale %s (%s)" % (locale, encoding))
224 if os.system(cmd):
225 raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd)
226
227 def output_locale(name, locale, encoding):
228 output_locale_source(name, locale, encoding)
229
230 # Reshuffle names so that UTF-8 is preferred over other encodings
231 non_utf8 = []
232 for l in encodings.keys():
233 if len(encodings[l]) == 1:
234 output_locale(l, l, encodings[l][0])
235 if encodings[l][0] != "UTF-8":
236 non_utf8.append(l)
237 else:
238 if "UTF-8" in encodings[l]:
239 output_locale(l, l, "UTF-8")
240 encodings[l].remove("UTF-8")
241 else:
242 non_utf8.append(l)
243 for e in encodings[l]:
244 output_locale('%s.%s' % (l, e), l, e)
245
246 if non_utf8 != []:
247 bb.note("the following locales are supported only in legacy encodings:")
248 bb.note(" " + " ".join(non_utf8))
249}
250
251# We want to do this indirection so that we can safely 'return'
252# from the called function even though we're prepending
253python populate_packages_prepend () {
254 if bb.data.getVar('DEBIAN_NAMES', d, 1):
255 bb.data.setVar('PKG_glibc', 'libc6', d)
256 bb.data.setVar('PKG_glibc-dev', 'libc6-dev', d)
257 bb.build.exec_func('package_do_split_gconvs', d)
258}