node-hid: update to 2.1.1 14351/head
authorHirokazu MORIKAWA <morikw2@gmail.com>
Mon, 28 Dec 2020 04:30:49 +0000 (13:30 +0900)
committerHirokazu MORIKAWA <morikw2@gmail.com>
Mon, 28 Dec 2020 04:30:49 +0000 (13:30 +0900)
Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
lang/node-hid/Makefile
lang/node-hid/patches/000-support_musl.patch

index e2590d8c36a4f794ca71d5c805bf858d11815dcf..008eac69f7650c7cecfdbaec5c178865a082f568 100644 (file)
@@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
 
 PKG_NPM_NAME:=node-hid
 PKG_NAME:=$(PKG_NPM_NAME)
-PKG_VERSION:=1.3.2
+PKG_VERSION:=2.1.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
-PKG_HASH:=dce3ff3380d2ad66078ba77498e49693582437ba94bb84229f146e893fa4ed9a
+PKG_HASH:=6c1f05935215feed4e8d2f4aecf31abbad8fa783d252b0bd6041ed2f2e96e9ba
 
 PKG_BUILD_DEPENDS:=node/host
 PKG_USE_MIPS16:=0
@@ -31,8 +31,8 @@ define Package/node-hid
   SECTION:=lang
   CATEGORY:=Languages
   TITLE:=Node.js package to access HID devices
-  URL:=https://github.com/node-hid/node-hid
-  DEPENDS:=+node +node-npm +libusb-1.0 +hidapi +libudev $(ICONV_DEPENDS)
+  URL:=https://www.npmjs.com/package/node-hid
+  DEPENDS:=+node +node-npm +libusb-1.0 +libudev $(ICONV_DEPENDS)
 endef
 
 define Package/node-hid/description
@@ -49,7 +49,7 @@ TARGET_CFLAGS+=$(FPIC) -I$(STAGING_DIR)/usr/include/libusb-1.0
 TARGET_LDFLAGS+=$(if $(ICONV_FULL),-liconv)
 
 define Build/Compile
-       git init $(PKG_BUILD_DIR)
+       GYP_DEFINES='driver="hidraw"' \
        $(MAKE_VARS) \
        $(MAKE_FLAGS) \
        npm_config_arch=$(NODEJS_CPU) \
@@ -66,9 +66,7 @@ endef
 
 define Package/node-hid/install
        $(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME)
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,*.md} \
-               $(1)/usr/lib/node/$(PKG_NPM_NAME)/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{binding.gyp,*.js} \
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{package.json,*.md,*.js} \
                $(1)/usr/lib/node/$(PKG_NPM_NAME)/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,src} \
                $(1)/usr/lib/node/$(PKG_NPM_NAME)/
@@ -76,7 +74,7 @@ define Package/node-hid/install
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/build/Release/HID*.node \
                $(1)/usr/lib/node/$(PKG_NPM_NAME)/build/Release/
        $(INSTALL_DIR) $(1)/usr/bin
-       $(LN) ../lib/node/node-hid/src/show-devices.js $(1)/usr/bin/hid-showdevices
+       $(LN) ../lib/node/$(PKG_NPM_NAME)/src/show-devices.js $(1)/usr/bin/hid-showdevices
 endef
 
 $(eval $(call BuildPackage,node-hid))
index 9f1d04497f9f0b6d41e2c6896a3eeb5ae3a52ed4..89b35691ca329d4c5348e0772b6028e848ab2e35 100644 (file)
@@ -1,6 +1,5 @@
-diff -urN a/hidapi/linux/hid.c b/hidapi/linux/hid.c
---- a/hidapi/linux/hid.c       1985-10-26 17:15:00.000000000 +0900
-+++ b/hidapi/linux/hid.c       2019-12-12 11:15:11.164454207 +0900
+--- a/hidapi/linux/hid.c
++++ b/hidapi/linux/hid.c
 @@ -24,6 +24,7 @@
  /* C */
  #include <stdio.h>