From: Hirokazu MORIKAWA Date: Wed, 6 Apr 2022 01:15:20 +0000 (+0900) Subject: node-serialport-bindings: Support for npm@8 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=fb36a5226c74f8994d7882810ef29ee2f47bc47c;p=feed%2Fpackages.git node-serialport-bindings: Support for npm@8 With the upgrade of node.js to version 16, the npm version will also change to version 8. This fix is to support npm@8. npm@6 can also build without problems. Signed-off-by: Hirokazu MORIKAWA --- diff --git a/lang/node-serialport-bindings/Makefile b/lang/node-serialport-bindings/Makefile index dd19307e5e..70731e7ffd 100644 --- a/lang/node-serialport-bindings/Makefile +++ b/lang/node-serialport-bindings/Makefile @@ -8,7 +8,7 @@ PKG_NPM_SCOPE:=serialport PKG_NPM_NAME:=bindings PKG_NAME:=node-$(PKG_NPM_SCOPE)-$(PKG_NPM_NAME) PKG_VERSION:=9.0.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz PKG_SOURCE_URL:=https://registry.npmjs.org/@$(PKG_NPM_SCOPE)/$(PKG_NPM_NAME)/-/ @@ -45,8 +45,7 @@ TMPNPM:=$(shell mktemp -u XXXXXXXXXX) TARGET_CFLAGS+=$(FPIC) TARGET_CPPFLAGS+=$(FPIC) -define Build/Compile - $(MAKE_VARS) \ +NPM_FLAGS=$(MAKE_VARS) \ $(MAKE_FLAGS) \ npm_config_arch=$(NODEJS_CPU) \ npm_config_target_arch=$(NODEJS_CPU) \ @@ -54,8 +53,11 @@ define Build/Compile npm_config_nodedir=$(STAGING_DIR)/usr/ \ npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \ npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \ - npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM) \ - npm install -g $(PKG_BUILD_DIR) + npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM) + +define Build/Compile + $(NPM_FLAGS) npm i -g --production $(PKG_BUILD_DIR) --ignore-scripts + $(NPM_FLAGS) npm i --production --prefix=$(PKG_BUILD_DIR) --target_arch=$(NODEJS_CPU) --prefer-dedupe rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM) rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM) endef