0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/tools/icu
Steven R. Loomis a30839576c build: i18n: add icu config options
Make "--with-intl=none" the default and add "intl-none" option to
vcbuild.bat.

If icu data is missing print a warning unless either --download=all or
--download=icu is set. If set then automatically download, verify (MD5)
and unpack the ICU data if not already available.

There's a "list" of URLs being used, but right now only the first is
picked up. The logic works something like this:

* If there is no directory deps/icu,
  * If no zip file (currently icu4c-54_1-src.zip),
    * Download zip file (icu-project.org -> sf.net)
  * Verify the MD5 sum of the zipfile
    * If bad, print error and exit
  * Unpack the zipfile into deps/icu
* If deps/icu now exists, use it, else fail with help text

Add the configuration option "--with-icu-source=..."

Usage:
  * --with-icu-source=/path/to/my/other/icu
  * --with-icu-source=/path/to/icu54.zip
  * --with-icu-source=/path/to/icu54.tgz
  * --with-icu-source=http://example.com/icu54.tar.bz2

Add the configuration option "--with-icu-locals=...".  Allows choosing
which locales are used in the "small-icu" case.

Example:
    configure --with-intl=small-icu --with-icu-locales=tlh,grc,nl

(Also note that as of this writing, neither Klingon nor Ancient Greek
are in upstream CLDR data. Serving suggestion only.)

Don't use hard coded ../../out paths on windows. This was suggested by
@misterdjules as it causes test failures.  With this fix, "out" is no
longer created on windows and the following can run properly:

    python tools/test.py simple

Reduce space by about 1MB with ICU 54 (over without this patch). Also
trims a few other source files, but only conditional on the exact ICU
version used. This is to future-proof - a file that is unneeded now may
be needed in future ICUs.

Also:
  * Update distclean to remove icu related files
  * Refactor some code into tools/configure.d/nodedownload.py
  * Update docs
  * Add test

PR-URL: https://github.com/joyent/node/pull/8719
Fixes: https://github.com/joyent/node/issues/7676#issuecomment-64704230
[trev.norris@gmail.com small change to test's whitespace and logic]
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2015-01-02 16:51:53 -08:00
..
icu_small.json build: i18n: add icu config options 2015-01-02 16:51:53 -08:00
icu-generic.gyp build: i18n: add icu config options 2015-01-02 16:51:53 -08:00
icu-system.gyp
iculslocs.cc
icutrim.py build: i18n: add icu config options 2015-01-02 16:51:53 -08:00
no-op.cc
README.md

Notes about the icu directory.

The files in this directory were written for the node.js effort. It's the intent of their author (Steven R. Loomis / srl295) to merge them upstream into ICU, pending much discussion within the ICU-PMC.

icu_small.json is somewhat node-specific as it specifies a "small ICU" configuration file for the icutrim.py script. icutrim.py and iculslocs.cpp may themselves be superseded by components built into ICU in the future.

The following tickets were opened during this work, and their resolution may inform the reader as to the current state of icu-trim upstream:

  • #10919 (experimental branch - may copy any source patches here)
  • #10922 (data packaging improvements)
  • #10923 (rewrite data building in python)

When/if components (not including the .json file) are merged into ICU, this code and configure will be updated to detect and use those variants rather than the ones in this directory.