aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorHirokazu MORIKAWA <morikw2@gmail.com>2022-04-06 10:10:30 +0900
committerRosen Penev <rosenp@gmail.com>2022-04-16 11:01:24 -0700
commit3e3b44b86802aa1baf2b3e67e963fe8240d53d25 (patch)
treeb6c7547ddc80ae3a0f0284247c3e58739b85d7c2 /lang
parent5c5fa73db1fee8da15d9a5bea75173b2c1c83068 (diff)
node-hid: 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 <morikw2@gmail.com>
Diffstat (limited to 'lang')
-rw-r--r--lang/node-hid/Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/lang/node-hid/Makefile b/lang/node-hid/Makefile
index 008eac69f..ae9c77936 100644
--- a/lang/node-hid/Makefile
+++ b/lang/node-hid/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=node-hid
PKG_NAME:=$(PKG_NPM_NAME)
PKG_VERSION:=2.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
@@ -48,9 +48,7 @@ TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
TARGET_CFLAGS+=$(FPIC) -I$(STAGING_DIR)/usr/include/libusb-1.0
TARGET_LDFLAGS+=$(if $(ICONV_FULL),-liconv)
-define Build/Compile
- GYP_DEFINES='driver="hidraw"' \
- $(MAKE_VARS) \
+NPM_FLAGS=$(MAKE_VARS) \
$(MAKE_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
npm_config_target_arch=$(NODEJS_CPU) \
@@ -58,8 +56,12 @@ 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
+ GYP_DEFINES='driver="hidraw"' \
+ $(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