Skip to content

Commit d8f260d

Browse files
rvaggFishrock123
authored andcommitted
build: add tar-headers target for headers-only tar
to replace the full src download by node-gyp, using the proper format instead of the full source format PR-URL: #1975 PORT-PR-URL: #2101 PORT-FROM: 628a3ab Reviewed-By: William Blankenship <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent 83ee07b commit d8f260d

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

Makefile

+23
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,29 @@ doc-upload: tar
352352
scp -r out/doc/ $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/
353353
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done"
354354

355+
$(TARBALL)-headers: config.gypi release-only
356+
$(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
357+
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '$(PREFIX)'
358+
find $(TARNAME)/ -type l | xargs rm # annoying on windows
359+
tar -cf $(TARNAME)-headers.tar $(TARNAME)
360+
rm -rf $(TARNAME)
361+
gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
362+
ifeq ($(XZ), 0)
363+
xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
364+
endif
365+
rm $(TARNAME)-headers.tar
366+
367+
tar-headers: $(TARBALL)-headers
368+
369+
tar-headers-upload: tar-headers
370+
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
371+
scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
372+
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
373+
ifeq ($(XZ), 0)
374+
scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
375+
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
376+
endif
377+
355378
$(BINARYTAR): release-only
356379
rm -rf $(BINARYNAME)
357380
rm -rf out/deps out/Release

tools/install.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def files(action):
156156

157157
if 'true' == variables.get('node_install_npm'): npm_files(action)
158158

159+
headers(action)
160+
161+
def headers(action):
159162
action([
160163
'common.gypi',
161164
'config.gypi',
@@ -178,7 +181,6 @@ def files(action):
178181
subdir_files('deps/openssl/config/archs', 'include/node/openssl/archs', action)
179182
action(['deps/openssl/config/opensslconf.h'], 'include/node/openssl/')
180183

181-
182184
if 'false' == variables.get('node_shared_zlib'):
183185
action([
184186
'deps/zlib/zconf.h',
@@ -207,8 +209,14 @@ def run(args):
207209
install_path = dst_dir + node_prefix + '/'
208210

209211
cmd = args[1] if len(args) > 1 else 'install'
210-
if cmd == 'install': return files(install)
211-
if cmd == 'uninstall': return files(uninstall)
212+
213+
if os.environ.get('HEADERS_ONLY'):
214+
if cmd == 'install': return headers(install)
215+
if cmd == 'uninstall': return headers(uninstall)
216+
else:
217+
if cmd == 'install': return files(install)
218+
if cmd == 'uninstall': return files(uninstall)
219+
212220
raise RuntimeError('Bad command: %s\n' % cmd)
213221

214222
if __name__ == '__main__':

0 commit comments

Comments
 (0)