Skip to content

Commit

Permalink
Make node-gyp look for headers in dev_bundle/include/node.
Browse files Browse the repository at this point in the history
Thanks to @abernix for identifying this solution to the duplication
between dev_bundle/include/node and dev_bundle/.node-gyp/*/node.
  • Loading branch information
benjamn committed Aug 22, 2017
1 parent 857841c commit 67b76ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions scripts/generate-dev-bundle.sh
Expand Up @@ -68,6 +68,15 @@ which node
which npm
npm version

# Make node-gyp use Node headers and libraries from $DIR/include/node.
export HOME="$DIR"
export USERPROFILE="$DIR"
export npm_config_nodedir="$DIR"

INCLUDE_PATH="${DIR}/include/node"
echo "Contents of ${INCLUDE_PATH}:"
ls -al "$INCLUDE_PATH"

# When adding new node modules (or any software) to the dev bundle,
# remember to update LICENSE.txt! Also note that we include all the
# packages that these depend on, so watch out for new dependencies when
Expand Down Expand Up @@ -115,15 +124,6 @@ cp -R node_modules/* "${DIR}/lib/node_modules/"
# commands like node-gyp and node-pre-gyp.
cp -R node_modules/.bin "${DIR}/lib/node_modules/"

# Make node-gyp install Node headers and libraries in $DIR/.node-gyp/.
# https://github.com/nodejs/node-gyp/blob/4ee31329e0/lib/node-gyp.js#L52
export HOME="$DIR"
export USERPROFILE="$DIR"
node "${DIR}/lib/node_modules/node-gyp/bin/node-gyp.js" install
INCLUDE_PATH="${DIR}/.node-gyp/${NODE_VERSION}/include/node"
echo "Contents of ${INCLUDE_PATH}:"
ls -al "$INCLUDE_PATH"

cd "${DIR}/lib"

# Clean up some bulky stuff.
Expand Down
4 changes: 2 additions & 2 deletions tools/cli/dev-bundle-bin-helpers.js
Expand Up @@ -100,8 +100,8 @@ exports.getEnv = function (options) {
}

// This allows node-gyp to find Node headers and libraries in
// dev_bundle/.node-gyp.
env.USERPROFILE = devBundleDir;
// dev_bundle/include/node.
env.NPM_CONFIG_NODEDIR = devBundleDir;

var PATH = env.PATH || env.Path;
if (PATH) {
Expand Down

0 comments on commit 67b76ab

Please sign in to comment.