Skip to content

Commit 628a3ab

Browse files
committed
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 Reviewed-By: William Blankenship <william.jblankenship@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
1 parent 1f371e3 commit 628a3ab

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
@@ -340,6 +340,29 @@ doc-upload: tar
340340
scp -r out/doc/ $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/
341341
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done"
342342

343+
$(TARBALL)-headers: config.gypi release-only
344+
$(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
345+
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '$(PREFIX)'
346+
find $(TARNAME)/ -type l | xargs rm # annoying on windows
347+
tar -cf $(TARNAME)-headers.tar $(TARNAME)
348+
rm -rf $(TARNAME)
349+
gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz
350+
ifeq ($(XZ), 0)
351+
xz -c -f -$(XZ_COMPRESSION) $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.xz
352+
endif
353+
rm $(TARNAME)-headers.tar
354+
355+
tar-headers: $(TARBALL)-headers
356+
357+
tar-headers-upload: tar-headers
358+
ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)"
359+
scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz
360+
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done"
361+
ifeq ($(XZ), 0)
362+
scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz
363+
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done"
364+
endif
365+
343366
$(BINARYTAR): release-only
344367
rm -rf $(BINARYNAME)
345368
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)