blob: 03ac5e9151e48c70f3e028c4cea1e16d0c82b739 [file] [log] [blame]
How to rebuild the ICU data files.
This is based off of section B in the README.chromium file.
1. Set ICU_ROOT to the directory of the ICU source code in the Cobalt source
tree, e.g. `$COBALT_SRC_ROOT/src/third_party/icu`.
2. Create a build directory outside of the Cobalt codebase, and make that your
current working directory. Set ICU_DATA_ROOT to this directory.
3. Configure the ICU build. Note that we setup our compiler defines in the same
way that they are set when building ICU within Cobalt, according to our
icu.gyp file.
Run
```
ICU_DATA_FILTER_FILE="$ICU_ROOT/filters/cobalt.json" \
env CPPFLAGS="-DUCONFIG_NO_LEGACY_CONVERSION=1 -DU_CHARSET_IS_UTF8=1 \
-DUCONFIG_ONLY_HTML_CONVERSION=1 -DUCONFIG_NO_TRANSLITERATION=1 \
-DUCONFIG_NO_COLLATION=1" \
"$ICU_ROOT/source/runConfigureICU" --enable-debug --disable-release \
Linux/gcc --disable-tests --disable-layoutex
```
4. Run `$ICU_ROOT/cast/patch_locale.sh && make -j 120`
5. Run `$ICU_ROOT/scripts/clean_up_data_source.sh` to clean up the changes
made to $ICU_ROOT from the call to `patch_locale.sh`.
Cobalt uses a packaged ICU data file instead of individual files. This packaged
ICU data file is used during the build to link ICU data into the Cobalt binary.
6. Replace the files in this directory with the new files that you have built.
Run:
```
cd $COBALT_SRC_ROOT/third_party/icu/cobalt
rm -rf *
cp $ICU_DATA_ROOT/data/out/tmp/icudt68l.dat .
cp $ICU_DATA_ROOT/data/out/tmp/icudt68b.dat .
```
Note that at the time of this writing, the final resulting contents had a size
of 4.6MB, from running the command
`du -sh $COBALT_SRC_ROOT/third_party/icu/cobalt/icudt68l.dat`.
********************************************************************************
You should now have the ICU data files generated and ready to go in the Cobalt
source tree, and you can clean up any outstanding files. If there are any
leftover changes in your $ICU_ROOT directory, you can revert them. At this
point you can run `gn gen`, run `ninja`, and run Cobalt and it should work.