node-*: support for npm@8 (#414)

* node-homebridge: 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>

* Revert "node-yarn: bump to v1.22.17"

This reverts commit 38b18a50f2.

* node-yarn: 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>

* 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>

* javascript-obfuscator: bump to 2.19.0 and switch to autorelease

New version of package node-javascript-obfuscator.

Signed-off-by: Zbyněk Kocur <zbynek.kocur@fel.cvut.cz>

* node-javascript-obfuscator: 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.

The modification method is different from other node modules.
The reason is due to the npm@8 issue.
https://github.com/npm/cli/issues/4027

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>

* node-serialport: 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>

* 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>

* node-arduino-firmata: 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>

* 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 <morikw2@gmail.com>

Co-authored-by: Hirokazu MORIKAWA <morikw2@gmail.com>
Co-authored-by: Zbyněk Kocur <zbynek.kocur@fel.cvut.cz>
This commit is contained in:
Beginner 2022-05-23 22:43:07 +08:00 committed by GitHub
parent ab7de37de0
commit 5182b99701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 102 additions and 108 deletions

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=arduino-firmata
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.3.4
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
@ -42,8 +42,12 @@ TAR_OPTIONS+= --strip-components 1
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
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_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
@ -51,11 +55,14 @@ define Build/Compile
npm_config_build_from_source=true \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache \
npm_config_tmp=$(TMP_DIR)/npm-tmp \
npm install -g $(PKG_BUILD_DIR)
rm -rf $(TMP_DIR)/npm-tmp
rm -rf $(TMP_DIR)/npm-cache
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM)
define Build/Compile
$(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
define Package/node-arduino-firmata/install

View File

@ -11,7 +11,7 @@ PKG_NPM_NAME:=cylon
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_SRC_NAME:=$(PKG_NPM_NAME)-firmata
PKG_VERSION:=0.24.0
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_SRC_NAME)-$(PKG_VERSION).tgz
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)
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_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
@ -69,11 +73,14 @@ define Build/Compile
npm_config_build_from_source=true \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache \
npm_config_tmp=$(TMP_DIR)/npm-tmp \
npm install -g $(PKG_BUILD_DIR)
rm -rf $(TMP_DIR)/npm-tmp
rm -rf $(TMP_DIR)/npm-cache
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM)
define Build/Compile
$(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
define Package/node-cylon/install

View File

@ -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

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=homebridge
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=1.2.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
@ -46,8 +46,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) \
@ -55,7 +54,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_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM)
define Build/Compile
$(NPM_FLAGS) npm i -g --production $(PKG_BUILD_DIR)
$(NPM_FLAGS) npm i --production --prefix=$(PKG_BUILD_DIR) --target_arch=$(NODEJS_CPU) --prefer-dedupe
npm install -g $(PKG_BUILD_DIR)
rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM)

View File

@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=javascript-obfuscator
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=2.9.4
PKG_RELEASE:=1
PKG_VERSION:=2.19.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=db443ed7c07a7a111352dac4aa7c6edd7969f97386f37c1cfe884d5a8c5f5408
PKG_HASH:=9bc89b04c78277130bc6f699563871d211f6fc85803c874f6114a632d9456f7b
PKG_BUILD_DEPENDS:=node/host
HOST_BUILD_PARALLEL:=1
@ -50,8 +50,7 @@ HOSTTMPNPM:=$(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) \
@ -59,42 +58,51 @@ 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
cd $(PKG_BUILD_DIR); \
$(NPM_FLAGS) npm install --production --global-style --no-save --omit=dev --no-package-lock --ignore-scripts --legacy-peer-deps
rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM)
endef
define Package/node-javascript-obfuscator/install
$(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,LICENSE.BSD} \
$(CP) $(PKG_BUILD_DIR)/{package.json,LICENSE.BSD} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/README.md \
$(CP) $(PKG_BUILD_DIR)/README.md \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,bin,dist} \
$(CP) $(PKG_BUILD_DIR)/{node_modules,bin,dist} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node/javascript-obfuscator/bin/javascript-obfuscator $(1)/usr/bin/javascript-obfuscator
endef
define Host/Compile
$(HOST_MAKE_VARS) \
HOST_NPM_FLAGS=$(HOST_MAKE_VARS) \
$(HOST_MAKE_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
npm_config_target_arch=$(NODEJS_CPU) \
npm_config_build_from_source=true \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_prefix=$(HOST_INSTALL_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM) \
npm install -g --no-optional $(HOST_BUILD_DIR)
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
define Host/Compile
cd $(HOST_BUILD_DIR); \
$(HOST_NPM_FLAGS) npm install --production --global-style --no-save --omit=dev --no-package-lock --ignore-scripts --legacy-peer-deps
rm -rf $(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(HOSTTMPNPM)
endef
define Host/Install
$(INSTALL_DIR) $(1)/lib/node_modules/$(PKG_NPM_NAME)
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,LICENSE.BSD} \
$(CP) $(HOST_BUILD_DIR)/{package.json,LICENSE.BSD} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/README.md \
$(CP) $(HOST_BUILD_DIR)/README.md \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,bin,dist} \
$(CP) $(HOST_BUILD_DIR)/{node_modules,bin,dist} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/bin
$(LN) ../lib/node_modules/javascript-obfuscator/bin/javascript-obfuscator $(1)/bin/javascript-obfuscator

