Skip to content

Commit f769d13

Browse files
srl295trevnorris
authored andcommitted
build: i18n: move noisy variables to separate gypi
Fixes: nodejs/node-v0.x-archive#7676 (comment) Reviewed-by: Trevor Norris <[email protected]>
1 parent 640ad63 commit f769d13

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ deps/zlib/zlib.target.mk
6868

6969
# test artifacts
7070
tools/faketime
71+
icu_config.gypi

configure

+24-9
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,14 @@ def configure_winsdk(o):
691691
print('ctrpp not found in WinSDK path--using pre-gen files '
692692
'from tools/msvs/genfiles.')
693693

694+
def write(filename, data):
695+
filename = os.path.join(root_dir, filename)
696+
print 'creating ', filename
697+
f = open(filename, 'w+')
698+
f.write(data)
699+
700+
do_not_edit = '# Do not edit. Generated by the configure script.\n'
701+
694702
def glob_to_var(dir_base, dir_sub):
695703
list = []
696704
dir_all = os.path.join(dir_base, dir_sub)
@@ -703,8 +711,18 @@ def glob_to_var(dir_base, dir_sub):
703711
break
704712
return list
705713

706-
707714
def configure_intl(o):
715+
icu_config = {
716+
'variables': {}
717+
}
718+
icu_config_name = 'icu_config.gypi'
719+
def write_config(data, name):
720+
return
721+
722+
# write an empty file to start with
723+
write(icu_config_name, do_not_edit +
724+
pprint.pformat(icu_config, indent=2) + '\n')
725+
708726
# small ICU is off by default.
709727
# always set icu_small, node.gyp depends on it being defined.
710728
o['variables']['icu_small'] = b(False)
@@ -821,7 +839,10 @@ def configure_intl(o):
821839
for i in icu_src:
822840
var = 'icu_src_%s' % i
823841
path = '../../deps/icu/source/%s' % icu_src[i]
824-
o['variables'][var] = glob_to_var('tools/icu', path)
842+
icu_config['variables'][var] = glob_to_var('tools/icu', path)
843+
# write updated icu_config.gypi with a bunch of paths
844+
write(icu_config_name, do_not_edit +
845+
pprint.pformat(icu_config, indent=2) + '\n')
825846
return # end of configure_intl
826847

827848
# determine the "flavor" (operating system) we're building for,
@@ -860,13 +881,7 @@ output = {
860881
}
861882
pprint.pprint(output, indent=2)
862883

863-
def write(filename, data):
864-
filename = os.path.join(root_dir, filename)
865-
print 'creating ', filename
866-
f = open(filename, 'w+')
867-
f.write(data)
868-
869-
write('config.gypi', '# Do not edit. Generated by the configure script.\n' +
884+
write('config.gypi', do_not_edit +
870885
pprint.pformat(output, indent=2) + '\n')
871886

872887
config = {

tools/icu/icu-generic.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'variables': {
1010
'icu_src_derb': [ '../../deps/icu/source/tools/genrb/derb.c' ],
1111
},
12+
'includes': [ '../../icu_config.gypi' ],
1213
'targets': [
1314
{
1415
# a target to hold uconfig defines.

0 commit comments

Comments
 (0)