This ebuild builds and installs the icu package in chrome so that it can be used in Chrome OS. Compared with the vanilla ICU library, it is customised for Chrome so there are some missing functionality and encoding (e.g. ISO-2022-CN and ISO-2022-KR). But it should be powerful enough for most usages. (It supports the i18n of Chrome!)
The biggest reason is to save resources. Chrome-icu saves,
Please give us a heads-up if you want to use it. This is because chrome-icu is currently a static library, so linking it will non-trivially increase the disk space. And if the users of chrome-icu become more and more, we will spend the effort to make it into a shared library. (This will not affect your usage, please see the tracker.)
chrome-icu
as a dependency in your ebuild.icui18n-chrome
and icuuc-chrome
libraries.${sysroot}/usr/include/icu-chrome/common
and ${sysroot}/usr/include/icu-chrome/i18n
./opt/google/chrome/icudtl.dat
. You can follow the example here.build-chrome.eclass
and avoid the duplication between chromeos-chrome.ebuild
and chrome-icu.ebuild
. (We used to duplicate the code because chrome-icu used to be very experimental so we do not want to greatly change the chromeos-chrome.ebuild
for it. With chrome-icu method becoming stable, we can consider it now.)This normally means that there is no prebuilt binary available for chrome-icu so it has to build chrome-icu from source and this needs the whole chrome repo. Because chrome-icu and chrome share a similar build mechanism, this usually implies that there is no prebuilt binary available for chrome too. So if you just did a repo sync and found it has to build chrome-icu from source in running build_packages
, it means you will also need to build chrome from source too --- it is only because chrome depends on chrome-icu so the latter will be built first.
How to resolve it: There are a few methods that you could try,
emerge-$BOARD -G chrome-icu
and see if this succeeds and satisfies your needs. (This command enforce emerging chrome-icu from prebuilt binary.)--chrome-root
option pointing to your local chrome checkout. Then after entering the chroot, the chrome checkout is located at “~/chrome_root”. Second, now you can run CHROME_ORIGIN=LOCAL_SOURCE emerge-$BOARD chrome-icu
to build it form local chrome checkout.This is because: First, making it into a static library is easier and requires less modifications in chrome; Second, currently only two packages are using it, and total size increase of linking it statically is smaller than that of making it into a shared library.
The answer is no. This is because in chrome, icu is compiled with “control-flow integrity (CFI)” turned on. And CFI currently does not work well with shared libraries.
Theoretically, the method used by chrome-icu should be able to share any code in chrome to Chrome OS. But considering that 1) the chrome-icu method is still very new and 2) it requires changes in both chrome and the infra configurations, we recommend you to first chat with the Chrome OS build team to discuss about your problem before moving forward. And there are other (e.g. more lightweight) sharing methods which may be more suitable.