Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | include glibc-collateral.inc |
| 2 | |
| 3 | SUMMARY = "Locale data from glibc" |
| 4 | |
| 5 | BPN = "glibc" |
| 6 | LOCALEBASEPN = "${MLPREFIX}glibc" |
| 7 | |
| 8 | # glibc-collateral.inc inhibits all default deps, but do_package needs objcopy |
| 9 | # ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so') |
| 10 | # ERROR: Function failed: split_and_strip_files |
| 11 | BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" |
| 12 | BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" |
| 13 | do_package[depends] += "${BINUTILSDEP}" |
| 14 | |
| 15 | # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION |
| 16 | # is set. The idea is to avoid running localedef on the target (at first boot) |
| 17 | # to decrease initial boot time and avoid localedef being killed by the OOM |
| 18 | # killer which used to effectively break i18n on machines with < 128MB RAM. |
| 19 | |
| 20 | # default to disabled |
| 21 | ENABLE_BINARY_LOCALE_GENERATION ?= "0" |
| 22 | ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "0" |
| 23 | |
| 24 | #enable locale generation on these arches |
| 25 | # BINARY_LOCALE_ARCHES is a space separated list of regular expressions |
| 26 | BINARY_LOCALE_ARCHES ?= "arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64" |
| 27 | |
| 28 | # set "1" to use cross-localedef for locale generation |
| 29 | # set "0" for qemu emulation of native localedef for locale generation |
| 30 | LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1" |
| 31 | |
| 32 | PROVIDES = "virtual/libc-locale" |
| 33 | |
| 34 | PACKAGES = "localedef ${PN}-dbg" |
| 35 | |
| 36 | PACKAGES_DYNAMIC = "^locale-base-.* \ |
| 37 | ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ |
| 38 | ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ |
| 39 | ^${MLPREFIX}glibc-gconv$" |
| 40 | |
| 41 | # Create a glibc-binaries package |
| 42 | ALLOW_EMPTY_${BPN}-binaries = "1" |
| 43 | PACKAGES += "${BPN}-binaries" |
| 44 | RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-binary") != -1])}" |
| 45 | |
| 46 | # Create a glibc-charmaps package |
| 47 | ALLOW_EMPTY_${BPN}-charmaps = "1" |
| 48 | PACKAGES += "${BPN}-charmaps" |
| 49 | RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-charmap") != -1])}" |
| 50 | |
| 51 | # Create a glibc-gconvs package |
| 52 | ALLOW_EMPTY_${BPN}-gconvs = "1" |
| 53 | PACKAGES += "${BPN}-gconvs" |
| 54 | RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-gconv") != -1])}" |
| 55 | |
| 56 | # Create a glibc-localedatas package |
| 57 | ALLOW_EMPTY_${BPN}-localedatas = "1" |
| 58 | PACKAGES += "${BPN}-localedatas" |
| 59 | RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-localedata") != -1])}" |
| 60 | |
| 61 | DESCRIPTION_localedef = "glibc: compile locale definition files" |
| 62 | |
| 63 | # glibc-gconv is dynamically added into PACKAGES, thus |
| 64 | # FILES_glibc-gconv will not be automatically extended in multilib. |
| 65 | # Explicitly add ${MLPREFIX} for FILES_glibc-gconv. |
| 66 | FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*" |
| 67 | FILES_${PN}-dbg += "${libdir}/gconv/.debug/*" |
| 68 | FILES_localedef = "${bindir}/localedef" |
| 69 | |
| 70 | LOCALETREESRC = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}" |
| 71 | |
| 72 | do_install () { |
| 73 | mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir} |
| 74 | if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then |
| 75 | cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir} |
| 76 | fi |
| 77 | if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then |
| 78 | mkdir -p ${D}${localedir} |
| 79 | cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir} |
| 80 | fi |
| 81 | if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then |
| 82 | cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir} |
| 83 | fi |
| 84 | if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then |
| 85 | cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir} |
| 86 | fi |
| 87 | if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then |
| 88 | cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir} |
| 89 | fi |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame^] | 90 | chown root:root -R ${D} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 91 | cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR} |
| 92 | } |
| 93 | |
| 94 | inherit libc-package |
| 95 | |
| 96 | BBCLASSEXTEND = "nativesdk" |