diff options
Diffstat (limited to 'meta/packages/meta/external-csl-toolchain_2006q3-27.bb')
-rw-r--r-- | meta/packages/meta/external-csl-toolchain_2006q3-27.bb | 207 |
1 files changed, 5 insertions, 202 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 | ||
34 | PACKAGES = "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" | 34 | GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "compile" |
35 | |||
36 | inherit glibc-package | ||
37 | |||
38 | PACKAGES += "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers" | ||
35 | FILES_libgcc = "${base_libdir}/libgcc_s.so.1" | 39 | FILES_libgcc = "${base_libdir}/libgcc_s.so.1" |
36 | FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" | 40 | FILES_libgcc-dev = "${base_libdir}/libgcc_s.so" |
37 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" | 41 | FILES_libstdc++ = "${libdir}/libstdc++.so.*" |
@@ -50,205 +54,4 @@ FILES_linux-libc-headers = "${includedir}/asm* \ | |||
50 | ${includedir}/video \ | 54 | ${includedir}/video \ |
51 | " | 55 | " |
52 | 56 | ||
53 | PACKAGES += "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 | |||
55 | libc_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 | |||
57 | FILES_glibc = "${sysconfdir} ${libc_baselibs} /sbin/ldconfig ${libexecdir}/* ${datadir}/zoneinfo" | ||
58 | FILES_glibc-dev = "${includedir}" | ||
59 | FILES_ldd = "${bindir}/ldd" | ||
60 | FILES_libsegfault = "/lib/libSegFault*" | ||
61 | FILES_glibc-extra-nss = "/lib/libnss*" | ||
62 | FILES_glibc-dev_append = " ${libdir}/*.o ${bindir}/rpcgen ${libdir}/*.so" | ||
63 | FILES_nscd = "${sbindir}/nscd*" | ||
64 | FILES_glibc-utils = "${bindir}/* ${sbindir}/*" | ||
65 | FILES_glibc-gconv = "${libdir}/gconv/*" | ||
66 | FILES_glibc-dbg += " ${libdir}/gconv/.debug ${libexecdir}/*/.debug ${base_libdir}/.debug ${libdir}/.debug" | ||
67 | FILES_catchsegv = "${bindir}/catchsegv" | ||
68 | RDEPENDS_catchsegv = "libsegfault" | ||
69 | FILES_glibc-pcprofile = "/lib/libpcprofile.so" | ||
70 | FILES_glibc-thread-db = "/lib/libthread_db*" | ||
71 | RPROVIDES_glibc-dev += "libc-dev" | ||
72 | LEAD_SONAME = "libc.so.6" | ||
73 | |||
74 | DESCRIPTION_sln = "glibc: create symbolic links between files" | ||
75 | DESCRIPTION_nscd = "glibc: name service cache daemon for passwd, group, and hosts" | ||
76 | DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services" | ||
77 | DESCRIPTION_ldd = "glibc: print shared library dependencies" | ||
78 | DESCRIPTION_localedef = "glibc: compile locale definition files" | ||
79 | DESCRIPTION_glibc-utils = "glibc: misc utilities like iconf, local, gencat, tzselect, rpcinfo, ..." | ||
80 | |||
81 | FILES_sln = "${base_sbindir}/sln" | ||
82 | FILES_localedef = "${bindir}/localedef" | ||
83 | |||
84 | |||
85 | TMP_LOCALE="/tmp/locale${libdir}/locale" | ||
86 | |||
87 | locale_base_postinst() { | ||
88 | #!/bin/sh | ||
89 | |||
90 | if [ "x$D" != "x" ]; then | ||
91 | exit 1 | ||
92 | fi | ||
93 | |||
94 | rm -rf ${TMP_LOCALE} | ||
95 | mkdir -p ${TMP_LOCALE} | ||
96 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
97 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
98 | fi | ||
99 | localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
100 | mkdir -p ${libdir}/locale/ | ||
101 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
102 | rm -rf ${TMP_LOCALE} | ||
103 | } | ||
104 | |||
105 | locale_base_postrm() { | ||
106 | #!/bin/sh | ||
107 | |||
108 | rm -rf ${TMP_LOCALE} | ||
109 | mkdir -p ${TMP_LOCALE} | ||
110 | if [ -f ${libdir}/locale/locale-archive ]; then | ||
111 | cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/ | ||
112 | fi | ||
113 | localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
114 | mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/ | ||
115 | rm -rf ${TMP_LOCALE} | ||
116 | } | ||
117 | |||
118 | python 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 | ||
249 | python 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 | } | ||