summaryrefslogtreecommitdiff
path: root/tools/macos-installer/pkgbuild
diff options
context:
space:
mode:
authorJP Wesselink <jpwesselink@gmail.com>2017-09-04 12:07:56 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2017-09-28 02:05:59 -0300
commit03954f778ec491fe5a4f8e42996e3edbe35554d9 (patch)
tree2617567bac0171a93406e70d2ff5f0b0fd3269c1 /tools/macos-installer/pkgbuild
parent6975c490d11d4aa937c9df6835f4e75ac8c72cee (diff)
downloadandroid-node-v8-03954f778ec491fe5a4f8e42996e3edbe35554d9.tar.gz
android-node-v8-03954f778ec491fe5a4f8e42996e3edbe35554d9.tar.bz2
android-node-v8-03954f778ec491fe5a4f8e42996e3edbe35554d9.zip
tools, build: refactor macOS installer
Creates macOS pkg installer by using `pkgbuild` and `productbuild`. Removes previous npm installation before installing npm. Packages carry correct version attributes. Support for intl installer features, defaults to `en`. Fancy formatted license. Renamed `osx` references to `macOS`. Optional installation of npm. PR-URL: https://github.com/nodejs/node/pull/15179 Fixes: https://github.com/nodejs/node/issues/15012 Refs: https://github.com/nodejs/node/pull/5656 Refs: https://github.com/nodejs/node/pull/2571 Refs: https://github.com/nodejs/node/pull/7097 Reviewed-By: Lance Ball <lball@redhat.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'tools/macos-installer/pkgbuild')
-rwxr-xr-xtools/macos-installer/pkgbuild/npm/scripts/postinstall5
-rwxr-xr-xtools/macos-installer/pkgbuild/npm/scripts/preinstall5
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/macos-installer/pkgbuild/npm/scripts/postinstall b/tools/macos-installer/pkgbuild/npm/scripts/postinstall
new file mode 100755
index 0000000000..285ce81e58
--- /dev/null
+++ b/tools/macos-installer/pkgbuild/npm/scripts/postinstall
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd /usr/local/bin || exit 1
+ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm
+ln -sf ../lib/node_modules/npm/bin/npx-cli.js npx
diff --git a/tools/macos-installer/pkgbuild/npm/scripts/preinstall b/tools/macos-installer/pkgbuild/npm/scripts/preinstall
new file mode 100755
index 0000000000..848da677b4
--- /dev/null
+++ b/tools/macos-installer/pkgbuild/npm/scripts/preinstall
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[[ -d /usr/local/lib/node_modules/npm ]] \
+ && rm -rf /usr/local/lib/node_modules/npm
+exit 0