Merge branch 'binary-tarballs' into v0.8

This commit is contained in:
Nathan Rajlich 2012-08-06 12:25:45 -07:00
commit a23df7710a
3 changed files with 79 additions and 31 deletions

View File

@ -192,8 +192,20 @@ docclean:
-rm -rf out/doc
VERSION=v$(shell $(PYTHON) tools/getnodeversion.py)
PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
ifeq ($(DESTCPU),x64)
ARCH=x86_64
else
ifeq ($(DESTCPU),ia32)
ARCH=i386
else
ARCH=$(shell uname -m)
endif
endif
TARNAME=node-$(VERSION)
TARBALL=$(TARNAME).tar.gz
BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
BINARYTAR=$(BINARYNAME).tar.gz
PKG=out/$(TARNAME).pkg
packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
@ -201,30 +213,7 @@ dist: doc $(TARBALL) $(PKG)
PKGDIR=out/dist-osx
pkg: $(PKG)
$(PKG):
rm -rf $(PKGDIR)
rm -rf out/deps out/Release
./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32
$(MAKE) install V=$(V)
rm -rf out/deps out/Release
./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
$(MAKE) install V=$(V)
SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
lipo $(PKGDIR)/32/usr/local/bin/node \
$(PKGDIR)/usr/local/bin/node \
-output $(PKGDIR)/usr/local/bin/node-universal \
-create
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
rm -rf $(PKGDIR)/32
$(packagemaker) \
--id "org.nodejs.Node" \
--doc tools/osx-pkg.pmdoc \
--out $(PKG)
SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
$(TARBALL): node doc
release-only:
@if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
exit 0 ; \
else \
@ -245,6 +234,31 @@ $(TARBALL): node doc
echo "" >&2 ; \
exit 1 ; \
fi
pkg: $(PKG)
$(PKG): release-only
rm -rf $(PKGDIR)
rm -rf out/deps out/Release
./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32
$(MAKE) install V=$(V)
rm -rf out/deps out/Release
./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
$(MAKE) install V=$(V)
SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
lipo $(PKGDIR)/32/usr/local/bin/node \
$(PKGDIR)/usr/local/bin/node \
-output $(PKGDIR)/usr/local/bin/node-universal \
-create
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
rm -rf $(PKGDIR)/32
$(packagemaker) \
--id "org.nodejs.Node" \
--doc tools/osx-pkg.pmdoc \
--out $(PKG)
SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
$(TARBALL): release-only node doc
git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
mkdir -p $(TARNAME)/doc/api
cp doc/node.1 $(TARNAME)/doc/node.1
@ -256,6 +270,22 @@ $(TARBALL): node doc
rm -rf $(TARNAME)
gzip -f -9 $(TARNAME).tar
tar: $(TARBALL)
$(BINARYTAR): release-only
rm -rf $(BINARYNAME)
rm -rf out/deps out/Release
./configure --prefix=/ --without-snapshot --dest-cpu=$(DESTCPU)
$(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
cp README.md $(BINARYNAME)
cp LICENSE $(BINARYNAME)
cp ChangeLog $(BINARYNAME)
tar -cf $(BINARYNAME).tar $(BINARYNAME)
rm -rf $(BINARYNAME)
gzip -f -9 $(BINARYNAME).tar
binary: $(BINARYTAR)
dist-upload: $(TARBALL) $(PKG)
ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION)
scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL)
@ -280,4 +310,4 @@ cpplint:
lint: jslint cpplint
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean
.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only

View File

@ -8,6 +8,14 @@ Windows x64 Installer: http://nodejs.org/dist/__VERSION__/x64/node-__VERSION__-x
Windows x64 Files: http://nodejs.org/dist/__VERSION__/x64/
Linux 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-i686.tar.gz
Linux 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-x86_64.tar.gz
Solaris 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-i386.tar.gz
Solaris 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-x86_64.tar.gz
Other release files: http://nodejs.org/dist/__VERSION__/
Website: http://nodejs.org/docs/__VERSION__/

View File

@ -91,7 +91,9 @@ def waf_files(action):
'tools/wafadmin/Scripting.py',
'tools/wafadmin/TaskGen.py',
'tools/wafadmin/Task.py',
'tools/wafadmin/Tools/ar.py',
'tools/wafadmin/Utils.py'],
'lib/node/wafadmin/')
action(['tools/wafadmin/Tools/ar.py',
'tools/wafadmin/Tools/cc.py',
'tools/wafadmin/Tools/ccroot.py',
'tools/wafadmin/Tools/compiler_cc.py',
@ -123,12 +125,11 @@ def waf_files(action):
'tools/wafadmin/Tools/unittestw.py',
'tools/wafadmin/Tools/winres.py',
'tools/wafadmin/Tools/xlc.py',
'tools/wafadmin/Tools/xlcxx.py',
'tools/wafadmin/Utils.py'],
'lib/node/')
'tools/wafadmin/Tools/xlcxx.py'],
'lib/node/wafadmin/Tools/')
def update_shebang(path, shebang):
print 'updating shebang of %s' % path
print 'updating shebang of %s to %s' % (path, shebang)
s = open(path, 'r').read()
s = re.sub(r'#!.*\n', '#!' + shebang + '\n', s)
open(path, 'w').write(s)
@ -153,7 +154,16 @@ def npm_files(action):
action([link_path], 'bin/npm')
elif action == install:
try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path)
update_shebang(link_path, node_prefix + '/bin/node')
if os.environ['PORTABLE']:
# This crazy hack is necessary to make the shebang execute the copy
# of node relative to the same directory as the npm script. The precompiled
# binary tarballs use a prefix of "/" which gets translated to "/bin/node"
# in the regular shebang modifying logic, which is incorrect since the
# precompiled bundle should be able to be extracted anywhere and "just work"
shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"'
else:
shebang = os.path.join(node_prefix, 'bin/node')
update_shebang(link_path, shebang)
else:
assert(0) # unhandled action type