Skip to content

Commit ebc9902

Browse files
committed
Add recipe to build icu library that matches version used by binary swfit
runtime
1 parent eb5052e commit ebc9902

5 files changed

+187
-0
lines changed

recipes-support/icu/icu-swift.inc

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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-swift-native"
10+
DEPENDS_class-native = ""
11+
12+
S = "${WORKDIR}/icu/source"
13+
SPDX_S = "${WORKDIR}/icu"
14+
STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
15+
16+
CPPFLAGS_append_libc-uclibc = " -DU_TIMEZONE=0"
17+
18+
BINCONFIG = "${bindir}/icu-config"
19+
20+
inherit autotools pkgconfig binconfig
21+
22+
# ICU needs the native build directory as an argument to its --with-cross-build option when
23+
# cross-compiling. Taken the situation that different builds may share a common sstate-cache
24+
# into consideration, the native build directory needs to be staged.
25+
EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
26+
EXTRA_OECONF_class-native = ""
27+
EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
28+
29+
PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
30+
do_install_append_class-native() {
31+
mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
32+
cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config
33+
cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config
34+
cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE}
35+
cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE}
36+
cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
37+
}
38+
39+
do_install_append() {
40+
rm -rf ${D}/usr/lib/icu
41+
rm -rf ${D}/usr/share/icu
42+
}
43+
44+
PACKAGES =+ "libicudata-swift libicuuc-swift libicui18n-swift libicule-swift libiculx-swift libicutu-swift libicuio-swift"
45+
46+
FILES_${PN}-dev += "${libdir}/${BPN}/"
47+
48+
FILES_libicudata-swift = "${libdir}/libicudata.so.*"
49+
FILES_libicuuc-swift = "${libdir}/libicuuc.so.*"
50+
FILES_libicui18n-swift = "${libdir}/libicui18n.so.*"
51+
FILES_libicule-swift = "${libdir}/libicule.so.*"
52+
FILES_libiculx-swift = "${libdir}/libiculx.so.*"
53+
FILES_libicutu-swift = "${libdir}/libicutu.so.*"
54+
FILES_libicuio-swift = "${libdir}/libicuio.so.*"
55+
56+
BBCLASSEXTEND = "native nativesdk"
57+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 0c82d6aa02c08e41b13c83b14782bd7024e25d59 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Sat, 15 Feb 2014 21:06:42 +0000
4+
Subject: [PATCH] Disable LDFLAGSICUDT for Linux
5+
6+
Upstream-Status: Inappropriate [ OE Configuration ]
7+
8+
Signed-off-by: Khem Raj <[email protected]>
9+
---
10+
source/config/mh-linux | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/config/mh-linux b/config/mh-linux
14+
index 366f0cc..2689aab 100644
15+
--- a/config/mh-linux
16+
+++ b/config/mh-linux
17+
@@ -21,7 +21,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
18+
LD_RPATH_PRE = -Wl,-rpath,
19+
20+
## These are the library specific LDFLAGS
21+
-LDFLAGSICUDT=-nodefaultlibs -nostdlib
22+
+# LDFLAGSICUDT=-nodefaultlibs -nostdlib
23+
24+
## Compiler switch to embed a library name
25+
# The initial tab in the next line is to prevent icu-config from reading it.
26+
--
27+
1.7.10.4
28+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
The generic recursive target calls target-local so also adding it to the
2+
dependency list results in races due to install-local being executed twice in
3+
parallel. For example, install-manx can fail if the two install processes race
4+
and one process tries to chown a file that the other process has just deleted.
5+
6+
Also install-manx should be a phony target, and for clarity use $^ instead of $?
7+
in the install command.
8+
9+
Upstream-Status: Pending
10+
Signed-off-by: Ross Burton <[email protected]>
11+
12+
13+
diff --git a/Makefile.in b/Makefile.in
14+
index 9db6c52..3441afa 100644
15+
--- a/Makefile.in
16+
+++ b/Makefile.in
17+
@@ -71,7 +71,7 @@ EXTRA_DATA =
18+
19+
## List of phony targets
20+
.PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \
21+
-install-recursive clean clean-local clean-recursive distclean \
22+
+install-recursive install-manx clean clean-local clean-recursive distclean \
23+
distclean-local distclean-recursive doc dist dist-local dist-recursive \
24+
check check-local check-recursive clean-recursive-with-twist install-icu \
25+
doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
26+
@@ -82,10 +82,10 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
27+
28+
## List of standard targets
29+
all: all-local all-recursive
30+
-install: install-recursive install-local
31+
+install: install-recursive
32+
clean: clean-recursive-with-twist clean-local
33+
-distclean : distclean-recursive distclean-local
34+
-dist: dist-recursive dist-local
35+
+distclean : distclean-recursive
36+
+dist: dist-recursive
37+
check: all check-recursive
38+
check-recursive: all
39+
xcheck: all xcheck-recursive
40+
@@ -352,7 +352,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
41+
42+
install-manx: $(MANX_FILES)
43+
$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
44+
- $(INSTALL_DATA) $? $(DESTDIR)$(mandir)/man$(SECTION)
45+
+ $(INSTALL_DATA) $^ $(DESTDIR)$(mandir)/man$(SECTION)
46+
47+
config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
48+
cd $(top_builddir) \
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
pkgdata.cpp: use LARGE_BUFFER_MAX_SIZE for cmd
2+
3+
Use LARGE_BUFFER_MAX_SIZE for cmd rather than SMALL_BUFFER_MAX_SIZE,
4+
otherwise there was a Segmentation fault error when the command line is
5+
long, this should be a misplay since other cmd uses
6+
LARGE_BUFFER_MAX_SIZE.
7+
8+
Upstream-Status: Pending
9+
10+
Signed-off-by: Robert Yang <[email protected]>
11+
---
12+
tools/pkgdata/pkgdata.cpp | 2 +-
13+
1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+
diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
16+
--- a/tools/pkgdata/pkgdata.cpp
17+
+++ b/tools/pkgdata/pkgdata.cpp
18+
@@ -1019,7 +1019,7 @@ normal_symlink_mode:
19+
20+
static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
21+
int32_t result = 0;
22+
- char cmd[SMALL_BUFFER_MAX_SIZE];
23+
+ char cmd[LARGE_BUFFER_MAX_SIZE];
24+
25+
sprintf(cmd, "cd %s && %s %s %s%s%s",
26+
targetDir,
27+
--
28+
1.7.10.4
29+

recipes-support/icu/icu-swift_55.1.bb

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require icu-swift.inc
2+
3+
LIC_FILES_CHKSUM = "file://../license.html;md5=64eff4aadff4d104d6d437c4fde0e6d7"
4+
5+
def icu_download_version(d):
6+
pvsplit = d.getVar('PV', True).split('.')
7+
return pvsplit[0] + "_" + pvsplit[1]
8+
9+
ICU_PV = "${@icu_download_version(d)}"
10+
11+
# http://errors.yoctoproject.org/Errors/Details/20486/
12+
ARM_INSTRUCTION_SET_armv4 = "arm"
13+
ARM_INSTRUCTION_SET_armv5 = "arm"
14+
15+
BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
16+
SRC_URI = "${BASE_SRC_URI} \
17+
file://icu-pkgdata-large-cmd.patch \
18+
file://fix-install-manx.patch \
19+
"
20+
21+
SRC_URI_append_class-target = "\
22+
file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
23+
"
24+
SRC_URI[md5sum] = "e2d523df79d6cb7855c2fbe284f4db29"
25+
SRC_URI[sha256sum] = "e16b22cbefdd354bec114541f7849a12f8fc2015320ca5282ee4fd787571457b"

0 commit comments

Comments
 (0)