This file documents the procedures for building with ICU4X.
ac_add_options --enable-icu4xmozconfig. (This is the default)
Do a full build.
Updating the bundled ICU4X data¶
ICU4X data is bundled directly as a rust crate with
icu_*_data crate has all locale data, so it might include unnecessary data.
icu_segmenter uses custom crates in Gecko since it includes unnecessary data such as the word dictionaries for East Asian.
intl/update-icu4x.sh can generate and update this binary data. If you want to add the new data type, you modify this script and then, run it.
When using ICU4X 1.4.0 data with the latest data that is hard-coded, you have to run the following. The baked data of
icu_segmenter is generated into
$ cd $(TOPSRCDIR)/intl
$ ./update-icu4x.sh https://github.com/unicode-org/icu4x.git email@example.com 44.0.0 release-74-1 1.4.0
If you update ICU4X crate into Gecko, you have to check
Cargo.toml in Gecko’s root directory. We might have some hacks to replace crate.io version with a custom version.
icu_capi crate for C/C++ FFI.
icu_capi. It can return valid data until shutting down.
Accessing the data provider from Rust¶
compiled_data feature. You don’t consider data provider.
Adding new ICU4X features to Gecko¶
To reduce build time and binary size, embedded ICU4X in Gecko is minimal configuration. If you have to add new features, you have to update some files.
Adding the feature to
compiled_datafeature of added crate.
Modify the patch file for
intl/update-icu4x.shto add generated ICU4X data if you want to modify ICU4X baked data.