2015-08-02 14:26:39 +08:00
|
|
|
#
|
2017-01-04 05:23:51 +08:00
|
|
|
# Copyright (C) 2006-2017 OpenWrt.org
|
2015-08-02 14:26:39 +08:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=node
|
2025-02-17 12:06:16 +08:00
|
|
|
PKG_VERSION:=22.14.0
|
2025-01-23 13:27:18 +08:00
|
|
|
PKG_RELEASE:=1
|
2024-11-23 13:51:28 +08:00
|
|
|
NODE_MODULE_VERSION:=127
|
2015-08-02 14:26:39 +08:00
|
|
|
|
2024-08-26 10:26:15 +08:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=https://nodejs.org/dist/v$(PKG_VERSION)
|
2025-02-17 12:06:16 +08:00
|
|
|
PKG_HASH:=6c4e31ed5702dc45cfd8c435af56a36a474427e1bd7afe74c346136060beba8a
|
2024-08-26 10:26:15 +08:00
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
|
2025-03-10 08:29:09 +08:00
|
|
|
NODEJS_BIN_SUM:=9d942932535988091034dc94cc5f42b6dc8784d6366df3a36c4c9ccb3996f0c2
|
2024-08-26 10:26:15 +08:00
|
|
|
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-v$(PKG_VERSION)
|
2016-05-09 21:57:18 +08:00
|
|
|
|
2020-11-27 07:58:31 +08:00
|
|
|
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Adrian Panella <ianchi74@outlook.com>
|
2017-01-04 05:23:51 +08:00
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2018-11-15 12:30:51 +08:00
|
|
|
PKG_CPE_ID:=cpe:/a:nodejs:node.js
|
2015-08-02 14:26:39 +08:00
|
|
|
|
2019-10-08 12:51:59 +08:00
|
|
|
HOST_BUILD_DEPENDS:=python3/host
|
|
|
|
HOST_BUILD_PARALLEL:=1
|
2025-03-10 08:29:09 +08:00
|
|
|
PKG_HOST_ONLY:=1
|
2019-10-08 12:51:59 +08:00
|
|
|
|
2015-08-02 14:26:39 +08:00
|
|
|
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
|
2018-11-15 12:30:51 +08:00
|
|
|
URL:=https://nodejs.org/
|
2024-11-23 13:51:28 +08:00
|
|
|
ABI_VERSION:=$(NODE_MODULE_VERSION)
|
2025-03-10 08:29:09 +08:00
|
|
|
BUILDONLY:=1
|
2015-08-02 14:26:39 +08:00
|
|
|
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.
|
2017-04-03 20:21:39 +08:00
|
|
|
endef
|
|
|
|
|
2022-06-09 15:46:23 +08:00
|
|
|
HOST_MAKE_VARS+=NO_LOAD='cctest.target.mk embedtest.target.mk overlapped-checker.target.mk'
|
2020-11-08 15:00:12 +08:00
|
|
|
|
2015-08-02 14:26:39 +08:00
|
|
|
HOST_CONFIGURE_VARS:=
|
|
|
|
HOST_CONFIGURE_ARGS:= \
|
2019-08-01 15:43:13 +08:00
|
|
|
--dest-os=$(if $(findstring Darwin,$(HOST_OS)),mac,linux) \
|
2021-02-17 09:30:56 +08:00
|
|
|
--with-intl=small-icu \
|
2017-01-10 22:02:50 +08:00
|
|
|
--prefix=$(STAGING_DIR_HOSTPKG)
|
2015-08-02 14:26:39 +08:00
|
|
|
|
2025-03-10 08:29:09 +08:00
|
|
|
ifeq ($(HOST_ARCH),x86_64)
|
|
|
|
|
|
|
|
NODEJS_BIN:=node-v$(PKG_VERSION)-linux-x64.tar.gz
|
|
|
|
|
|
|
|
define Download/nodebin
|
|
|
|
URL:=https://nodejs.org/download/release/v$(PKG_VERSION)/
|
|
|
|
FILE:=$(NODEJS_BIN)
|
|
|
|
HASH:=$(NODEJS_BIN_SUM)
|
2015-08-02 14:26:39 +08:00
|
|
|
endef
|
|
|
|
|
2025-03-10 08:29:09 +08:00
|
|
|
define Host/Prepare
|
|
|
|
$(eval $(call Download,nodebin))
|
2017-04-03 20:21:39 +08:00
|
|
|
endef
|
|
|
|
|
2025-03-10 08:29:09 +08:00
|
|
|
define Host/Configure
|
|
|
|
# nothing to do
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Host/Compile
|
|
|
|
# nothing to do
|
2015-08-02 14:26:39 +08:00
|
|
|
endef
|
|
|
|
|
2025-03-10 08:29:09 +08:00
|
|
|
define Host/Install
|
|
|
|
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
|
|
|
|
$(TAR) xvf $(DL_DIR)/$(NODEJS_BIN) -C $(1) --strip-components=1
|
|
|
|
mv $(1)/{CHANGELOG.md,LICENSE,README.md} $(1)/lib/node_modules/
|
|
|
|
endef
|
|
|
|
|
|
|
|
else
|
2022-06-01 11:22:34 +08:00
|
|
|
define Host/Install
|
2023-11-01 09:03:48 +08:00
|
|
|
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
|
2022-06-01 11:22:34 +08:00
|
|
|
$(call Host/Install/Default)
|
|
|
|
endef
|
2025-03-10 08:29:09 +08:00
|
|
|
endif
|
2022-06-01 11:22:34 +08:00
|
|
|
|
2015-08-02 14:26:39 +08:00
|
|
|
$(eval $(call HostBuild))
|
|
|
|
$(eval $(call BuildPackage,node))
|