summaryrefslogtreecommitdiffstats
path: root/package/nodejs
diff options
context:
space:
mode:
authorMartin Bark <martin@barkynet.com>2015-07-02 10:43:27 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-04 14:38:44 +0200
commitc50256b6d2c4357cfea39350fa6f5496995e200d (patch)
tree850295294cc05b3b4386798425a184e6828a6b9e /package/nodejs
parentc72b8eaf21f5dc7c7cb8095357c542acb86bb356 (diff)
downloadbuildroot-c50256b6d2c4357cfea39350fa6f5496995e200d.tar.gz
buildroot-c50256b6d2c4357cfea39350fa6f5496995e200d.zip
package/nodejs: Define NPM command for other packages to use
Other nodejs-related packages will need to call npm with the same set of arguments as is currently used by the nodejs package itself. To avoid duplicating this code, set the NPM variable so those packages can re-use it. Signed-off-by: Martin Bark <martin@barkynet.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/nodejs')
-rw-r--r--package/nodejs/nodejs.mk18
1 files changed, 10 insertions, 8 deletions
diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 156b151bee..414f3f3d49 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -95,6 +95,15 @@ NODEJS_MODULES_LIST= $(call qstrip,\
$(if $(BR2_PACKAGE_NODEJS_MODULES_COFFEESCRIPT),coffee-script) \
$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL))
+# Define NPM for other packages to use
+NPM = $(TARGET_CONFIGURE_OPTS) \
+ LD="$(TARGET_CXX)" \
+ npm_config_arch=$(NODEJS_CPU) \
+ npm_config_target_arch=$(NODEJS_CPU) \
+ npm_config_build_from_source=true \
+ npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \
+ $(HOST_DIR)/usr/bin/npm
+
#
# We can only call NPM if there's something to install.
#
@@ -104,14 +113,7 @@ define NODEJS_INSTALL_MODULES
# npm install call below and setting npm_config_rollback=false can both
# help in diagnosing the problem.
(cd $(TARGET_DIR)/usr/lib && mkdir -p node_modules && \
- $(TARGET_CONFIGURE_OPTS) \
- LD="$(TARGET_CXX)" \
- npm_config_arch=$(NODEJS_CPU) \
- npm_config_target_arch=$(NODEJS_CPU) \
- npm_config_build_from_source=true \
- npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \
- $(HOST_DIR)/usr/bin/npm install \
- $(NODEJS_MODULES_LIST) \
+ $(NPM) install $(NODEJS_MODULES_LIST) \
)
# Symlink all executables in $(TARGET_DIR)/usr/lib/node_modules/.bin to
OpenPOWER on IntegriCloud