skia2/third_party/icu
Hal Canary e6cfe77185 third_party/icu: use upstream
Change DEPS to point at upstream, not chromium's fork.
    `skia_use_icu` defaults to true everywhere but iOS
    Clean up SkLoadICU:  use U_ICUDATA_ENTRY_POINT, no DLL.
    Add data dep to icu/icu.gni
    Scripts: icu/{make_data_assembly.py,make_data_obj_win.py}
    Scripts: icu/{update_icu.sh,build_icu_data_file.py} for rebuilding
    document process in icu/README.md

Bug: skia:8702
Change-Id: I99789749ba84ae737f6c62475d0d676cd36715bb
Reviewed-on: https://skia-review.googlesource.com/c/186870
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-02-05 22:22:48 +00:00
..
build_icu_data_file.py third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
BUILD.gn third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
download_file.py third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
hasher.py third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
icu.gni third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
make_data_assembly.py third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
make_data_obj_win.py third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
README.md third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
SkLoadICU.h third_party/icu: use upstream 2019-02-05 22:22:48 +00:00
update_icu.sh third_party/icu: use upstream 2019-02-05 22:22:48 +00:00

ICU

If the GN variable use_icu is set and skia_use_system_icu is unset, then the build system will build ICU from the source. The repository in ../externals/icu is a mirror of the Unicode Consortium's repository.

ICU requires a platform-independent data file, which it does not provide in its repository. The data file can be built by first building the ICU tools to process the provided source data, but this is a giant hassle for building ICU in a cross-platform way (which might necessitate building ICU twice).

icu/BUILD.gn has two action build rules: get_data and assemble_data. get_data downloads the icu.dat file if it is not already downloaded. The Google Cloud Storage location of the file is content-addressed with the icu_dat_md5 GN variable found in icu.gni.

assemble_data will produce either a C++ source file (for our WASM build), an object file (for our Windows builds), or a assembly file (for everything else). These files will contain a single exported symbol, icudtNN_dat which points at a block of data containing the contents of the icu.dat file.

This build also provides the SkLoadICU function, which must be called on Windows for some reason.

How To Update ICU Dependency

When we update the ICU branch, we will use the update_icu.sh script to update the icu.gni file and produce a new .dat file for upload.

  1. Edit DEPS file.

  2. Run update script:

    third_party/icu/update_icu.sh
    
  3. Upload new data file. DATA_FILE and GS_URL will be provided by the output of the previous step.

    gsutil cp DATA_FILE GS_URL
    
  4. Commit:

    git add DEPS third_party/icu/icu.gni
    git commit -m 'DEPS: update ICU'
    git push origin @:refs/for/master
    bin/sysopen https://review.skia.org/$(bin/gerrit-number @)