Skip to content

Commit

Permalink
Node.js: sync with upstream source
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
(cherry picked from commit 10c5157)
  • Loading branch information
1715173329 committed Sep 23, 2023
1 parent f35a193 commit cf68e6b
Show file tree
Hide file tree
Showing 36 changed files with 652 additions and 72 deletions.
4 changes: 2 additions & 2 deletions lang/node-argon2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=argon2
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.31.0
PKG_VERSION:=0.31.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=7189d39349947edfa467e1e54913e2f56d85622b673efcaeeb27e09a53e26a94
PKG_HASH:=31e997c2cd1896c8c0e6fc49d70cfe232ffdeceeb28e6258a532ae19a969afdb

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=MIT
Expand Down
9 changes: 8 additions & 1 deletion lang/node-aws-crt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=aws-crt
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=1.18.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
Expand Down Expand Up @@ -104,6 +104,13 @@ define Build/Compile
CROSS_COMPILE="$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-" \
TARGET_CROSS="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)" \
npm run install --no-save --no-package-lock
rm -rf $(PKG_BUILD_DIR)/node_modules
cd $(PKG_BUILD_DIR); \
$(MAKE_VARS) \
$(MAKE_FLAGS) \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
$(if $(CONFIG_NODEJS_NPM_KEEP_CACHE), npm_config_cache=$(NPM_CACHE_DIR)/npm-cache-$(PKG_NPM_NAME),npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM)) \
npm install --prefer-offline --no-audit --global-style --install-strategy=shallow --no-save --omit=dev --no-package-lock --ignore-scripts --legacy-peer-deps
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 -delete || true
Expand Down
4 changes: 2 additions & 2 deletions lang/node-aws-sdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=aws-sdk
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=2.1448.0
PKG_VERSION:=2.1462.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=47e2da83d72652074ea10e9fffdca894a39515c224706d4f7a88716dce0ebde9
PKG_HASH:=20bd7edeae7ef07f39ac09677d49e4aab26c11a7b75f4d8657c1e2840b0ddbba

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=Apache-2.0
Expand Down
3 changes: 2 additions & 1 deletion lang/node-ffi-napi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=node/host
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16
PKG_LIBFFI_VERSION:=3.4.2

include $(INCLUDE_DIR)/package.mk

Expand All @@ -44,7 +45,7 @@ NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst
TMPNPM:=$(shell mktemp -u XXXXXXXXXX)
NPM_CACHE_DIR:=$(if $(call qstrip,$(CONFIG_NODEJS_NPM_CACHE_DIR)),$(call qstrip,$(CONFIG_NODEJS_NPM_CACHE_DIR)),$(TMP_DIR))

TARGET_CFLAGS+=$(FPIC)
TARGET_CFLAGS+=$(FPIC) -I$(BUILD_DIR)/libffi-$(PKG_LIBFFI_VERSION)/$(GNU_TARGET_NAME)-gnu -I$(BUILD_DIR)/libffi-$(PKG_LIBFFI_VERSION)/$(GNU_TARGET_NAME)-$(TARGET_SUFFIX)
TARGET_CPPFLAGS+=$(FPIC)

