From 3e51eef14c3be57d1a5ac3c1ecd4150aa5d8e639 Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Wed, 1 Nov 2023 10:03:48 +0900 Subject: [PATCH] node: upgrade to v20.9.0 node.js version 20.x is now active LTS. mipsel (pistachio) is no longer supported. Due to build difficulties, libuv shared libraries are not used. Signed-off-by: Hirokazu MORIKAWA --- lang/node/Makefile | 19 ++- lang/node/patches/003-path.patch | 2 +- lang/node/patches/004-musl_support.patch | 2 +- lang/node/patches/200-uv_gyp.patch | 10 ++ lang/node/patches/201-zlib_gyp.patch | 10 ++ lang/node/patches/202-node_gyp.patch | 10 ++ ...nflict.patch => 203-icu-generic_gyp.patch} | 32 ++++ lang/node/patches/204-v8_gyp.patch | 158 ++++++++++++++++++ ...necessary_libraries_for_host_execute.patch | 78 --------- lang/node/patches/991-v8_zlib_support.patch | 92 ---------- .../patches/992-v8_add_include_dirs.patch | 26 --- lang/node/patches/999-cast_for_mips32.patch | 11 -- .../patches/999-localhost-no-addrconfig.patch | 2 +- ...able_pointer_authentication_on_arm64.patch | 2 +- 14 files changed, 235 insertions(+), 219 deletions(-) create mode 100644 lang/node/patches/200-uv_gyp.patch create mode 100644 lang/node/patches/201-zlib_gyp.patch create mode 100644 lang/node/patches/202-node_gyp.patch rename lang/node/patches/{999-fix_icu_conflict.patch => 203-icu-generic_gyp.patch} (69%) create mode 100644 lang/node/patches/204-v8_gyp.patch delete mode 100644 lang/node/patches/990-delete_unnecessary_libraries_for_host_execute.patch delete mode 100644 lang/node/patches/991-v8_zlib_support.patch delete mode 100644 lang/node/patches/992-v8_add_include_dirs.patch delete mode 100644 lang/node/patches/999-cast_for_mips32.patch diff --git a/lang/node/Makefile b/lang/node/Makefile index e93590b5d..692bedf38 100644 --- a/lang/node/Makefile +++ b/lang/node/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=node -PKG_VERSION:=v18.18.2 +PKG_VERSION:=v20.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION) -PKG_HASH:=7249e2f0af943ec38599504f4b2a2bd31fb938787291b6ccca6c8badf01e3b56 +PKG_HASH:=a23d96810abf0455426b349d47ce5310f33095b7bc0571b9cc510f481c3a4519 PKG_MAINTAINER:=Hirokazu MORIKAWA , Adrian Panella PKG_LICENSE:=MIT @@ -26,7 +26,6 @@ HOST_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=python3/host PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -PKG_BUILD_FLAGS:=no-mips16 PKG_ASLR_PIE:=0 include $(INCLUDE_DIR)/host-build.mk @@ -38,8 +37,8 @@ define Package/node SUBMENU:=Node.js TITLE:=Node.js is a platform built on Chrome's JavaScript runtime URL:=https://nodejs.org/ - DEPENDS:=@HAS_FPU @(i386||x86_64||arm||aarch64||mipsel) \ - +libstdcpp +libopenssl +zlib +libnghttp2 +libuv \ + DEPENDS:=@HAS_FPU @(i386||x86_64||arm||aarch64) \ + +libstdcpp +libopenssl +zlib +libnghttp2 \ +libcares +libatomic +NODEJS_ICU_SYSTEM:icu +NODEJS_ICU_SYSTEM:icu-full-data endef @@ -47,8 +46,9 @@ define Package/node/description Node.jsĀ® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. + *** The following preparations must be made on the host side. *** - 1. gcc 8.3 or higher is required. + 1. gcc 10.1 or higher is required. 2. To build a 32-bit target, gcc-multilib, g++-multilib are required. 3. Requires libatomic package. (If necessary, install the 32-bit library at the same time.) ex) sudo apt-get install gcc-multilib g++-multilib @@ -115,7 +115,6 @@ CONFIGURE_ARGS:= \ --shared-zlib \ --shared-openssl \ --shared-nghttp2 \ - --shared-libuv \ --shared-cares \ --with-intl=$(if $(CONFIG_NODEJS_ICU_SMALL),small-icu,$(if $(CONFIG_NODEJS_ICU_SYSTEM),system-icu,none)) \ $(if $(findstring +neon",$(CONFIG_CPU_TYPE)),--with-arm-fpu=neon) \ @@ -157,7 +156,11 @@ define Package/node-npm/install endef define Host/Install - $(RM) -rf $(1)/lib/node_modules/npm + rm -f $(1)/bin/npm + rm -f $(1)/bin/npx + rm -rf $(1)/lib/node_modules/npm + rm -f $(1)/bin/corepack + rm -rf $(1)/lib/node_modules/corepack $(call Host/Install/Default) endef diff --git a/lang/node/patches/003-path.patch b/lang/node/patches/003-path.patch index 8e390d88c..011b02489 100644 --- a/lang/node/patches/003-path.patch +++ b/lang/node/patches/003-path.patch @@ -1,6 +1,6 @@ --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js -@@ -1391,7 +1391,8 @@ Module._initPaths = function() { +@@ -1378,7 +1378,8 @@ Module._initPaths = function() { path.resolve(process.execPath, '..') : path.resolve(process.execPath, '..', '..'); diff --git a/lang/node/patches/004-musl_support.patch b/lang/node/patches/004-musl_support.patch index 5e7e54b72..b0f950315 100644 --- a/lang/node/patches/004-musl_support.patch +++ b/lang/node/patches/004-musl_support.patch @@ -20,7 +20,7 @@ result = clock_gettime(CLOCK_MONOTONIC, &ts); --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc -@@ -1066,7 +1066,7 @@ bool Thread::Start() { +@@ -1147,7 +1147,7 @@ bool Thread::Start() { #if V8_OS_DARWIN // Default on Mac OS X is 512kB -- bump up to 1MB stack_size = 1 * 1024 * 1024; diff --git a/lang/node/patches/200-uv_gyp.patch b/lang/node/patches/200-uv_gyp.patch new file mode 100644 index 000000000..75bc8f2e5 --- /dev/null +++ b/lang/node/patches/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!': [ '(0))); -+ Operand(static_cast(0))); - } - } - // Functions with JS linkage have at least one parameter (the receiver). diff --git a/lang/node/patches/999-localhost-no-addrconfig.patch b/lang/node/patches/999-localhost-no-addrconfig.patch index dadfd14ec..092dc0de3 100644 --- a/lang/node/patches/999-localhost-no-addrconfig.patch +++ b/lang/node/patches/999-localhost-no-addrconfig.patch @@ -13,7 +13,7 @@ Forwarded: https://github.com/nodejs/node/issues/33816 // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the -@@ -1321,13 +1322,6 @@ function lookupAndConnect(self, options) +@@ -1330,13 +1331,6 @@ function lookupAndConnect(self, options) hints: options.hints || 0, }; diff --git a/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch b/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch index 44fc715fe..fe9dd59d0 100644 --- a/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch +++ b/lang/node/patches/999-revert_enable_pointer_authentication_on_arm64.patch @@ -1,6 +1,6 @@ --- a/configure.py +++ b/configure.py -@@ -1291,7 +1291,6 @@ def configure_node(o): +@@ -1270,7 +1270,6 @@ def configure_node(o): # Enable branch protection for arm64 if target_arch == 'arm64':