Skip to content

Commit 32478ac

Browse files
committed
build: unix install node and dep library headers
Restores functionality from v0.8 where module authors may not be relying on gyp for building their modules.
1 parent 2a741f2 commit 32478ac

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tools/install.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ def npm_files(action):
118118
else:
119119
assert(0) # unhandled action type
120120

121+
def subdir_files(path, dest, action):
122+
ret = {}
123+
for dirpath, dirnames, filenames in os.walk(path):
124+
files = [dirpath + '/' + f for f in filenames if f.endswith('.h')]
125+
ret[dest + dirpath.replace(path, '')] = files
126+
for subdir, files in ret.items():
127+
action(files, subdir + '/')
128+
121129
def files(action):
122130
action(['out/Release/node'], 'bin/node')
123131

@@ -133,6 +141,34 @@ def files(action):
133141

134142
if 'true' == variables.get('node_install_npm'): npm_files(action)
135143

144+
action([
145+
'config.gypi',
146+
'src/node.h',
147+
'src/node_buffer.h',
148+
'src/node_internals.h',
149+
'src/node_object_wrap.h',
150+
'src/node_version.h',
151+
], 'include/node/')
152+
153+
if 'false' == variables.get('node_shared_cares'):
154+
subdir_files('deps/cares/include', 'include/node/', action)
155+
156+
if 'false' == variables.get('node_shared_libuv'):
157+
subdir_files('deps/uv/include', 'include/node/', action)
158+
159+
if 'false' == variables.get('node_shared_openssl'):
160+
action(['deps/openssl/config/opensslconf.h'], 'include/node/openssl/')
161+
subdir_files('deps/openssl/include/openssl', 'include/node/openssl/', action)
162+
163+
if 'false' == variables.get('node_shared_v8'):
164+
subdir_files('deps/v8/include', 'include/node/', action)
165+
166+
if 'false' == variables.get('node_shared_zlib'):
167+
action([
168+
'deps/zlib/zconf.h',
169+
'deps/zlib/zlib.h',
170+
], 'include/node/')
171+
136172
def run(args):
137173
global dst_dir, node_prefix, target_defaults, variables
138174

0 commit comments

Comments
 (0)