summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-support/icu
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-support/icu')
-rw-r--r--poky/meta/recipes-support/icu/icu.inc87
-rw-r--r--poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch28
-rw-r--r--poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch34
-rw-r--r--poky/meta/recipes-support/icu/icu/fix-install-manx.patch57
-rw-r--r--poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch49
-rw-r--r--poky/meta/recipes-support/icu/icu_60.2.bb29
6 files changed, 284 insertions, 0 deletions
diff --git a/poky/meta/recipes-support/icu/icu.inc b/poky/meta/recipes-support/icu/icu.inc
new file mode 100644
index 000000000..983118cd6
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu.inc
@@ -0,0 +1,87 @@
+SUMMARY = "International Component for Unicode libraries"
+DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \
+portable set of C/C++ and Java libraries for Unicode support, software \
+internationalization (I18N) and globalization (G11N), giving applications the \
+same results on all platforms."
+HOMEPAGE = "http://site.icu-project.org/"
+
+LICENSE = "ICU"
+DEPENDS = "icu-native"
+DEPENDS_class-native = ""
+
+CVE_PRODUCT = "international_components_for_unicode"
+
+S = "${WORKDIR}/icu/source"
+SPDX_S = "${WORKDIR}/icu"
+STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
+
+BINCONFIG = "${bindir}/icu-config"
+
+ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
+
+inherit autotools pkgconfig binconfig
+
+# ICU needs the native build directory as an argument to its --with-cross-build option when
+# cross-compiling. Taken the situation that different builds may share a common sstate-cache
+# into consideration, the native build directory needs to be staged.
+EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+EXTRA_OECONF_class-native = ""
+EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+
+EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}"
+TARGET_CXXFLAGS_append = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}"
+
+# strtod_l() is not supported by musl; also xlocale.h is missing
+# It is not possible to disable its use via configure switches or env vars
+# so monkey patching is needed.
+do_configure_prepend_libc-musl () {
+ sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' ${S}/configure.ac
+}
+
+do_compile_prepend_class-target () {
+ # Make sure certain build host references do not end up being compiled
+ # in the image. This only affects libicutu and icu-dbg
+ sed \
+ -e 's,DU_BUILD=,DU_BUILD_unused=,g' \
+ -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -i ${B}/tools/toolutil/Makefile
+}
+
+PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
+do_install_append_class-native() {
+ mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config
+ cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE}
+ cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE}
+ cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
+}
+
+do_install_append_class-target() {
+ # The native pkgdata can not generate the correct data file.
+ # Use icupkg to re-generate it.
+ if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then
+ rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+ icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+ fi
+
+ # Remove build host references...
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ ${D}/${bindir}/icu-config ${D}/${libdir}/${BPN}/${PV}/Makefile.inc \
+ ${D}/${libdir}/${BPN}/${PV}/pkgdata.inc
+}
+
+PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
+
+FILES_${PN}-dev += "${libdir}/${BPN}/"
+
+FILES_libicudata = "${libdir}/libicudata.so.*"
+FILES_libicuuc = "${libdir}/libicuuc.so.*"
+FILES_libicui18n = "${libdir}/libicui18n.so.*"
+FILES_libicutu = "${libdir}/libicutu.so.*"
+FILES_libicuio = "${libdir}/libicuio.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch b/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
new file mode 100644
index 000000000..2968d571b
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
@@ -0,0 +1,28 @@
+From 0c82d6aa02c08e41b13c83b14782bd7024e25d59 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Feb 2014 21:06:42 +0000
+Subject: [PATCH] Disable LDFLAGSICUDT for Linux
+
+Upstream-Status: Inappropriate [ OE Configuration ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ source/config/mh-linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mh-linux b/config/mh-linux
+index 366f0cc..2689aab 100644
+--- a/config/mh-linux
++++ b/config/mh-linux
+@@ -21,7 +21,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+ LD_RPATH_PRE = -Wl,-rpath,
+
+ ## These are the library specific LDFLAGS
+-LDFLAGSICUDT=-nodefaultlibs -nostdlib
++# LDFLAGSICUDT=-nodefaultlibs -nostdlib
+
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+--
+1.7.10.4
+
diff --git a/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch b/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
new file mode 100644
index 000000000..f0c49e197
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
@@ -0,0 +1,34 @@
+From d6b57c1b4eb9a24d9d95342a961c93946539c93b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 24 Jun 2017 22:52:40 -0700
+Subject: [PATCH 3/4] i18n: Drop include <xlocale.h>
+
+glibc 2.26 drops this header
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ source/i18n/digitlst.cpp | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/source/i18n/digitlst.cpp b/source/i18n/digitlst.cpp
+index 8e86fa7..0bdbb2c 100644
+--- a/i18n/digitlst.cpp
++++ b/i18n/digitlst.cpp
+@@ -62,11 +62,7 @@
+ #endif
+
+ #if U_USE_STRTOD_L
+-# if U_HAVE_XLOCALE_H
+-# include <xlocale.h>
+-# else
+-# include <locale.h>
+-# endif
++# include <locale.h>
+ #endif
+
+ // ***************************************************************************
+--
+2.14.2
+
diff --git a/poky/meta/recipes-support/icu/icu/fix-install-manx.patch b/poky/meta/recipes-support/icu/icu/fix-install-manx.patch
new file mode 100644
index 000000000..8186fb412
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/fix-install-manx.patch
@@ -0,0 +1,57 @@
+From 3063a9211669bee673840ee81f81d30699b9b702 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 9 Oct 2015 17:50:41 +0100
+Subject: [PATCH 2/4] icu: fix install race
+
+The generic recursive target calls target-local so also adding it to the
+dependency list results in races due to install-local being executed twice in
+parallel. For example, install-manx can fail if the two install processes race
+and one process tries to chown a file that the other process has just deleted.
+
+Also install-manx should be a phony target, and for clarity use $^ instead of $?
+in the install command.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ source/Makefile.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/source/Makefile.in b/source/Makefile.in
+index c1db15b..4948deb 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -73,7 +73,7 @@ EXTRA_DATA =
+
+ ## List of phony targets
+ .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
+-install-recursive clean clean-local clean-recursive distclean \
++install-recursive install-manx clean clean-local clean-recursive distclean \
+ distclean-local distclean-recursive doc dist dist-local dist-recursive \
+ check check-local check-recursive clean-recursive-with-twist install-icu \
+ doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
+@@ -84,9 +84,9 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
+
+ ## List of standard targets
+ all: all-local all-recursive
+-install: install-recursive install-local
++install: install-recursive
+ clean: clean-recursive-with-twist clean-local
+-distclean : distclean-recursive distclean-local
++distclean : distclean-recursive
+ dist: dist-recursive
+ check: all check-recursive
+ check-recursive: all
+@@ -350,7 +350,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
+
+ install-manx: $(MANX_FILES)
+ $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
+- $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
++ $(INSTALL_DATA) $^ $(DESTDIR)$(mandir)/man$(SECTION)
+
+ config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
+ cd $(top_builddir) \
+--
+2.14.2
+
diff --git a/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch b/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
new file mode 100644
index 000000000..e758a623e
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
@@ -0,0 +1,49 @@
+pkgdata.cpp: use LARGE_BUFFER_MAX_SIZE for cmd
+
+Use LARGE_BUFFER_MAX_SIZE for cmd rather than SMALL_BUFFER_MAX_SIZE,
+otherwise there was a Segmentation fault error when the command line is
+long, this should be a misplay since other cmd uses
+LARGE_BUFFER_MAX_SIZE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ tools/pkgdata/pkgdata.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
+index 60167dd..506dd32 100644
+--- a/tools/pkgdata/pkgdata.cpp
++++ b/tools/pkgdata/pkgdata.cpp
+@@ -1084,7 +1084,7 @@ normal_symlink_mode:
+
+ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE];
++ char cmd[LARGE_BUFFER_MAX_SIZE];
+
+ sprintf(cmd, "cd %s && %s %s %s%s%s",
+ targetDir,
+@@ -1152,7 +1152,7 @@ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir,
+
+ static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
++ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
+
+ if (!T_FileStream_file_exists(installDir)) {
+ UErrorCode status = U_ZERO_ERROR;
+@@ -1184,7 +1184,7 @@ static int32_t pkg_installCommonMode(const char *installDir, const char *fileNam
+ #endif
+ static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
+ int32_t result = 0;
+- char cmd[SMALL_BUFFER_MAX_SIZE] = "";
++ char cmd[LARGE_BUFFER_MAX_SIZE] = "";
+
+ if (!T_FileStream_file_exists(installDir)) {
+ UErrorCode status = U_ZERO_ERROR;
+--
+1.9.1
+
diff --git a/poky/meta/recipes-support/icu/icu_60.2.bb b/poky/meta/recipes-support/icu/icu_60.2.bb
new file mode 100644
index 000000000..585a92bc4
--- /dev/null
+++ b/poky/meta/recipes-support/icu/icu_60.2.bb
@@ -0,0 +1,29 @@
+require icu.inc
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=675f2d069434d8a1e4e6b0dcf4379226"
+
+def icu_download_version(d):
+ pvsplit = d.getVar('PV').split('.')
+ return pvsplit[0] + "_" + pvsplit[1]
+
+ICU_PV = "${@icu_download_version(d)}"
+
+# http://errors.yoctoproject.org/Errors/Details/20486/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+
+BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
+SRC_URI = "${BASE_SRC_URI} \
+ file://icu-pkgdata-large-cmd.patch \
+ file://fix-install-manx.patch \
+ file://0001-i18n-Drop-include-xlocale.h.patch \
+ "
+
+SRC_URI_append_class-target = "\
+ file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
+ "
+SRC_URI[md5sum] = "43861b127744b3c0b9d7f386f4b9fa40"
+SRC_URI[sha256sum] = "f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418"
+
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
+UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
OpenPOWER on IntegriCloud