define Build/Compile
Expand Down
4 changes: 2 additions & 2 deletions lang/node-ffmpeg-for-homebridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=ffmpeg-for-homebridge
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.1.4
PKG_VERSION:=2.1.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=6e9d496d8845a2200f10f55a33930c7cccc9ad00ddaa47394fecf22aa159558f
PKG_HASH:=922887c30d4e57efdfb2e1672797280346bf0043dda46fb86c5632c294f4861f

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- a/package.json
+++ b/package.json
@@ -31,9 +31,5 @@
@@ -37,8 +37,5 @@
"h264_omx"
],
"dependencies": {
- "detect-libc": "^2.0.1",
- "dotenv": "^16.0.1",
- "dotenv": "^16.3.1",
- "simple-get": "^4.0.1",
- "tar": "^6.1.11"
- "tar": "^6.2.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
--- a/index.js
+++ b/index.js
@@ -1,10 +1,11 @@
'use strict';
"use strict";

-const os = require('os');
-const path = require('path');
+// const os = require('os');
+// const path = require('path');
const fs = require('fs');
const os = require("os");
-const path = require("path");
-const fs = require("fs");
+// const path = require("path");
+// const fs = require("fs");

-const ffmpegPath = path.resolve(__dirname, os.platform() === 'win32' ? 'ffmpeg.exe' : 'ffmpeg');
+// const ffmpegPath = path.resolve(__dirname, os.platform() === 'win32' ? 'ffmpeg.exe' : 'ffmpeg');
-const ffmpegPath = path.resolve(__dirname, os.platform() === "win32" ? "ffmpeg.exe" : "ffmpeg");
+// const ffmpegPath = path.resolve(__dirname, os.platform() === "win32" ? "ffmpeg.exe" : "ffmpeg");
+const ffmpegPath = '/usr/bin/ffmpeg';

if (fs.existsSync(ffmpegPath)) {
module.exports = ffmpegPath;

111 changes: 111 additions & 0 deletions lang/node-gyp-build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=node-gyp-build
PKG_NAME:=$(PKG_NPM_NAME)
PKG_VERSION:=4.6.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=b34dddd54327fe46e3e868b79cbce6b57988c735f4986201e11ca1c7656140bf

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE

HOST_BUILD_DEPENDS:=node/host
HOST_BUILD_PARALLEL:=1

PKG_BUILD_DEPENDS:=node/host
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=no-mips16

include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk

define Package/node-gyp-build
SUBMENU:=Node.js
SECTION:=lang
CATEGORY:=Languages
TITLE:=Build tool and bindings loader for node-gyp that supports prebuilds
URL:=https://www.npmjs.com/package/node-gyp-build
DEPENDS:=+node
endef

define Package/node-gyp-build/description
Build tool and bindings loader for node-gyp that supports prebuilds
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)
NPM_CACHE_DIR:=$(if $(call qstrip,$(CONFIG_NODEJS_NPM_CACHE_DIR)),$(call qstrip,$(CONFIG_NODEJS_NPM_CACHE_DIR)),$(TMP_DIR))

TARGET_CFLAGS+=$(FPIC)
TARGET_CPPFLAGS+=$(FPIC)

define Build/Compile
cd $(PKG_BUILD_DIR); \
$(MAKE_VARS) \
$(MAKE_FLAGS) \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
$(if $(CONFIG_NODEJS_NPM_KEEP_CACHE), npm_config_cache=$(NPM_CACHE_DIR)/npm-cache-$(PKG_NPM_NAME),npm_config_cache=$(TMP_DIR)/npm-cache-$(TMPNPM)) \
npm install --prefer-offline --no-audit --global-style --install-strategy=shallow --no-save --omit=dev --no-package-lock --ignore-scripts
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-gyp-build/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)/{*.js,*.md} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin.js $(1)/usr/bin/node-gyp-build
$(LN) ../lib/node/$(PKG_NPM_NAME)/optional.js $(1)/usr/bin/node-gyp-build-optional
$(LN) ../lib/node/$(PKG_NPM_NAME)/build-test.js $(1)/usr/bin/node-gyp-build-test
$(INSTALL_DIR) $(1)/usr/lib/node_modules
$(LN) ../node/$(PKG_NPM_NAME) $(1)/usr/lib/node_modules/$(PKG_NPM_NAME)
endef

define Package/node-gyp-build/postrm
#!/bin/sh
rm /usr/lib/node_modules/node-gyp-build || true
rm -rf /usr/lib/node/node-gyp-build || true
endef

define Host/Compile
cd $(HOST_BUILD_DIR); \
$(HOST_MAKE_VARS) \
npm_config_nodedir=$(STAGING_DIR)/usr/ \
$(if $(CONFIG_NODEJS_NPM_KEEP_CACHE), npm_config_cache=$(NPM_CACHE_DIR)/host-npm-cache-$(PKG_NPM_NAME),npm_config_cache=$(TMP_DIR)/npm-cache-$(HOSTTMPNPM)) \
npm install --prefer-offline --no-audit --global-style --install-strategy=shallow --no-save --omit=dev --no-package-lock --ignore-scripts
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} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(CP) $(HOST_BUILD_DIR)/{*.js,*.md} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/bin
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin.js $(1)/bin/node-gyp-build
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/optional.js $(1)/bin/node-gyp-build-optional
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/build-test.js $(1)/bin/node-gyp-build-test
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,node-gyp-build))
5 changes: 4 additions & 1 deletion lang/node-homebridge-cmd4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=homebridge-cmd4
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=7.0.1
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
Expand Down Expand Up @@ -57,6 +57,9 @@ define Build/Compile
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
rm -rf $(PKG_BUILD_DIR)/node_modules/moment/min
rm -rf $(PKG_BUILD_DIR)/node_modules/moment/src
rm -rf $(PKG_BUILD_DIR)/node_modules/moment/locale
endef

