glibc-locale.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. require glibc-collateral.inc
  2. SUMMARY = "Locale data from glibc"
  3. BPN = "glibc"
  4. LOCALEBASEPN = "${MLPREFIX}glibc"
  5. # glibc-collateral.inc inhibits all default deps, but do_package needs objcopy
  6. # 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')
  7. # ERROR: Function failed: split_and_strip_files
  8. BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
  9. BINUTILSDEP:class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
  10. do_package[depends] += "${BINUTILSDEP}"
  11. DEPENDS += "virtual/libc"
  12. # Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
  13. # is set. The idea is to avoid running localedef on the target (at first boot)
  14. # to decrease initial boot time and avoid localedef being killed by the OOM
  15. # killer which used to effectively break i18n on machines with < 128MB RAM.
  16. # default to disabled
  17. ENABLE_BINARY_LOCALE_GENERATION ?= "0"
  18. ENABLE_BINARY_LOCALE_GENERATION:pn-nativesdk-glibc-locale = "1"
  19. #enable locale generation on these arches
  20. # BINARY_LOCALE_ARCHES is a space separated list of regular expressions
  21. BINARY_LOCALE_ARCHES ?= "arc arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64"
  22. # set "1" to use cross-localedef for locale generation
  23. # set "0" for qemu emulation of native localedef for locale generation
  24. LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
  25. PROVIDES = "virtual/libc-locale"
  26. PACKAGES = "localedef ${PN}-dbg"
  27. PACKAGES_DYNAMIC = "^locale-base-.* \
  28. ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
  29. ^${MLPREFIX}glibc-gconv$"
  30. # Create a glibc-binaries package
  31. ALLOW_EMPTY:${BPN}-binaries = "1"
  32. PACKAGES += "${BPN}-binaries"
  33. RRECOMMENDS:${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}"
  34. # Create a glibc-charmaps package
  35. ALLOW_EMPTY:${BPN}-charmaps = "1"
  36. PACKAGES += "${BPN}-charmaps"
  37. RRECOMMENDS:${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}"
  38. # Create a glibc-gconvs package
  39. ALLOW_EMPTY:${BPN}-gconvs = "1"
  40. PACKAGES += "${BPN}-gconvs"
  41. RRECOMMENDS:${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}"
  42. # Create a glibc-localedatas package
  43. ALLOW_EMPTY:${BPN}-localedatas = "1"
  44. PACKAGES += "${BPN}-localedatas"
  45. RRECOMMENDS:${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}"
  46. DESCRIPTION:localedef = "glibc: compile locale definition files"
  47. # glibc-gconv is dynamically added into PACKAGES, thus
  48. # FILES:glibc-gconv will not be automatically extended in multilib.
  49. # Explicitly add ${MLPREFIX} for FILES:glibc-gconv.
  50. FILES:${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
  51. FILES:localedef = "${bindir}/localedef"
  52. LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
  53. copy_locale_files() {
  54. local dir=$1 mode=$2
  55. [ -e "${LOCALETREESRC}$dir" ] || return 0
  56. for d in . $(find "${LOCALETREESRC}$dir" -type d -printf '%P '); do
  57. install -d ${D}$dir/$d
  58. find "${LOCALETREESRC}$dir/$d" -maxdepth 1 -type f \
  59. -exec install -m $mode -t "${D}$dir/$d" {} \;
  60. done
  61. }
  62. do_install() {
  63. copy_locale_files ${bindir} 0755
  64. copy_locale_files ${localedir} 0644
  65. if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then
  66. copy_locale_files ${libdir}/gconv 0755
  67. copy_locale_files ${datadir}/i18n 0644
  68. else
  69. # Remove the libdir if it is empty when gconv is not copied
  70. find ${D}${libdir} -type d -empty -delete
  71. fi
  72. copy_locale_files ${datadir}/locale 0644
  73. install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED
  74. }
  75. inherit libc-package
  76. BBCLASSEXTEND = "nativesdk"
  77. # Don't scan for CVEs as glibc will be scanned
  78. CVE_PRODUCT = ""