View File

@ -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

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=serialport
PKG_NAME:=node-$(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_NAME)/-/
@ -45,9 +45,9 @@ NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst
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) \
@ -55,8 +55,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)
$(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

View File

@ -6,24 +6,21 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=yarn
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=1.22.17
PKG_RELEASE:=1
PKG_VERSION:=1.22.10
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=267982c61119a055ba2b23d9cf90b02d3d16c202c03cb0c3a53b9633eae37249
PKG_HASH:=05a22fff30d7d8e8005bed277bf20d55111ba2bed65a6b91a0fcd1307b71fd8d
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Patrik Laszlo <alabard@gmail.com>
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Patrik Laszlo <alabard@gmail.com>, Dobroslaw Kijowski <dobo90@gmail.com>
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_HOST_ONLY:=1
HOST_BUILD_DEPENDS:=node/host
HOST_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=node/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
@ -34,6 +31,7 @@ define Package/node-yarn
TITLE:=Fast, reliable, and secure dependency management
URL:=https://yarnpkg.com/
DEPENDS:=+node
BUILDONLY:=1
endef
define Package/node-yarn/description
@ -43,68 +41,32 @@ endef
TAR_OPTIONS+= --strip-components 1
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
HOSTTMPNPM:=$(shell mktemp -u XXXXXXXXXX)
TARGET_CFLAGS+=$(FPIC)
TARGET_CPPFLAGS+=$(FPIC)
define Build/Compile
cd $(PKG_BUILD_DIR); \
$(MAKE_VARS) \
$(MAKE_FLAGS) \
HOST_NPM_FLAGS=$(HOST_MAKE_VARS) \
$(HOST_MAKE_FLAGS) \
npm_config_arch=$(NODEJS_CPU) \
npm_config_target_arch=$(NODEJS_CPU) \
npm_config_build_from_source=true \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(TMPNPM) \
npm install --production --global-style --no-save --omit=dev --no-package-lock
rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM)
rm -f $(PKG_BUILD_DIR)/node_modules/.package-lock.json
find $(PKG_BUILD_DIR)/node_modules -type d -empty -print0 | xargs -0 rmdir || true
endef
define Package/node-yarn/install
$(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
$(CP) $(PKG_BUILD_DIR)/{package.json,LICENSE} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_BUILD_DIR)/README.md \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(CP) $(PKG_BUILD_DIR)/{bin,lib} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin/yarn.js $(1)/usr/bin/yarn
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin/yarn.js $(1)/usr/bin/yarnpkg
$(INSTALL_DIR) $(1)/usr/lib/node_modules
$(LN) ../node/$(PKG_NPM_NAME) $(1)/usr/lib/node_modules/$(PKG_NPM_NAME)
endef
define Package/node-yarn/postrm
#!/bin/sh
rm /usr/lib/node_modules/yarn || true
rm -rf /usr/lib/node/yarn || true
endef
npm_config_prefix=$(HOST_INSTALL_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
define Host/Compile
cd $(HOST_BUILD_DIR); \
$(HOST_MAKE_VARS) \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(HOSTTMPNPM) \
npm install --production --global-style --no-save --omit=dev --no-package-lock
$(HOST_NPM_FLAGS) npm i -g --production $(HOST_BUILD_DIR)
$(HOST_NPM_FLAGS) npm i --production --prefix=$(HOST_BUILD_DIR) --target_arch=$(NODEJS_CPU) --prefer-dedupe
rm -rf $(TMP_DIR)/npm-tmp-$(HOSTTMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(HOSTTMPNPM)
rm -f $(HOST_BUILD_DIR)/node_modules/.package-lock.json
find $(HOST_BUILD_DIR)/node_modules -type d -empty -print0 | xargs -0 rmdir || true
endef
define Host/Install
$(INSTALL_DIR) $(1)/lib/node_modules/$(PKG_NPM_NAME)
$(CP) $(HOST_BUILD_DIR)/{package.json,LICENSE} \
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,LICENSE} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(CP) $(HOST_BUILD_DIR)/README.md \
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/README.md \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(CP) $(HOST_BUILD_DIR)/{bin,lib} \
$(CP) $(HOST_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{bin,lib} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/bin
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/yarn.js $(1)/bin/yarn