Use externally defined npm if provided

This is useful for cross-compilation because the real npm command will also be
given parameters as target cpu, etc.
parent d1e1c139
Pipeline #10541 waiting for manual action with stages
......@@ -6,7 +6,7 @@
# Requires the following dependencies:
# * Python 2.7 (build only)
# * NodeJS >=10.x (build and runtime)
# * npm (build only)
# * $(NPM) (build only)
# * Rust (build only)
# Following parameters may be provided:
......@@ -94,7 +94,7 @@ index.html: $(call nodedep,duniter-ui) $(addprefix node_modules/,$(leveldown.COM
node_modules/%.node: $(call nodedep,nw-gyp) $(call nodedep,nw)
@$(if $($(call simplename,$@).PREPARE),$($(call simplename,$@).PREPARE))
@PATH=$(shell npm bin):${PATH} node-pre-gyp \
@PATH=$(shell $(NPM) bin):${PATH} node-pre-gyp \
-C node_modules/$(call simplename,$@) \
--runtime=node-webkit \
--target=$(NW_VERSION) \
......@@ -105,17 +105,17 @@ node_modules/%.node: $(call nodedep,nw-gyp) $(call nodedep,nw)
@cp "node_modules/$(call simplename,$@)/$($(call simplename,$@).INTERMEDIATE)/$(notdir $@)" "$@"
node_modules/%/package.json: | node_modules
@NEON_BUILD_RELEASE="true" npm add $*$($*.VERSION)
@NEON_BUILD_RELEASE="true" $(NPM) add $*$($*.VERSION)
@npm uninstall husky
@NEON_BUILD_RELEASE="true" npm install
@$(NPM) uninstall husky
@NEON_BUILD_RELEASE="true" $(NPM) install
# Wipe the delivery result
.PHONY: wipe
@npm uninstall nw-gyp
@PATH=$(shell npm bin):${PATH} npm prune --production
@$(NPM) uninstall nw-gyp
@PATH=$(shell $(NPM) bin):${PATH} $(NPM) prune --production
@find -name "*.ts" ! -name "*.d.ts" -delete
ifneq ($(ADD_DEBUG),Y)
@find -name "*.d.ts" -delete -o -name "*" -delete
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment