From 52939ce2fa7b1aaf4b4f649ea0c9ec26e132ee34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 12 Aug 2014 13:29:26 +0200 Subject: [PATCH] pass absolute path to npm executable --- configure | 9 +++++++++ mapboxgl.gyp | 2 +- scripts/npm_install.sh | 2 +- setup-libraries.sh | 9 +++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure b/configure index f1a39cbbc..a38c587d6 100755 --- a/configure +++ b/configure @@ -22,6 +22,11 @@ parser.add_option("--node", dest="node", help="Name of the node executable (defaults to node)") +parser.add_option("--npm", + action="store", + dest="npm", + help="Name of the npm executable (defaults to npm)") + parser.add_option("--pkg-config-root", action="store", dest="pkgconfig_root", @@ -59,6 +64,10 @@ def configure_mbgl(o): o['variables']['node'] = options.node else: o['variables']['node'] = 'node' + if options.npm: + o['variables']['npm'] = options.npm + else: + o['variables']['npm'] = 'npm' o['target_defaults']['default_configuration'] = 'Debug' if options.debug else 'Release' diff --git a/mapboxgl.gyp b/mapboxgl.gyp index 5af90fbc9..5682d7e02 100644 --- a/mapboxgl.gyp +++ b/mapboxgl.gyp @@ -49,7 +49,7 @@ 'outputs': [ 'bin/node_modules', ], - 'action': ['./scripts/npm_install.sh'] + 'action': ['./scripts/npm_install.sh', '<@(npm)'] } ], }, diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh index b6a4eef5f..7437af961 100755 --- a/scripts/npm_install.sh +++ b/scripts/npm_install.sh @@ -4,5 +4,5 @@ set -e set -o pipefail cd bin -npm install --clang=1 +$1 install --clang=1 cd ../ diff --git a/setup-libraries.sh b/setup-libraries.sh index aa0360d98..3e5e897a7 100755 --- a/setup-libraries.sh +++ b/setup-libraries.sh @@ -40,6 +40,9 @@ if [[ $MISSING_DEPS != "" ]]; then exit 1 fi +NODE=`which node` +NPM=`which npm` + if [ ! -d 'mapnik-packaging/.git' ]; then git clone --depth=1 https://github.com/mapnik/mapnik-packaging.git fi @@ -92,7 +95,8 @@ cd ../../ ./configure \ --pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal/lib/pkgconfig \ --boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libcpp-universal \ ---node=`which node` +--npm=$NPM \ +--node=$NODE elif [ ${UNAME} = 'Linux' ]; then @@ -122,5 +126,6 @@ cd ../../ ./configure \ --pkg-config-root=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-x86_64-linux/lib/pkgconfig \ --boost=`pwd`/mapnik-packaging/osx/out/build-cpp11-libstdcpp-gcc-x86_64-linux \ ---node=`which node` +--npm=$NPM \ +--node=$NODE fi