Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2019-12-07 00:40:25 +0300
committerRich Trott <rtrott@gmail.com>2019-12-14 04:54:12 +0300
commitd502b83cbdde7ecc7efb3c87503817617d7aacd1 (patch)
tree3b174c30a642ef59e0ede55717f2f2c2d193b8de /node.gypi
parente4e5a835b8ced02ca6d08d7f44826e7617ec5e9e (diff)
build: auto-load ICU data from --with-icu-default-data-dir
When compiled with `--with-intl=small` and `--with-icu-default-data-dir=PATH`, Node.js will use PATH as a fallback location for the ICU data. We will first perform an access check using fopen(PATH, 'r') to ensure that the file is readable. If it is, we'll set the icu_data_directory and proceed. There's a slight overhead for the fopen() check, but it should be barely measurable. This will be useful for Linux distribution packagers who want to be able to ship a minimal node binary in a container image but also be able to add on the full i18n support where needed. With this patch, it becomes possible to ship the interpreter as /usr/bin/node in one package for the distribution and to ship the data files in another package (without a strict dependency between the two). This means that users of the distribution will not need to explicitly direct Node.js to locate the ICU data. It also means that in environments where full internationalization is not required, they do not need to carry the extra content (with the associated storage costs). Refs: https://github.com/nodejs/node/issues/3460 Signed-off-by: Stephen Gallagher <sgallagh@redhat.com> PR-URL: https://github.com/nodejs/node/pull/30825 Reviewed-By: Steven R Loomis <srloomis@us.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'node.gypi')
-rw-r--r--node.gypi7
1 files changed, 7 insertions, 0 deletions
diff --git a/node.gypi b/node.gypi
index 6954352b5e9..b811829f4f5 100644
--- a/node.gypi
+++ b/node.gypi
@@ -103,6 +103,13 @@
'conditions': [
[ 'icu_small=="true"', {
'defines': [ 'NODE_HAVE_SMALL_ICU=1' ],
+ 'conditions': [
+ [ 'icu_default_data!=""', {
+ 'defines': [
+ 'NODE_ICU_DEFAULT_DATA_DIR="<(icu_default_data)"',
+ ],
+ }],
+ ],
}]],
}],
[ 'node_no_browser_globals=="true"', {