From b35738efba79be0fa9ccf417daf5ecfd5a0f94c1 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 7 Dec 2024 16:05:13 +0800 Subject: [PATCH] node: bump to v22.x --- lang/node/Makefile | 13 +- lang/node/patches/v22.x/003-path.patch | 12 ++ .../node/patches/v22.x/004-musl_support.patch | 42 +++++ .../v22.x/007-fix_host_build_on_macos.patch | 11 ++ .../012-changing-default-npm-settings.patch | 20 +++ lang/node/patches/v22.x/200-uv_gyp.patch | 10 ++ lang/node/patches/v22.x/201-zlib_gyp.patch | 10 ++ lang/node/patches/v22.x/202-node_gyp.patch | 10 ++ .../patches/v22.x/203-icu-generic_gyp.patch | 106 ++++++++++++ lang/node/patches/v22.x/204-v8_gyp.patch | 158 ++++++++++++++++++ .../999-deps-v8-src-base-small-vector_h.patch | 10 ++ .../999-fix_building_with_system_icu_76.patch | 25 +++ .../999-fix_compile_error_for_ia32.patch | 38 +++++ .../v22.x/999-localhost-no-addrconfig.patch | 29 ++++ ...able_pointer_authentication_on_arm64.patch | 10 ++ libs/nghttp2/Makefile | 5 +- 16 files changed, 506 insertions(+), 3 deletions(-) create mode 100644 lang/node/patches/v22.x/003-path.patch create mode 100644 lang/node/patches/v22.x/004-musl_support.patch create mode 100644 lang/node/patches/v22.x/007-fix_host_build_on_macos.patch create mode 100644 lang/node/patches/v22.x/012-changing-default-npm-settings.patch create mode 100644 lang/node/patches/v22.x/200-uv_gyp.patch create mode 100644 lang/node/patches/v22.x/201-zlib_gyp.patch create mode 100644 lang/node/patches/v22.x/202-node_gyp.patch create mode 100644 lang/node/patches/v22.x/203-icu-generic_gyp.patch create mode 100644 lang/node/patches/v22.x/204-v8_gyp.patch create mode 100644 lang/node/patches/v22.x/999-deps-v8-src-base-small-vector_h.patch create mode 100644 lang/node/patches/v22.x/999-fix_building_with_system_icu_76.patch create mode 100644 lang/node/patches/v22.x/999-fix_compile_error_for_ia32.patch create mode 100644 lang/node/patches/v22.x/999-localhost-no-addrconfig.patch create mode 100644 lang/node/patches/v22.x/999-revert_enable_pointer_authentication_on_arm64.patch diff --git a/lang/node/Makefile b/lang/node/Makefile index d26ccf38..834fe22c 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -6,6 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=node +ifeq ($(CONFIG_NODEJS_22),y) +PKG_VERSION:=v22.11.0 +PKG_RELEASE:=1 +PKG_HASH:=bbf0297761d53aefda9d7855c57c7d2c272b83a7b5bad4fea9cb29006d8e1d35 +PATCH_DIR:=./patches/v22.x +else ifeq ($(CONFIG_NODEJS_20),y) PKG_VERSION:=v20.12.2 PKG_RELEASE:=1 @@ -38,6 +44,7 @@ endif endif endif endif +endif PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION) @@ -101,7 +108,7 @@ define Package/node/config choice prompt "Version Selection" default NODEJS_12 if mips||mipsel||mips64||mips64el - default NODEJS_18 + default NODEJS_22 help Select node.js version. The host package version is also the same. @@ -124,6 +131,10 @@ define Package/node/config config NODEJS_20 depends on !(mips||mipsel||mips64||mips64el) bool "20.x Active LTS" + + config NODEJS_22 + depends on !(mips||mipsel||mips64||mips64el) + bool "22.x Active LTS" endchoice if PACKAGE_node diff --git a/lang/node/patches/v22.x/003-path.patch b/lang/node/patches/v22.x/003-path.patch new file mode 100644 index 00000000..f2000b1e --- /dev/null +++ b/lang/node/patches/v22.x/003-path.patch @@ -0,0 +1,12 @@ +--- a/lib/internal/modules/cjs/loader.js ++++ b/lib/internal/modules/cjs/loader.js +@@ -1779,7 +1779,8 @@ Module._initPaths = function() { + path.resolve(process.execPath, '..') : + path.resolve(process.execPath, '..', '..'); + +- const paths = [path.resolve(prefixDir, 'lib', 'node')]; ++ const paths = [path.resolve(prefixDir, 'lib', 'node'), ++ path.resolve(prefixDir, 'lib', 'node_modules')]; + + if (homeDir) { + ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries')); diff --git a/lang/node/patches/v22.x/004-musl_support.patch b/lang/node/patches/v22.x/004-musl_support.patch new file mode 100644 index 00000000..d8a02f33 --- /dev/null +++ b/lang/node/patches/v22.x/004-musl_support.patch @@ -0,0 +1,42 @@ +--- a/deps/v8/src/base/platform/condition-variable.cc ++++ b/deps/v8/src/base/platform/condition-variable.cc +@@ -20,7 +20,7 @@ namespace base { + + ConditionVariable::ConditionVariable() { + #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \ +- (V8_OS_LINUX && V8_LIBC_GLIBC)) ++ V8_OS_LINUX) + // On Free/Net/OpenBSD and Linux with glibc we can change the time + // source for pthread_cond_timedwait() to use the monotonic clock. + pthread_condattr_t attr; +@@ -96,7 +96,7 @@ bool ConditionVariable::WaitFor(Mutex* m + &native_handle_, &mutex->native_handle(), &ts); + #else + #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \ +- (V8_OS_LINUX && V8_LIBC_GLIBC)) ++ V8_OS_LINUX) + // On Free/Net/OpenBSD and Linux with glibc we can change the time + // source for pthread_cond_timedwait() to use the monotonic clock. + result = clock_gettime(CLOCK_MONOTONIC, &ts); +--- a/deps/v8/src/base/platform/platform-posix.cc ++++ b/deps/v8/src/base/platform/platform-posix.cc +@@ -1207,7 +1207,7 @@ bool Thread::Start() { + #if V8_OS_DARWIN + // Default on Mac OS X is 512kB -- bump up to 1MB + stack_size = 1 * 1024 * 1024; +-#elif V8_OS_AIX ++#elif V8_OS_AIX || !defined(__GLIBC__) + // Default on AIX is 96kB -- bump up to 2MB + stack_size = 2 * 1024 * 1024; + #endif +--- a/deps/v8/src/codegen/external-reference-table.cc ++++ b/deps/v8/src/codegen/external-reference-table.cc +@@ -10,7 +10,7 @@ + #include "src/ic/stub-cache.h" + #include "src/logging/counters.h" + +-#if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID) ++#if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID) && defined(V8_LIBC_GLIBC) + #define SYMBOLIZE_FUNCTION + #include + diff --git a/lang/node/patches/v22.x/007-fix_host_build_on_macos.patch b/lang/node/patches/v22.x/007-fix_host_build_on_macos.patch new file mode 100644 index 00000000..915fb3df --- /dev/null +++ b/lang/node/patches/v22.x/007-fix_host_build_on_macos.patch @@ -0,0 +1,11 @@ +--- a/tools/gyp/pylib/gyp/generator/make.py ++++ b/tools/gyp/pylib/gyp/generator/make.py +@@ -208,7 +208,7 @@ cmd_solink_module = $(LINK.$(TOOLSET)) - + + LINK_COMMANDS_MAC = """\ + quiet_cmd_alink = LIBTOOL-STATIC $@ +-cmd_alink = rm -f $@ && %(python)s gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %%.o,$^) ++cmd_alink = rm -f $@ && %(python)s gyp-mac-tool filter-libtool /usr/bin/libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %%.o,$^) + + quiet_cmd_link = LINK($(TOOLSET)) $@ + cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) diff --git a/lang/node/patches/v22.x/012-changing-default-npm-settings.patch b/lang/node/patches/v22.x/012-changing-default-npm-settings.patch new file mode 100644 index 00000000..b05aa74e --- /dev/null +++ b/lang/node/patches/v22.x/012-changing-default-npm-settings.patch @@ -0,0 +1,20 @@ +--- a/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js ++++ b/deps/npm/node_modules/@npmcli/config/lib/definitions/definitions.js +@@ -1212,7 +1212,7 @@ const definitions = { + }, + }), + loglevel: new Definition('loglevel', { +- default: 'notice', ++ default: 'info', + type: [ + 'silent', + 'error', +@@ -1993,7 +1993,7 @@ const definitions = { + flatten, + }), + 'strict-ssl': new Definition('strict-ssl', { +- default: true, ++ default: false, + type: Boolean, + description: ` + Whether or not to do SSL key validation when making requests to the diff --git a/lang/node/patches/v22.x/200-uv_gyp.patch b/lang/node/patches/v22.x/200-uv_gyp.patch new file mode 100644 index 00000000..75bc8f2e --- /dev/null +++ b/lang/node/patches/v22.x/200-uv_gyp.patch @@ -0,0 +1,10 @@ +--- a/deps/uv/uv.gyp ++++ b/deps/uv/uv.gyp +@@ -155,6 +155,7 @@ + 'target_name': 'libuv', + 'toolsets': ['host', 'target'], + 'type': '<(uv_library)', ++ 'include_dirs!': [ '::value); + + public: diff --git a/lang/node/patches/v22.x/999-fix_building_with_system_icu_76.patch b/lang/node/patches/v22.x/999-fix_building_with_system_icu_76.patch new file mode 100644 index 00000000..0d0c2dac --- /dev/null +++ b/lang/node/patches/v22.x/999-fix_building_with_system_icu_76.patch @@ -0,0 +1,25 @@ +From 54299ac3a3d4e4520b8604dce43c2584092ccde2 Mon Sep 17 00:00:00 2001 +From: Michael Cho +Date: Sun, 27 Oct 2024 10:08:07 -0400 +Subject: [PATCH] build: fix building with system icu 76 + +ICU 76 decided to reduce overlinking[^1] thus `icu-i18n` will no longer +add `icu-uc` when linking to shared libraries. This results in undefined +symbols/references when trying to build with system ICU 76. + +[^1]: unicode-org/icu@199bc82 +--- + configure.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/configure.py ++++ b/configure.py +@@ -1876,7 +1876,7 @@ def configure_intl(o): + elif with_intl == 'system-icu': + # ICU from pkg-config. + o['variables']['v8_enable_i18n_support'] = 1 +- pkgicu = pkg_config('icu-i18n') ++ pkgicu = pkg_config(['icu-i18n', 'icu-uc']) + if not pkgicu[0]: + error('''Could not load pkg-config data for "icu-i18n". + See above errors or the README.md.''') diff --git a/lang/node/patches/v22.x/999-fix_compile_error_for_ia32.patch b/lang/node/patches/v22.x/999-fix_compile_error_for_ia32.patch new file mode 100644 index 00000000..194f0500 --- /dev/null +++ b/lang/node/patches/v22.x/999-fix_compile_error_for_ia32.patch @@ -0,0 +1,38 @@ +--- a/deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc ++++ b/deps/v8/src/compiler/backend/ia32/instruction-selector-ia32.cc +@@ -1161,7 +1161,7 @@ template + void VisitAtomicExchange(InstructionSelectorT* selector, + typename Adapter::node_t node, ArchOpcode opcode, + MachineRepresentation rep) { +- using node_t = Adapter::node_t; ++ using node_t = typename Adapter::node_t; + IA32OperandGeneratorT g(selector); + node_t base = selector->input_at(node, 0); + node_t index = selector->input_at(node, 1); +@@ -1732,7 +1732,7 @@ template + void VisitWord32PairShift(InstructionSelectorT* selector, + InstructionCode opcode, + typename Adapter::node_t node) { +- using node_t = Adapter::node_t; ++ using node_t = typename Adapter::node_t; + IA32OperandGeneratorT g(selector); + + node_t shift = selector->input_at(node, 2); +@@ -2507,7 +2507,7 @@ template + void VisitAtomicBinOp(InstructionSelectorT* selector, + typename Adapter::node_t node, ArchOpcode opcode, + MachineRepresentation rep) { +- using node_t = Adapter::node_t; ++ using node_t = typename Adapter::node_t; + AddressingMode addressing_mode; + IA32OperandGeneratorT g(selector); + node_t base = selector->input_at(node, 0); +@@ -2528,7 +2528,7 @@ void VisitAtomicBinOp(InstructionSelecto + template + void VisitPairAtomicBinOp(InstructionSelectorT* selector, + typename Adapter::node_t node, ArchOpcode opcode) { +- using node_t = Adapter::node_t; ++ using node_t = typename Adapter::node_t; + IA32OperandGeneratorT g(selector); + node_t base = selector->input_at(node, 0); + node_t index = selector->input_at(node, 1); diff --git a/lang/node/patches/v22.x/999-localhost-no-addrconfig.patch b/lang/node/patches/v22.x/999-localhost-no-addrconfig.patch new file mode 100644 index 00000000..c431370b --- /dev/null +++ b/lang/node/patches/v22.x/999-localhost-no-addrconfig.patch @@ -0,0 +1,29 @@ +Description: do not use dns.ADDRCONFIG for localhost + it fails on IPv6-only systems. Setting it with libc fails on linux. + https://github.com/nodejs/node/issues/33279 +Author: Jérémy Lal +Last-Update: 2020-06-11 +Bug-Debian: https://bugs.debian.org/962318 +Forwarded: https://github.com/nodejs/node/issues/33816 +--- a/lib/net.js ++++ b/lib/net.js +@@ -1,4 +1,5 @@ + // Copyright Joyent, Inc. and other Node contributors. ++ + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the +@@ -1342,13 +1343,6 @@ function lookupAndConnect(self, options) + hints: options.hints || 0, + }; + +- if (!isWindows && +- dnsopts.family !== 4 && +- dnsopts.family !== 6 && +- dnsopts.hints === 0) { +- dnsopts.hints = dns.ADDRCONFIG; +- } +- + debug('connect: find host', host); + debug('connect: dns options', dnsopts); + self._host = host; diff --git a/lang/node/patches/v22.x/999-revert_enable_pointer_authentication_on_arm64.patch b/lang/node/patches/v22.x/999-revert_enable_pointer_authentication_on_arm64.patch new file mode 100644 index 00000000..83fd1e02 --- /dev/null +++ b/lang/node/patches/v22.x/999-revert_enable_pointer_authentication_on_arm64.patch @@ -0,0 +1,10 @@ +--- a/node.gyp ++++ b/node.gyp +@@ -1351,6 +1351,7 @@ + 'deps/simdutf/simdutf.gyp:simdutf#host', + ], + 'libraries!':[ '-licui18n', '-licuuc', '-licudata', '-lcrypto', '-lssl', '-lz', '-lhttp_parser', '-luv', '-lnghttp2', '-lcares' ], ++ 'cflags!': ['-mbranch-protection=standard'], + 'include_dirs': [ + 'tools', + 'src', diff --git a/libs/nghttp2/Makefile b/libs/nghttp2/Makefile index 7135194e..21282ea2 100644 --- a/libs/nghttp2/Makefile +++ b/libs/nghttp2/Makefile @@ -1,16 +1,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nghttp2 -PKG_VERSION:=1.51.0 +PKG_VERSION:=1.63.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2/releases/download/v$(PKG_VERSION) -PKG_HASH:=66aa76d97c143f42295405a31413e5e7d157968dad9f957bb4b015b598882e6b +PKG_HASH:=4879c75dd32a74421b9857924449460b8341796c0613ba114ab2188e4622354b PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:nghttp2:nghttp2 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk