From 17217c37251dd6d3de1fb93bc0b257b9dd2cb425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Tue, 13 Jan 2015 12:51:34 +1100 Subject: [PATCH] build: create smaller build artifacts check if xz exists on the host system and use if available, which makes xz-tarballs available for distribution. also remove deps/zlib/contrib since it's not in use -- shaves additional size from the tarballs. also, slightly modify the .gitignore file to ignore these new archives. PR-URL: https://github.com/iojs/io.js/pull/319 Reviewed-By: Rod Vagg --- .gitignore | 2 +- Makefile | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index aa80271d2b..b6b7be7b96 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,7 @@ deps/openssl/openssl.target.mk deps/zlib/zlib.target.mk # build/release artifacts -/*.tar.gz +/*.tar.* /SHASUMS*.txt* /tools/wrk/wrk diff --git a/Makefile b/Makefile index 5dd5d77121..c2b46ff6e0 100644 --- a/Makefile +++ b/Makefile @@ -247,9 +247,10 @@ ifdef NIGHTLY TAG = nightly-$(NIGHTLY) TARNAME=iojs-$(VERSION)-$(TAG) endif -TARBALL=$(TARNAME).tar.gz +TARBALL=$(TARNAME).tar BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) -BINARYTAR=$(BINARYNAME).tar.gz +BINARYTAR=$(BINARYNAME).tar +XZ=$(shell which xz > /dev/null 2>&1; echo $$?) PKG=out/$(TARNAME).pkg packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker @@ -314,10 +315,15 @@ $(TARBALL): release-only $(NODE_EXE) doc cp -r out/doc/api/* $(TARNAME)/doc/api/ rm -rf $(TARNAME)/deps/v8/test # too big rm -rf $(TARNAME)/doc/images # too big + rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused find $(TARNAME)/ -type l | xargs rm # annoying on windows tar -cf $(TARNAME).tar $(TARNAME) rm -rf $(TARNAME) - gzip -f -9 $(TARNAME).tar + gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz +ifeq ($(XZ), 0) + xz -c -f -9 $(TARNAME).tar > $(TARNAME).tar.xz +endif + rm $(TARNAME).tar tar: $(TARBALL) @@ -331,7 +337,11 @@ $(BINARYTAR): release-only cp ChangeLog $(BINARYNAME) tar -cf $(BINARYNAME).tar $(BINARYNAME) rm -rf $(BINARYNAME) - gzip -f -9 $(BINARYNAME).tar + gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz +ifeq ($(XZ), 0) + xz -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.xz +endif + rm $(BINARYNAME).tar binary: $(BINARYTAR)