Files
packages/lang/node/Makefile
Hirokazu MORIKAWA 5ad306413e node: bump to v18.20.3
Notable changes
This release fixes a regression introduced in Node.js 18.19.0 where http.server.close() was incorrectly closing idle connections.
A fix has also been included for compiling Node.js from source with newer versions of Clang.
The list of keys used to sign releases has been synchronized with the current list from the main branch.

Updated dependencies
* acorn updated to 8.11.3.
* acorn-walk updated to 8.3.2.
* ada updated to 2.7.8.
* c-ares updated to 1.28.1.
* corepack updated to 0.28.0.
* nghttp2 updated to 1.61.0.
* ngtcp2 updated to 1.3.0.
* npm updated to 10.7.0. Includes a fix from npm@10.5.1 to limit the number of open connections npm/cli#7324.
* simdutf updated to 5.2.4.
* zlib updated to 1.3.0.1-motley-7d77fb7.

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
2024-06-03 16:35:13 +08:00

167 lines
4.9 KiB
Makefile

#
# Copyright (C) 2006-2017 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=node
PKG_VERSION:=v18.20.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION)
PKG_HASH:=f35c9b9923c7b2e9243e7e2d10cd9ae61fbd5b925df3debbb72d5a70dbff555d
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Adrian Panella <ianchi74@outlook.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:nodejs:node.js
HOST_BUILD_DEPENDS:=python3/host
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
include $(INCLUDE_DIR)/package.mk
define Package/node
SECTION:=lang
CATEGORY:=Languages
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 \
+libcares +libatomic +NODEJS_ICU_SYSTEM:icu +NODEJS_ICU_SYSTEM:icu-full-data
endef
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.
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
endef
define Package/node-npm
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Node.js
TITLE:=NPM stands for Node Package Manager
URL:=https://www.npmjs.com/
DEPENDS:=+node
endef
define Package/node-npm/description
NPM is the package manager for NodeJS
endef
define Package/node/config
if PACKAGE_node
choice
prompt "i18n features"
default NODEJS_ICU_SMALL
help
Select i18n features
config NODEJS_ICU_NONE
bool "Disable"
config NODEJS_ICU_SMALL
bool "small-icu"
config NODEJS_ICU_SYSTEM
depends on ARCH_64BIT
bool "system-icu"
endchoice
endif
endef
NODEJS_CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
ifneq ($(CONFIG_ARCH_64BIT),y)
FORCE_32BIT:=-m32
endif
MAKE_VARS+= \
DESTCPU=$(NODEJS_CPU) \
NO_LOAD='cctest.target.mk embedtest.target.mk node_mksnapshot.target.mk overlapped-checker.target.mk \
mkcodecache.target.mk tools/v8_gypfiles/torque_base.target.mk tools/v8_gypfiles/v8_init.target.mk' \
LD_LIBRARY_PATH=$(STAGING_DIR_HOSTPKG)/share/icu/current/lib
HOST_MAKE_VARS+=NO_LOAD='cctest.target.mk embedtest.target.mk overlapped-checker.target.mk'
CONFIGURE_VARS:= \
CC="$(TARGET_CC) $(TARGET_OPTIMIZATION)" \
CXX="$(TARGET_CXX) $(TARGET_OPTIMIZATION)" \
CC_host="$(HOSTCC) $(FORCE_32BIT)" \
CXX_host="$(HOSTCXX) $(FORCE_32BIT)"
CONFIGURE_ARGS:= \
--dest-cpu=$(NODEJS_CPU) \
--dest-os=linux \
--cross-compiling \
--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) \
$(if $(findstring +neon-vfpv4",$(CONFIG_CPU_TYPE)),--with-arm-fpu=neon) \
$(if $(findstring +vfpv4",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3) \
$(if $(findstring +vfp",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfp) \
$(if $(findstring +vfpv3",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3) \
$(if $(findstring +vfpv3-d16",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3-d16) \
--prefix=/usr
HOST_CONFIGURE_VARS:=
HOST_CONFIGURE_ARGS:= \
--dest-os=$(if $(findstring Darwin,$(HOST_OS)),mac,linux) \
--with-intl=small-icu \
--prefix=$(STAGING_DIR_HOSTPKG)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef
define Package/node/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
endef
define Package/node-npm/install
$(INSTALL_DIR) $(1)/usr/lib/node_modules/npm
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE} \
$(1)/usr/lib/node_modules/npm/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/README.md \
$(1)/usr/lib/node_modules/npm/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{node_modules,bin,lib} \
$(1)/usr/lib/node_modules/npm/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node_modules/npm/bin/npm-cli.js $(1)/usr/bin/npm
$(LN) ../lib/node_modules/npm/bin/npx-cli.js $(1)/usr/bin/npx
endef
define Host/Install
$(RM) -rf $(1)/lib/node_modules/npm
$(call Host/Install/Default)
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,node))
$(eval $(call BuildPackage,node-npm))