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 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | inherit autotools pkgconfig binconfig multilib_script |
| 23 | |
| 24 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/icu-config" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
| 26 | # ICU needs the native build directory as an argument to its --with-cross-build option when |
| 27 | # cross-compiling. Taken the situation that different builds may share a common sstate-cache |
| 28 | # into consideration, the native build directory needs to be staged. |
| 29 | EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" |
| 30 | EXTRA_OECONF_class-native = "" |
| 31 | EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" |
| 32 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}" |
| 34 | 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] | 35 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 36 | ASNEEDED = "" |
| 37 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 38 | do_compile_prepend_class-target () { |
| 39 | # Make sure certain build host references do not end up being compiled |
| 40 | # in the image. This only affects libicutu and icu-dbg |
| 41 | sed \ |
| 42 | -e 's,DU_BUILD=,DU_BUILD_unused=,g' \ |
| 43 | -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 44 | -i ${B}/tools/toolutil/Makefile |
| 45 | } |
| 46 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}" |
| 48 | do_install_append_class-native() { |
| 49 | mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 50 | cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 51 | cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config |
| 52 | cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE} |
| 53 | cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE} |
| 54 | cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE} |
| 55 | } |
| 56 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 57 | do_install_append_class-target() { |
| 58 | # The native pkgdata can not generate the correct data file. |
| 59 | # Use icupkg to re-generate it. |
| 60 | if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then |
| 61 | rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat |
| 62 | icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat |
| 63 | fi |
| 64 | |
| 65 | # Remove build host references... |
| 66 | sed -i \ |
| 67 | -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 68 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 69 | -e 's:${HOSTTOOLS_DIR}/::g' \ |
| 70 | ${D}/${bindir}/icu-config ${D}/${libdir}/${BPN}/${PV}/Makefile.inc \ |
| 71 | ${D}/${libdir}/${BPN}/${PV}/pkgdata.inc |
| 72 | } |
| 73 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 74 | PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | |
| 76 | FILES_${PN}-dev += "${libdir}/${BPN}/" |
| 77 | |
| 78 | FILES_libicudata = "${libdir}/libicudata.so.*" |
| 79 | FILES_libicuuc = "${libdir}/libicuuc.so.*" |
| 80 | FILES_libicui18n = "${libdir}/libicui18n.so.*" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | FILES_libicutu = "${libdir}/libicutu.so.*" |
| 82 | FILES_libicuio = "${libdir}/libicuio.so.*" |
| 83 | |
| 84 | BBCLASSEXTEND = "native nativesdk" |