Browse Source

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 <morikw2@gmail.com>
lilik-openwrt-22.03
Hirokazu MORIKAWA 4 years ago
parent
commit
e1406bba5a
2 changed files with 26 additions and 10 deletions
  1. +16
    -10
      lang/node-homebridge/Makefile
  2. +10
    -0
      lang/node-homebridge/patches/000-add_module_search_path.patch

+ 16
- 10
lang/node-homebridge/Makefile View File

@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=homebridge PKG_NPM_NAME:=homebridge
PKG_NAME:=node-$(PKG_NPM_NAME) PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=1.1.1
PKG_VERSION:=1.1.2
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz 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_BUILD_DEPENDS:=node/host
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
@ -34,16 +34,17 @@ endef
define Package/node-homebridge/description 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 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 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))))) NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
TMPNPM:=$(shell mktemp -u XXXXXXXXXX) TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
TARGET_CFLAGS+=$(FPIC) TARGET_CFLAGS+=$(FPIC)
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
endef
TARGET_CPPFLAGS+=$(FPIC)
define Build/Compile define Build/Compile
$(MAKE_VARS) \ $(MAKE_VARS) \
@ -55,14 +56,19 @@ define Build/Compile
npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \ npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \ npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM) \
npm_config_tmp=$(TMP_DIR)/npm-tmp-$(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-tmp-$(TMPNPM)
rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM) rm -rf $(TMP_DIR)/npm-cache-$(TMPNPM)
endef endef
define Package/node-homebridge/install 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 $(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node/homebridge/bin/homebridge $(1)/usr/bin/homebridge $(LN) ../lib/node/homebridge/bin/homebridge $(1)/usr/bin/homebridge
$(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/etc/init.d


+ 10
- 0
lang/node-homebridge/patches/000-add_module_search_path.patch View File

@ -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"));
}
}

Loading…
Cancel
Save