node-hid: fix i386 build fail
authorHirokazu MORIKAWA <morikw2@gmail.com>
Wed, 17 Apr 2019 05:55:05 +0000 (14:55 +0900)
committerRosen Penev <rosenp@gmail.com>
Mon, 27 Jan 2020 04:44:02 +0000 (20:44 -0800)
more stability for parallel build

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
(cherry-picked from 1aa55f86b56766074677bcda23f19cd7e5b5601f)

lang/node-hid/Makefile

index a22fbe12d2c19d5963b951ab69dd52f4bfed81dc..390b3d2923fe1b1062cc0b316d9d3972815a483d 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NPM_NAME:=hid
 PKG_NAME:=node-$(PKG_NPM_NAME)
 PKG_VERSION:=0.7.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/node-hid/node-hid.git
@@ -43,7 +43,9 @@ endef
 
 CPU:=$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))
 
-EXTRA_CFLAGS+=$(FPIC) -I$(STAGING_DIR)/usr/include/libusb-1.0
+TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
+
+TARGET_CFLAGS+=$(FPIC) -I$(STAGING_DIR)/usr/include/libusb-1.0
 
 define Build/Compile
        git init $(PKG_BUILD_DIR)
@@ -51,7 +53,7 @@ define Build/Compile
        $(MAKE_FLAGS) \
        npm_config_arch=$(CONFIG_ARCH) \
        npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
-       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
+       npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache-$(TMPNPM) \
        PREFIX="$(PKG_INSTALL_DIR)/usr/" \
        npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
 endef