define Package/node-homebridge-cmd4/install
Expand Down
4 changes: 2 additions & 2 deletions lang/node-javascript-obfuscator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=javascript-obfuscator
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=4.0.2
PKG_VERSION:=4.1.0
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=a7da0955ad965f750bf828eed8b820f8fec38c6658751355445138548f8222be
PKG_HASH:=5335ccc1e7923593167150b25bd89d8ea60317fb3553a580d5a4200835d2f010

PKG_MAINTAINER:=Zbynek Kocur <[email protected]>
PKG_LICENSE:=BSD-2-Clause
Expand Down
8 changes: 5 additions & 3 deletions lang/node-mocha/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NPM_NAME:=mocha
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=10.2.0
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
Expand Down Expand Up @@ -73,10 +73,11 @@ define Package/node-mocha/install
$(CP) $(PKG_BUILD_DIR)/{node_modules,bin,lib} \
$(1)/usr/lib/node/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin/mocha $(1)/usr/bin/mocha
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin/mocha.js $(1)/usr/bin/mocha
$(LN) ../lib/node/$(PKG_NPM_NAME)/bin/_mocha $(1)/usr/bin/_mocha
$(INSTALL_DIR) $(1)/usr/lib/node_modules
$(LN) ../node/$(PKG_NPM_NAME) $(1)/usr/lib/node_modules/$(PKG_NPM_NAME)
chmod +x $(1)/usr/lib/node/$(PKG_NPM_NAME)/bin/mocha.js
endef

define Package/node-mocha/postrm
Expand Down Expand Up @@ -105,8 +106,9 @@ define Host/Install
$(CP) $(HOST_BUILD_DIR)/{node_modules,bin,lib} \
$(1)/lib/node_modules/$(PKG_NPM_NAME)/
$(INSTALL_DIR) $(1)/bin
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/mocha $(1)/bin/mocha
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/mocha.js $(1)/bin/mocha
$(LN) ../lib/node_modules/$(PKG_NPM_NAME)/bin/_mocha $(1)/bin/_mocha
chmod +x $(1)/lib/node_modules/$(PKG_NPM_NAME)/bin/mocha.js
endef

$(eval $(call HostBuild))
Expand Down
4 changes: 2 additions & 2 deletions lang/node-mqtt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=mqtt
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=5.0.3
PKG_VERSION:=5.0.5
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=69df09e351b7fe67bc014e0f78e4248ed273dc43f13c07525e94317fadd1159d
PKG_HASH:=ac7be66a7e642d380f5f46bc5e78adc05bcde8240e9ca4b3cf9f12ca06b5d204

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>
PKG_LICENSE:=MIT
Expand Down
2 changes: 1 addition & 1 deletion lang/node-mqtt/patches/000-remove_depends.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/package.json
+++ b/package.json
@@ -112,8 +112,7 @@
@@ -115,8 +115,7 @@
"readable-stream": "^4.4.2",
"reinterval": "^1.1.0",
"rfdc": "^1.3.0",
Expand Down
4 changes: 2 additions & 2 deletions lang/node-npm-check-updates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk

PKG_NPM_NAME:=npm-check-updates
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=16.13.2
PKG_VERSION:=16.14.4
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=https://mirrors.tencent.com/npm/$(PKG_NPM_NAME)/-/ \
https://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_HASH:=7897e1cf648c9b93106f07b18b2be0a55d6788e35f2139087cd5cdcb6200e810
PKG_HASH:=e6729f1bbd9a37f40d027c2178b9f53b78163e2638965d3def5b4feec4766a0d

PKG_MAINTAINER:=Hirokazu MORIKAWA <[email protected]>, Patrik Laszlo <[email protected]>
PKG_LICENSE:=Apache-2.0
Expand Down
Loading

0 comments on commit cf68e6b

Please sign in to comment.