@nodenv/node-build 5.0.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # node-build
2
2
 
3
- [![Test](https://github.com/nodenv/node-build/workflows/Test/badge.svg)](https://github.com/nodenv/node-build/actions?query=workflow%3ATest)
3
+ [![Tests](
4
+ https://img.shields.io/github/actions/workflow/status/nodenv/node-build/test.yml?label=tests&logo=github)](
5
+ https://github.com/nodenv/node-build/actions/workflows/test.yml)
6
+ [![Latest Homebrew Release](
7
+ https://img.shields.io/homebrew/v/node-build?logo=homebrew&logoColor=white)](
8
+ https://formulae.brew.sh/formula/node-build)
9
+ [![Latest GitHub Release](
10
+ https://img.shields.io/github/v/release/nodenv/node-build?label=github&logo=github&sort=semver)](
11
+ https://github.com/nodenv/node-build/releases/latest)
12
+ [![Latest npm Release](
13
+ https://img.shields.io/npm/v/@nodenv/node-build?logo=npm&logoColor=white)](
14
+ https://www.npmjs.com/package/@nodenv/node-build/v/latest)
4
15
 
5
16
  node-build is a command-line utility that makes it easy to install virtually any
6
17
  version of Node, from source or precompiled binary.
@@ -106,29 +117,30 @@ definitions.
106
117
 
107
118
  The build process may be configured through the following environment variables:
108
119
 
109
- | Variable | Function |
110
- | ------------------------ | -------------------------------------------------------------------------------------------------- |
111
- | `TMPDIR` | Where temporary files are stored. |
112
- | `NODE_BUILD_BUILD_PATH` | Where sources are downloaded and built. (Default: a timestamped subdirectory of `TMPDIR`) |
113
- | `NODE_BUILD_CACHE_PATH` | Where to cache downloaded package files. (Default: `~/.nodenv/cache` if invoked as nodenv plugin) |
114
- | `NODE_BUILD_HTTP_CLIENT` | One of `aria2c`, `curl`, or `wget` to use for downloading. (Default: first one found in PATH) |
115
- | `NODE_BUILD_ARIA2_OPTS` | Additional options to pass to `aria2c` for downloading. |
116
- | `NODE_BUILD_CURL_OPTS` | Additional options to pass to `curl` for downloading. |
117
- | `NODE_BUILD_WGET_OPTS` | Additional options to pass to `wget` for downloading. |
118
- | `NODE_BUILD_MIRROR_CMD` | A command to construct the package mirror URL. |
119
- | `NODE_BUILD_MIRROR_URL` | Custom mirror URL root. |
120
- | `NODE_BUILD_SKIP_MIRROR` | Bypass the download mirror and fetch all package files from their original URLs. |
121
- | `NODE_BUILD_ROOT` | Custom build definition directory. (Default: `share/node-build`) |
122
- | `NODE_BUILD_DEFINITIONS` | Additional paths to search for build definitions. (Colon-separated list) |
123
- | `CC` | Path to the C compiler. |
124
- | `NODE_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). |
125
- | `CONFIGURE_OPTS` | Additional `./configure` options. |
126
- | `MAKE` | Custom `make` command (_e.g.,_ `gmake`). |
127
- | `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. |
128
- | `MAKE_INSTALL_OPTS` | Additional `make install` options. |
129
- | `NODE_CONFIGURE_OPTS` | Additional `./configure` options (applies only to Node source). |
130
- | `NODE_MAKE_OPTS` | Additional `make` options (applies only to Node source). |
131
- | `NODE_MAKE_INSTALL_OPTS` | Additional `make install` options (applies only to Node source). |
120
+ | Variable | Function |
121
+ | ------------------------------- | -------------------------------------------------------------------------------------------------- |
122
+ | `TMPDIR` | Where temporary files are stored. |
123
+ | `NODE_BUILD_BUILD_PATH` | Where sources are downloaded and built. (Default: a timestamped subdirectory of `TMPDIR`) |
124
+ | `NODE_BUILD_CACHE_PATH` | Where to cache downloaded package files. (Default: `~/.nodenv/cache` if invoked as nodenv plugin) |
125
+ | `NODE_BUILD_HTTP_CLIENT` | One of `aria2c`, `curl`, or `wget` to use for downloading. (Default: first one found in PATH) |
126
+ | `NODE_BUILD_ARIA2_OPTS` | Additional options to pass to `aria2c` for downloading. |
127
+ | `NODE_BUILD_CURL_OPTS` | Additional options to pass to `curl` for downloading. |
128
+ | `NODE_BUILD_WGET_OPTS` | Additional options to pass to `wget` for downloading. |
129
+ | `NODE_BUILD_MIRROR_CMD` | A command to construct the package mirror URL. |
130
+ | `NODE_BUILD_MIRROR_URL` | Custom mirror URL root. |
131
+ | `NODE_BUILD_MIRROR_PACKAGE_URL` | Custom complete mirror URL (e.g. http://mirror.example.com/package-1.0.0.tar.gz). |
132
+ | `NODE_BUILD_SKIP_MIRROR` | Bypass the download mirror and fetch all package files from their original URLs. |
133
+ | `NODE_BUILD_ROOT` | Custom build definition directory. (Default: `share/node-build`) |
134
+ | `NODE_BUILD_DEFINITIONS` | Additional paths to search for build definitions. (Colon-separated list) |
135
+ | `CC` | Path to the C compiler. |
136
+ | `NODE_CFLAGS` | Additional `CFLAGS` options (_e.g.,_ to override `-O3`). |
137
+ | `CONFIGURE_OPTS` | Additional `./configure` options. |
138
+ | `MAKE` | Custom `make` command (_e.g.,_ `gmake`). |
139
+ | `MAKE_OPTS` / `MAKEOPTS` | Additional `make` options. |
140
+ | `MAKE_INSTALL_OPTS` | Additional `make install` options. |
141
+ | `NODE_CONFIGURE_OPTS` | Additional `./configure` options (applies only to Node source). |
142
+ | `NODE_MAKE_OPTS` | Additional `make` options (applies only to Node source). |
143
+ | `NODE_MAKE_INSTALL_OPTS` | Additional `make install` options (applies only to Node source). |
132
144
 
133
145
  #### Applying Patches
134
146
 
@@ -158,21 +170,17 @@ definition. All definitions bundled with node-build include checksums.
158
170
 
159
171
  #### Package Mirrors
160
172
 
161
- By default, node-build downloads package files from the official URL specified in the definition file.
173
+ To speed up downloads, node-build can fetch package files from a mirror.
174
+ To benefit from this, the packages must specify their checksum:
162
175
 
163
176
  ```sh
164
177
  # example:
165
178
  install_package "node-v12.0.0" "https://nodejs.org/dist/v12.0.0/node-v12.0.0.tar.gz#<SHA2>"
166
179
  ```
167
180
 
168
- node-build will attempt to construct a mirror url by invoking `NODE_BUILD_MIRROR_CMD` with two arguments: `package_url` and `checksum`.
169
- The provided command should print the desired mirror's complete package URL.
170
- If `NODE_BUILD_MIRROR_CMD` is unset, package mirror URL construction defaults to replacing `https://nodejs.org/dist` with `NODE_BUILD_MIRROR_URL`.
171
-
172
181
  node-build will first try to fetch this package from `$NODE_BUILD_MIRROR_URL/<SHA2>`
173
- (note: this is the complete URL), where `<SHA2>` is the checksum for the file.
174
-
175
- It will fall back to downloading the package from the original location if:
182
+ (note: this is the complete URL), where `<SHA2>` is the checksum for the file. It
183
+ will fall back to downloading the package from the original location if:
176
184
  - the package was not found on the mirror;
177
185
  - the mirror is down;
178
186
  - the download is corrupt, i.e. the file's checksum doesn't match;
@@ -181,6 +189,15 @@ It will fall back to downloading the package from the original location if:
181
189
 
182
190
  You may specify a custom mirror by setting `NODE_BUILD_MIRROR_URL`.
183
191
 
192
+ If a mirror site doesn't conform to the above URL format, you can specify the
193
+ complete URL by setting `NODE_BUILD_MIRROR_PACKAGE_URL`. It behaves the same as
194
+ `NODE_BUILD_MIRROR_URL` except being a complete URL.
195
+
196
+ For more control over the construction of the mirror url, you can specify a command
197
+ by setting `NODE_BUILD_MIRROR_CMD`. node-build will invoke `NODE_BUILD_MIRROR_CMD`
198
+ with two arguments: `package_url` and `checksum`. The provided command should
199
+ print the desired mirror's complete package URL to `STDOUT`.
200
+
184
201
  #### Keeping the build directory after installation
185
202
 
186
203
  Both `node-build` and `nodenv install` accept the `-k` or `--keep` flag, which
package/bin/node-build CHANGED
@@ -15,13 +15,14 @@
15
15
  # --version Show version of node-build
16
16
  #
17
17
 
18
- NODE_BUILD_VERSION=5.0.2
18
+ NODE_BUILD_VERSION=5.1.0
19
19
 
20
20
  OLDIFS="$IFS"
21
21
 
22
22
  set -E
23
23
  exec 3<&2 # preserve original stderr at fd 3
24
24
 
25
+
25
26
  lib() {
26
27
  parse_options() {
27
28
  OPTIONS=()
@@ -92,7 +93,7 @@ os_information() {
92
93
  if type -p lsb_release >/dev/null; then
93
94
  lsb_release -sir | xargs echo
94
95
  elif type -p sw_vers >/dev/null; then
95
- echo "OS X $(sw_vers -productVersion)"
96
+ echo "$(sw_vers -productName) $(sw_vers -productVersion)"
96
97
  elif [ -r /etc/os-release ]; then
97
98
  source /etc/os-release
98
99
  echo "$NAME $VERSION_ID"
@@ -213,7 +214,11 @@ mirror() {
213
214
  local package_url="$1"
214
215
  local checksum="$2"
215
216
 
216
- echo "${package_url/https:\/\/nodejs.org\/dist/$NODE_BUILD_MIRROR_URL}"
217
+ if [ -n "$NODE_BUILD_MIRROR_URL" ]; then
218
+ echo "${package_url/https:\/\/nodejs.org\/dist/$NODE_BUILD_MIRROR_URL}"
219
+ elif [ -n "$NODE_BUILD_MIRROR_PACKAGE_URL" ]; then
220
+ echo "$NODE_BUILD_MIRROR_PACKAGE_URL"
221
+ fi
217
222
  }
218
223
 
219
224
  try_binary(){
@@ -725,11 +730,20 @@ build_package_autoconf() {
725
730
  } >&4 2>&1
726
731
  }
727
732
 
728
- build_package_copy() {
733
+ clean_prefix_path() {
729
734
  # Make sure there are no leftover files in $PREFIX_PATH
730
735
  rm -rf "$PREFIX_PATH"
731
- mkdir -p "$PREFIX_PATH"
732
- cp -fR . "$PREFIX_PATH"
736
+ }
737
+
738
+ build_package_copy_to() {
739
+ to="$1"
740
+ mkdir -p "$to"
741
+ cp -fR . "$to"
742
+ }
743
+
744
+ build_package_copy() {
745
+ clean_prefix_path
746
+ build_package_copy_to "$PREFIX_PATH"
733
747
  }
734
748
 
735
749
  build_package_jxcore_v8_328() {
@@ -1002,7 +1016,7 @@ WGET_OPTS="${NODE_BUILD_WGET_OPTS} ${IPV4+--inet4-only} ${IPV6+--inet6-only}"
1002
1016
  NODE_BUILD_MIRROR_URL="${NODE_BUILD_MIRROR_URL%/}"
1003
1017
 
1004
1018
  if ! has_checksum_support compute_sha2 ||
1005
- { [ -z "$NODE_BUILD_MIRROR_URL" ] && [ -z "$NODE_BUILD_MIRROR_CMD" ]; } then
1019
+ [ -z "$NODE_BUILD_MIRROR_URL" -a -z "$NODE_BUILD_MIRROR_CMD" -a -z "$NODE_BUILD_MIRROR_PACKAGE_URL" ]; then
1006
1020
  NODE_BUILD_SKIP_MIRROR=true
1007
1021
  fi
1008
1022
 
@@ -89,7 +89,7 @@ for option in "${OPTIONS[@]}"; do
89
89
  {
90
90
  echo
91
91
  echo "Only latest stable releases for each Node implementation are shown."
92
- echo "Use 'nodenv install --list-all' to show all local versions."
92
+ echo "Use 'nodenv install --list-all / -L' to show all local versions."
93
93
  } 1>&2
94
94
  exit
95
95
  ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodenv/node-build",
3
- "version": "5.0.2",
3
+ "version": "5.1.0",
4
4
  "description": "Install NodeJS versions",
5
5
  "homepage": "https://github.com/nodenv/node-build#readme",
6
6
  "license": "MIT",
@@ -41,10 +41,10 @@
41
41
  "preversion": "script/preversion",
42
42
  "version": "script/version-sync",
43
43
  "postversion": "git push --follow-tags",
44
- "unmerged": "git for-each-ref refs/rbenv-tags --format='%(refname)' --merged"
44
+ "unmerged": "git for-each-ref refs/rbenv-tags --format='%(refname)' --no-merged"
45
45
  },
46
46
  "devDependencies": {
47
- "@nodenv/node-build-update-defs": "^2.11.0",
47
+ "@nodenv/node-build-update-defs": "^2.11.1",
48
48
  "bats": "^1.11.0",
49
49
  "bats-assert": "jasonkarns/bats-assert-1",
50
50
  "bats-mock": "^1",
@@ -0,0 +1,10 @@
1
+ binary aix-ppc64 "https://nodejs.org/dist/v20.14.0/node-v20.14.0-aix-ppc64.tar.gz#06ac9b1f35de7b05dc0aea58b99804edf608ee500b2e9b303d1a6044eb3eeab2"
2
+ binary darwin-arm64 "https://nodejs.org/dist/v20.14.0/node-v20.14.0-darwin-arm64.tar.gz#d2148d79e9ff04d2982d00faeae942ceba488ca327a91065e528235167b9e9d6"
3
+ binary darwin-x64 "https://nodejs.org/dist/v20.14.0/node-v20.14.0-darwin-x64.tar.gz#1dcc18a199cb5f46d43ed1c3c61b87a247d1a1a11dd6b32a36a9c46ac1088f86"
4
+ binary linux-arm64 "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-arm64.tar.gz#d63e83fca4f81801396620c46a42892a2ef26e21a4508f68de373e61a12bd9c5"
5
+ binary linux-armv7l "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-armv7l.tar.gz#af45ea0d09e55a4f05c0190636532bdf9f70b2eaf0a1c4d7594207cf21284df0"
6
+ binary linux-ppc64le "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-ppc64le.tar.gz#2405a23249ddb4d2495f212255f5f5f11892fac77f9835c491b9ffaee1404078"
7
+ binary linux-s390x "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-s390x.tar.gz#74668f3e337980acf1579e31f6f9490ec28d98603bb2ff17390c115606af7806"
8
+ binary linux-x64 "https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-x64.tar.gz#5b9bf40cfc7c21de14a1b4c367650e3c96eb101156bf9368ffc2f947414b6581"
9
+
10
+ install_package "node-v20.14.0" "https://nodejs.org/dist/v20.14.0/node-v20.14.0.tar.gz#f01109d3102754ac360fcf25aa588f3bef5c090a8eed3fb1d0be194149c46cf2"