summaryrefslogtreecommitdiff
path: root/tools/macos-installer
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
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')
-rwxr-xr-xtools/macos-installer/pkgbuild/npm/scripts/postinstall5
-rwxr-xr-xtools/macos-installer/pkgbuild/npm/scripts/preinstall5
-rw-r--r--tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl23
-rw-r--r--tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl19
-rw-r--r--tools/macos-installer/productbuild/distribution.xml.tmpl23
5 files changed, 75 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
diff --git a/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl b/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl
new file mode 100644
index 0000000000..1157d97208
--- /dev/null
+++ b/tools/macos-installer/productbuild/Resources/en.lproj/conclusion.html.tmpl
@@ -0,0 +1,23 @@
+<html>
+ <head>
+ <style>
+ body {
+ font-family: Helvetica;
+ font-size: 14px;
+ }
+ li:last-child {
+ margin-bottom: 16px;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>This package has installed:</p>
+ <ul>
+ <li>Node.js {nodeversion} to <code>/usr/local/bin/node</code></li>
+ <li>npm {npmversion} to <code>/usr/local/bin/npm</code></li>
+ </ul>
+ <p>Make sure that <code>/usr/local/bin</code> is in your <code>$PATH</code>.</p>
+ </div>
+ </body>
+</html>
diff --git a/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl b/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl
new file mode 100644
index 0000000000..3790894e39
--- /dev/null
+++ b/tools/macos-installer/productbuild/Resources/en.lproj/welcome.html.tmpl
@@ -0,0 +1,19 @@
+<html>
+ <head>
+ <style>
+ body {
+ font-family: Helvetica;
+ font-size: 14px;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+ <p>This package will install:</p>
+ <ul>
+ <li>Node.js {nodeversion} to <code>/usr/local/bin/node</code></li>
+ <li>npm {npmversion} to <code>/usr/local/bin/npm</code></li>
+ </ul>
+ </div>
+ </body>
+</html>
diff --git a/tools/macos-installer/productbuild/distribution.xml.tmpl b/tools/macos-installer/productbuild/distribution.xml.tmpl
new file mode 100644
index 0000000000..0b9d84701b
--- /dev/null
+++ b/tools/macos-installer/productbuild/distribution.xml.tmpl
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<installer-gui-script minSpecVersion="1">
+ <title>Node.js</title>
+ <welcome file="welcome.html"/>
+ <conclusion file="conclusion.html"/>
+ <background alignment="topleft" file="osx_installer_logo.png"/>
+ <pkg-ref id="org.nodejs.node.pkg" auth="root"/>
+ <pkg-ref id="org.nodejs.npm.pkg" auth="root"/>
+ <options customize="allow" require-scripts="false"/>
+ <license file="license.rtf"/>
+ <choices-outline>
+ <line choice="org.nodejs.node.pkg" />
+ <line choice="org.nodejs.npm.pkg"/>
+ </choices-outline>
+ <choice id="org.nodejs.node.pkg" visible="true" title="Node.js {nodeversion}">
+ <pkg-ref id="org.nodejs.node.pkg"/>
+ </choice>
+ <pkg-ref id="org.nodejs.node.pkg" version="{nodeversion}" onConclusion="none">node-{nodeversion}.pkg</pkg-ref>
+ <choice id="org.nodejs.npm.pkg" visible="true" title="npm {npmversion}">
+ <pkg-ref id="org.nodejs.npm.pkg"/>
+ </choice>
+ <pkg-ref id="org.nodejs.npm.pkg" version="{npmversion}" onConclusion="none">npm-{npmversion}.pkg</pkg-ref>
+</installer-gui-script>