blob: 6d9728903dbe3540eea050c7d753aebb2b31d118 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "International Component for Unicode libraries"
2DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \
3portable set of C/C++ and Java libraries for Unicode support, software \
4internationalization (I18N) and globalization (G11N), giving applications the \
5same results on all platforms."
6HOMEPAGE = "http://site.icu-project.org/"
7
8LICENSE = "ICU"
9DEPENDS = "icu-native"
10DEPENDS_class-native = ""
11
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012CVE_PRODUCT = "international_components_for_unicode"
13
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014S = "${WORKDIR}/icu/source"
15SPDX_S = "${WORKDIR}/icu"
16STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
17
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018BINCONFIG = "${bindir}/icu-config"
19
Brad Bishop316dfdd2018-06-25 12:45:53 -040020ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
21
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080022inherit autotools pkgconfig binconfig multilib_script
23
24MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/icu-config"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025
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.
29EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
30EXTRA_OECONF_class-native = ""
31EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
32
Brad Bishop316dfdd2018-06-25 12:45:53 -040033EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}"
34TARGET_CXXFLAGS_append = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050035
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036ASNEEDED = ""
37
Brad Bishop316dfdd2018-06-25 12:45:53 -040038do_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 Williamsc124f4f2015-09-15 14:41:29 -050047PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
48do_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 Bishop316dfdd2018-06-25 12:45:53 -040057do_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 Bishop6e60e8b2018-02-01 10:27:11 -050074PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050075
76FILES_${PN}-dev += "${libdir}/${BPN}/"
77
78FILES_libicudata = "${libdir}/libicudata.so.*"
79FILES_libicuuc = "${libdir}/libicuuc.so.*"
80FILES_libicui18n = "${libdir}/libicui18n.so.*"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081FILES_libicutu = "${libdir}/libicutu.so.*"
82FILES_libicuio = "${libdir}/libicuio.so.*"
83
84BBCLASSEXTEND = "native nativesdk"