node-cylon: 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>
This commit is contained in:
parent
9dc5f7e328
commit
de06db77ed
1 changed files with 14 additions and 7 deletions
|
@ -11,7 +11,7 @@ PKG_NPM_NAME:=cylon
|
||||||
PKG_NAME:=node-$(PKG_NPM_NAME)
|
PKG_NAME:=node-$(PKG_NPM_NAME)
|
||||||
PKG_SRC_NAME:=$(PKG_NPM_NAME)-firmata
|
PKG_SRC_NAME:=$(PKG_NPM_NAME)-firmata
|
||||||
PKG_VERSION:=0.24.0
|
PKG_VERSION:=0.24.0
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=4
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_SRC_NAME)-$(PKG_VERSION).tgz
|
PKG_SOURCE:=$(PKG_SRC_NAME)-$(PKG_VERSION).tgz
|
||||||
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_SRC_NAME)/-/
|
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_SRC_NAME)/-/
|
||||||
|
@ -60,8 +60,12 @@ TAR_OPTIONS+= --strip-components 1
|
||||||
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||||
|
|
||||||
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
|
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
|
||||||
|
TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
|
||||||
|
|
||||||
define Build/Compile
|
TARGET_CFLAGS+=$(FPIC)
|
||||||
|
TARGET_CPPFLAGS+=$(FPIC)
|
||||||
|
|
||||||
|
NPM_FLAGS:= \
|
||||||
$(MAKE_VARS) \
|
$(MAKE_VARS) \
|
||||||
$(MAKE_FLAGS) \
|
$(MAKE_FLAGS) \
|
||||||
npm_config_arch=$(NODEJS_CPU) \
|
npm_config_arch=$(NODEJS_CPU) \
|
||||||
|
@ -69,11 +73,14 @@ define Build/Compile
|
||||||
npm_config_build_from_source=true \
|
npm_config_build_from_source=true \
|
||||||
npm_config_nodedir=$(STAGING_DIR)/usr/ \
|
npm_config_nodedir=$(STAGING_DIR)/usr/ \
|
||||||
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
|
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
|
||||||
npm_config_cache=$(TMP_DIR)/npm-cache \
|
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
|
||||||
npm_config_tmp=$(TMP_DIR)/npm-tmp \
|
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM)
|
||||||
npm install -g $(PKG_BUILD_DIR)
|
|
||||||
rm -rf $(TMP_DIR)/npm-tmp
|
define Build/Compile
|
||||||
rm -rf $(TMP_DIR)/npm-cache
|
$(NPM_FLAGS) npm i -g --production $(PKG_BUILD_DIR)
|
||||||
|
$(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
|
endef
|
||||||
|
|
||||||
define Package/node-cylon/install
|
define Package/node-cylon/install
|
||||||
|
|
Loading…
Reference in a new issue