mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
build: Sign pkg installer for OS X
This makes the installer work on Mountain Lion.
This commit is contained in:
parent
37537d5720
commit
2dd710e7ea
5
Makefile
5
Makefile
@ -3,6 +3,7 @@
|
|||||||
BUILDTYPE ?= Release
|
BUILDTYPE ?= Release
|
||||||
PYTHON ?= python
|
PYTHON ?= python
|
||||||
DESTDIR ?=
|
DESTDIR ?=
|
||||||
|
SIGN ?=
|
||||||
|
|
||||||
# Default to verbose builds.
|
# Default to verbose builds.
|
||||||
# To do quiet/pretty builds, run `make V=` to set V to an empty string,
|
# To do quiet/pretty builds, run `make V=` to set V to an empty string,
|
||||||
@ -210,6 +211,7 @@ $(PKG):
|
|||||||
rm -rf out/deps out/Release
|
rm -rf out/deps out/Release
|
||||||
./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
|
./configure --prefix=$(PKGDIR)/usr/local --without-snapshot --dest-cpu=x64
|
||||||
$(MAKE) install V=$(V)
|
$(MAKE) install V=$(V)
|
||||||
|
SIGN="$(SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
|
||||||
lipo $(PKGDIR)/32/usr/local/bin/node \
|
lipo $(PKGDIR)/32/usr/local/bin/node \
|
||||||
$(PKGDIR)/usr/local/bin/node \
|
$(PKGDIR)/usr/local/bin/node \
|
||||||
-output $(PKGDIR)/usr/local/bin/node-universal \
|
-output $(PKGDIR)/usr/local/bin/node-universal \
|
||||||
@ -217,9 +219,10 @@ $(PKG):
|
|||||||
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
|
mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node
|
||||||
rm -rf $(PKGDIR)/32
|
rm -rf $(PKGDIR)/32
|
||||||
$(packagemaker) \
|
$(packagemaker) \
|
||||||
--id "org.nodejs.NodeJS-$(VERSION)" \
|
--id "org.nodejs.Node" \
|
||||||
--doc tools/osx-pkg.pmdoc \
|
--doc tools/osx-pkg.pmdoc \
|
||||||
--out $(PKG)
|
--out $(PKG)
|
||||||
|
SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
|
||||||
|
|
||||||
$(TARBALL): node doc
|
$(TARBALL): node doc
|
||||||
@if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
|
@if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
|
||||||
|
12
tools/osx-codesign.sh
Normal file
12
tools/osx-codesign.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! [ -n "$SIGN" ] && [ $STEP -eq 1 ]; then
|
||||||
|
echo "No SIGN environment var. Skipping codesign." >&2
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
codesign -s "$SIGN" "$PKGDIR"/usr/local/bin/node
|
||||||
|
codesign -s "$SIGN" "$PKGDIR"/32/usr/local/bin/node
|
12
tools/osx-productsign.sh
Normal file
12
tools/osx-productsign.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if ! [ -n "$SIGN" ]; then
|
||||||
|
echo "No SIGN environment var. Skipping codesign." >&2
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
productsign --sign "$SIGN" "$PKG" "$PKG"-SIGNED
|
||||||
|
mv "$PKG"-SIGNED "$PKG"
|
Loading…
Reference in New Issue
Block a user