From e1406bba5acd8b0a00232b55492d0ba3694446c6 Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Thu, 27 Aug 2020 08:11:59 +0900 Subject: [PATCH] node-homebridge: update to 1.1.2 update to 1.1.2 Add opkg package path to the homebrodge plugin module path. Signed-off-by: Hirokazu MORIKAWA --- lang/node-homebridge/Makefile | 26 ++++++++++++------- .../patches/000-add_module_search_path.patch | 10 +++++++ 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 lang/node-homebridge/patches/000-add_module_search_path.patch diff --git a/lang/node-homebridge/Makefile b/lang/node-homebridge/Makefile index 748a30b86..d786f0766 100644 --- a/lang/node-homebridge/Makefile +++ b/lang/node-homebridge/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NPM_NAME:=homebridge PKG_NAME:=node-$(PKG_NPM_NAME) -PKG_VERSION:=1.1.1 +PKG_VERSION:=1.1.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz -PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/ -PKG_HASH:=ccbd9e2e199a56f3b5749bb58dfad2fd629c3bc5fc55c36cc3f870061108b883 +PKG_SOURCE_URL:=https://registry.npmjs.org/$(PKG_NPM_NAME)/-/ +PKG_HASH:=2cf7bf7334067fc1278644ff4981913517582817e6378583f2d54bcbd97a44f1 PKG_BUILD_DEPENDS:=node/host PKG_USE_MIPS16:=0 @@ -34,16 +34,17 @@ endef define Package/node-homebridge/description Homebridge is a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API + *** You need to install avahi-nodbus-daemon or avahi-dbus-daemon or umdns or mdnsd package. *** 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) TARGET_CFLAGS+=$(FPIC) - -define Build/Prepare - $(INSTALL_DIR) $(PKG_BUILD_DIR) -endef +TARGET_CPPFLAGS+=$(FPIC) define Build/Compile $(MAKE_VARS) \ @@ -55,14 +56,19 @@ define Build/Compile 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 $(DL_DIR)/$(PKG_SOURCE) + npm install -g $(PKG_BUILD_DIR) rm -rf $(TMP_DIR)/npm-tmp-$(TMPNPM) rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM) endef define Package/node-homebridge/install - $(INSTALL_DIR) $(1)/usr/lib/node - $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/ + $(INSTALL_DIR) $(1)/usr/lib/node/$(PKG_NPM_NAME) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{*.json,*.md} \ + $(1)/usr/lib/node/$(PKG_NPM_NAME)/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{node_modules,lib} \ + $(1)/usr/lib/node/$(PKG_NPM_NAME)/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/$(PKG_NPM_NAME)/{LICENSE,bin} \ + $(1)/usr/lib/node/$(PKG_NPM_NAME)/ $(INSTALL_DIR) $(1)/usr/bin $(LN) ../lib/node/homebridge/bin/homebridge $(1)/usr/bin/homebridge $(INSTALL_DIR) $(1)/etc/init.d diff --git a/lang/node-homebridge/patches/000-add_module_search_path.patch b/lang/node-homebridge/patches/000-add_module_search_path.patch new file mode 100644 index 000000000..265503627 --- /dev/null +++ b/lang/node-homebridge/patches/000-add_module_search_path.patch @@ -0,0 +1,10 @@ +--- a/lib/pluginManager.js ++++ b/lib/pluginManager.js +@@ -308,6 +308,7 @@ + else { + this.searchPaths.add("/usr/local/lib/node_modules"); + this.searchPaths.add("/usr/lib/node_modules"); ++ this.searchPaths.add("/usr/lib/node"); + this.searchPaths.add(child_process_1.execSync("/bin/echo -n \"$(npm --no-update-notifier -g prefix)/lib/node_modules\"").toString("utf8")); + } + }