From 7f235e1d24ce525a2bd032cefa82d96ccfdc8a19 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 26 Dec 2019 23:05:57 +0300 Subject: Add implementation --- libicuuc/README-DEV | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 libicuuc/README-DEV (limited to 'libicuuc/README-DEV') diff --git a/libicuuc/README-DEV b/libicuuc/README-DEV new file mode 100644 index 0000000..b52452a --- /dev/null +++ b/libicuuc/README-DEV @@ -0,0 +1,78 @@ +This document describes how libicuuc and libicudata were packaged for build2. +In particular, this understanding will be useful when upgrading to a new +upstream version. See ../README-DEV for general notes on ICU packaging. + +Symlink the required upstream directories into libicu/: + +$ ln -s ../../upstream/icu4c/source/common libicu/uc + +Compiling against the latest C++ standard ends up with the "invalid conversion +from ‘const char8_t*’ to ‘const char*’" errors for libicu/uc/ucasemap.cpp and +so we patch it: + +$ cp libicu/uc/ucasemap.cpp libicu +$ patch -p0 /data/out/tmp/icudt65l_dat.c le +$ for f in $(find /data/out/tmp/ -name '*.c' ! -name icudt65l_dat.c); do + n="$(sed -n -r -e 's%^(coll|curr|brkitr|lang|locales|rbnf|region|unit|zone)_.*$%\1%p' <<< $(basename "$f"))" + if [ -z "$n" ]; then + n="other" + fi + cat "$f" >>le/$n.c + done + +Note that we also need to generate libicudata source files for the big-endian +byte ordering, transcoding the auto-generated binary data files and converting +them to C files afterwards: + +$ cd /data + +$ export PATH=/bin:$PATH +$ export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH + +# Transcode. +# +$ for f in $(cd out/build/icudt65l && find -type f); do + r="out/build/icudt65b/$f" + mkdir -p "$(dirname "$r")" + icupkg -tb "out/build/icudt65l/$f" "$r" + done + +# Convert to C files. +# +$ mkdir out/tmp2 +$ pkgdata -O icupkg.inc --without-assembly -q -c -s out/build/icudt65b \ +-d out/tmp2 -e icudt65 -T out/tmp2 -p icudt65b -m dll -r 65.1 -L icudata \ +out/tmp/icudata.lst + +Now copy the big-endian data files into libicu/data/, similar to the above: + +$ cd libicu/data/ +$ rm -r -f be +$ mkdir be +$ cp /data/out/tmp2/icudt65b_dat.c be +$ for f in $(find /data/out/tmp2/ -name '*.c' ! -name icudt65b_dat.c); do + n="$(sed -n -r -e 's%^(coll|curr|brkitr|lang|locales|rbnf|region|unit|zone)_.*$%\1%p' <<< $(basename "$f"))" + if [ -z "$n" ]; then + n="other" + fi + cat "$f" >>be/$n.c + done + +Note that currently we don't support EBCDIC charset-based platforms that are +not very common these days. Thought, we can support them if requested (see the +-te option description in `icupkg --help` for details). + +Manually create libicu/data/config.h and libicu/data/*.c files including the +corresponding type-based data files (le/coll.c, etc) depending on the target +platform byte ordering. -- cgit v1.1