Skip to content

Commit

Permalink
When building Node.js, use DESTDIR to specify install location.
Browse files Browse the repository at this point in the history
In an effort to maintain parity with the official Node.js build, which
sets `node_prefix` to `/`, this takes advantage of the `DESTDIR`
variable which changes the actual installation location used by
`make install`.  Without this, it relies on the `PREFIX` which is now
explicitly set to `/`, even though it won't be installed there.

See the `install.py` script for more information, in the form of code:
https://github.com/nodejs/node/blob/2a97eb61c65e23de3cee42c7b70f845b0c3a3d09/tools/install.py#L13

/cc @benjamn
  • Loading branch information
abernix committed Aug 23, 2017
1 parent 75f7e35 commit ae36003
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/build-node-for-dev-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ then
curl -sL http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz | \
tar zx -C deps/

node_configure_flags=("--prefix=${DIR}" '--with-intl=small-icu')
node_configure_flags=(\
'--prefix=/' \
'--with-intl=small-icu' \
'--release-urlbase=https://nodejs.org/download/release/' \
)

if [ "${NODE_FROM_SRC:-}" = "debug" ]
then
Expand All @@ -57,7 +61,9 @@ then
make -j4
# PORTABLE=1 is a node hack to make npm look relative to itself instead
# of hard coding the PREFIX.
make install PORTABLE=1
# DESTDIR installs to the requested location, without using PREFIX.
# See tools/install.py in the Node source for more information.
make install PORTABLE=1 DESTDIR="${DIR}"
cd "$DIR"
else
downloadNode
Expand Down

0 comments on commit ae36003

Please sign in to comment.