summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-04-04 16:02:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-05 11:46:38 +0100
commit72a56c2bd02d32382260d4f4fd14ab4c8d4cb8f4 (patch)
tree1dd7c89a247c7150ef837f9dad86d62b6098ed95 /meta
parent8fad68fb3cdb4a17b973463ba403ef136aae3946 (diff)
downloadpoky-72a56c2bd02d32382260d4f4fd14ab4c8d4cb8f4.tar.gz
icu: Add knobs to generate a subset of ICU data
Recent versions of ICU (64+) provides a tool for configuring ICU locale data file with finer granularity [1] Default generated size for libicudata.so.66.1 is ~27M, which is quite large for embedded systems and all of them may not even need all locale data. This patch calls the icudata buildtool during configure on the icudata and utilizes a filter called 'filter.json` ( empty by default) to create the data, default behavior should remain same but someone can add a filter.json in own layer to configure this data, e.g. { "localeFilter": { "filterType": "language", "whitelist": [ "en", "de", "it" ] } } would only generate the locale data for english/german/italian This would reduce the size of libicudata.so.66.1 to 12M Ensure that icudata is generated using host-tools so it can deal with endianness correctly, when host and target systems have different endianness install the icudtata file back into in/ folder so that main build can now pickup this data file instead of regenerating it and wiping out the filter changes that are expected to take effect Use native compiler tools Update the big-endian support patch to apply to latest Makefile.in from icudata source and mark it as backport defer applying 0001-Fix-big-endian-build.patch after moving new data/ in [1] https://github.com/unicode-org/icu/blob/master/docs/userguide/icu_data/buildtool.md (From OE-Core rev: 5e5be67744d7ddf5a9ac433ecba02f697a84a325) Signed-off-by: Khem Raj <raj.khem@gmail.com> Suggested-by: Wouter Meek <w.meek@metrological.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch26
-rw-r--r--meta/recipes-support/icu/icu/filter.json2
-rw-r--r--meta/recipes-support/icu/icu_66.1.bb37
3 files changed, 48 insertions, 17 deletions
diff --git a/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch b/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch
index efb27ae4e3..91d68848c7 100644
--- a/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch
+++ b/meta/recipes-support/icu/icu/0001-Fix-big-endian-build.patch
@@ -6,23 +6,23 @@ Subject: [PATCH] Fix big-endian build
6Bug-report: https://unicode-org.atlassian.net/browse/ICU-20533 6Bug-report: https://unicode-org.atlassian.net/browse/ICU-20533
7Patch taken from: https://bugs.gentoo.org/682170 7Patch taken from: https://bugs.gentoo.org/682170
8 8
9Upstream-Status: Pending 9it is applied upstream and will be in version 67+
10
11Upstream-Status: Backport [https://github.com/unicode-org/icu/commit/4a3a457b38cd828b7b3fa4fdbc6e2504a57275e9]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11--- 13---
12 data/Makefile.in | 3 ++- 14 data/Makefile.in | 3 ++-
13 1 file changed, 2 insertions(+), 1 deletion(-) 15 1 file changed, 2 insertions(+), 1 deletion(-)
14 16
15diff --git a/source/data/Makefile.in b/source/data/Makefile.in
16index 778b6c7..67203e7 100644
17--- a/data/Makefile.in 17--- a/data/Makefile.in
18+++ b/data/Makefile.in 18+++ b/data/Makefile.in
19@@ -148,7 +148,8 @@ ICUDATA_ARCHIVE = $(firstword $(wildcard $(srcdir)/in/$(ICUDATA_BASENAME_VERSION 19@@ -148,7 +148,8 @@ ICUDATA_ARCHIVE = $(firstword $(wildcard
20 # and convert it to the current type. 20 # and convert it to the current type.
21 ifneq ($(ICUDATA_ARCHIVE),) 21 ifneq ($(ICUDATA_ARCHIVE),)
22 ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat 22 ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat
23-$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR) 23-$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR)
24+$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) 24+$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE)
25+ $(MKINSTALLDIRS) $(OUTDIR) 25+ $(MKINSTALLDIRS) $(OUTDIR)
26 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE) 26 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE)
27 endif 27 endif
28 else 28 else
diff --git a/meta/recipes-support/icu/icu/filter.json b/meta/recipes-support/icu/icu/filter.json
new file mode 100644
index 0000000000..2c63c08510
--- /dev/null
+++ b/meta/recipes-support/icu/icu/filter.json
@@ -0,0 +1,2 @@
1{
2}
diff --git a/meta/recipes-support/icu/icu_66.1.bb b/meta/recipes-support/icu/icu_66.1.bb
index 5018464c14..0d26f52f20 100644
--- a/meta/recipes-support/icu/icu_66.1.bb
+++ b/meta/recipes-support/icu/icu_66.1.bb
@@ -18,18 +18,47 @@ ARM_INSTRUCTION_SET_armv4 = "arm"
18ARM_INSTRUCTION_SET_armv5 = "arm" 18ARM_INSTRUCTION_SET_armv5 = "arm"
19 19
20BASE_SRC_URI = "https://github.com/unicode-org/icu/releases/download/release-${ICU_FOLDER}/icu4c-${ICU_PV}-src.tgz" 20BASE_SRC_URI = "https://github.com/unicode-org/icu/releases/download/release-${ICU_FOLDER}/icu4c-${ICU_PV}-src.tgz"
21SRC_URI = "${BASE_SRC_URI} \ 21DATA_SRC_URI = "https://github.com/unicode-org/icu/releases/download/release-${ICU_FOLDER}/icu4c-${ICU_PV}-data.zip"
22SRC_URI = "${BASE_SRC_URI};name=code \
23 ${DATA_SRC_URI};name=data \
24 file://filter.json \
22 file://icu-pkgdata-large-cmd.patch \ 25 file://icu-pkgdata-large-cmd.patch \
23 file://fix-install-manx.patch \ 26 file://fix-install-manx.patch \
24 file://0001-Fix-big-endian-build.patch \ 27 file://0001-Fix-big-endian-build.patch;apply=no \
25 file://0001-icu-Added-armeb-support.patch \ 28 file://0001-icu-Added-armeb-support.patch \
26 " 29 "
27 30
28SRC_URI_append_class-target = "\ 31SRC_URI_append_class-target = "\
29 file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \ 32 file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
30 " 33 "
31SRC_URI[md5sum] = "b33dc6766711517c98d318447e5110f8" 34SRC_URI[code.sha256sum] = "52a3f2209ab95559c1cf0a14f24338001f389615bf00e2585ef3dbc43ecf0a2e"
32SRC_URI[sha256sum] = "52a3f2209ab95559c1cf0a14f24338001f389615bf00e2585ef3dbc43ecf0a2e" 35SRC_URI[data.sha256sum] = "8be647f738891d2beb79d48f99077b3499948430eae6f1be112553b15ab0243e"
33 36
34UPSTREAM_CHECK_REGEX = "icu4c-(?P<pver>\d+(_\d+)+)-src" 37UPSTREAM_CHECK_REGEX = "icu4c-(?P<pver>\d+(_\d+)+)-src"
35UPSTREAM_CHECK_URI = "https://github.com/unicode-org/icu/releases" 38UPSTREAM_CHECK_URI = "https://github.com/unicode-org/icu/releases"
39
40do_make_icudata_class-target () {
41 cd ${S}
42 rm -rf data
43 cp -a ${WORKDIR}/data .
44 patch -p1 < ${WORKDIR}/0001-Fix-big-endian-build.patch
45 AR='${BUILD_AR}' \
46 CC='${BUILD_CC}' \
47 CPP='${BUILD_CPP}' \
48 CXX='${BUILD_CXX}' \
49 RANLIB='${BUILD_RANLIB}' \
50 CFLAGS='${BUILD_CFLAGS}' \
51 CPPFLAGS='${BUILD_CPPFLAGS}' \
52 CXXFLAGS='${BUILD_CXXFLAGS}' \
53 LDFLAGS='${BUILD_LDFLAGS}' \
54 ICU_DATA_FILTER_FILE=${WORKDIR}/filter.json \
55 ./runConfigureICU Linux --with-data-packaging=archive
56 oe_runmake ${PARALLEL_MAKE}
57 install -Dm644 ${S}/data/out/icudt${ICU_MAJOR_VER}l.dat ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat
58}
59
60do_make_icudata() {
61 :
62}
63
64addtask make_icudata before do_configure after do_patch