Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "International Component for Unicode libraries" |
| 2 | DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \ |
| 3 | portable set of C/C++ and Java libraries for Unicode support, software \ |
| 4 | internationalization (I18N) and globalization (G11N), giving applications the \ |
| 5 | same results on all platforms." |
| 6 | HOMEPAGE = "http://site.icu-project.org/" |
| 7 | |
| 8 | LICENSE = "ICU" |
| 9 | DEPENDS = "icu-native" |
| 10 | DEPENDS_class-native = "" |
| 11 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 12 | CVE_PRODUCT = "international_components_for_unicode" |
| 13 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | S = "${WORKDIR}/icu/source" |
| 15 | SPDX_S = "${WORKDIR}/icu" |
| 16 | STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}" |
| 17 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | BINCONFIG = "${bindir}/icu-config" |
| 19 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}" |
| 21 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 22 | inherit autotools pkgconfig binconfig |
| 23 | |
| 24 | # ICU needs the native build directory as an argument to its --with-cross-build option when |
| 25 | # cross-compiling. Taken the situation that different builds may share a common sstate-cache |
| 26 | # into consideration, the native build directory needs to be staged. |
| 27 | EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" |
| 28 | EXTRA_OECONF_class-native = "" |
| 29 | EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" |
| 30 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 31 | EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}" |
| 32 | TARGET_CXXFLAGS_append = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 33 | |
| 34 | # strtod_l() is not supported by musl; also xlocale.h is missing |
| 35 | # It is not possible to disable its use via configure switches or env vars |
| 36 | # so monkey patching is needed. |
| 37 | do_configure_prepend_libc-musl () { |
| 38 | sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' ${S}/configure.ac |
| 39 | } |
| 40 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 41 | do_compile_prepend_class-target () { |
| 42 | # Make sure certain build host references do not end up being compiled |
| 43 | # in the image. This only affects libicutu and icu-dbg |
| 44 | sed \ |
| 45 | -e 's,DU_BUILD=,DU_BUILD_unused=,g' \ |
| 46 | -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 47 | -i ${B}/tools/toolutil/Makefile |
| 48 | } |
| 49 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}" |
| 51 | do_install_append_class-native() { |
| 52 | mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 53 | cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 54 | cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 55 | cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE} |
| 56 | cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE} |
| 57 | cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE} |
| 58 | } |
| 59 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 60 | do_install_append_class-target() { |
| 61 | # The native pkgdata can not generate the correct data file. |
| 62 | # Use icupkg to re-generate it. |
| 63 | if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then |
| 64 | rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat |
| 65 | icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat |
| 66 | fi |
| 67 | |
| 68 | # Remove build host references... |
| 69 | sed -i \ |
| 70 | -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 71 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 72 | -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 73 | ${D}/${bindir}/icu-config ${D}/${libdir}/${BPN}/${PV}/Makefile.inc \ |
| 74 | ${D}/${libdir}/${BPN}/${PV}/pkgdata.inc |
| 75 | } |
| 76 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 77 | PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 78 | |
| 79 | FILES_${PN}-dev += "${libdir}/${BPN}/" |
| 80 | |
| 81 | FILES_libicudata = "${libdir}/libicudata.so.*" |
| 82 | FILES_libicuuc = "${libdir}/libicuuc.so.*" |
| 83 | FILES_libicui18n = "${libdir}/libicui18n.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 84 | FILES_libicutu = "${libdir}/libicutu.so.*" |
| 85 | FILES_libicuio = "${libdir}/libicuio.so.*" |
| 86 | |
| 87 | BBCLASSEXTEND = "native nativesdk" |