8 Commits

Author SHA1 Message Date
Bard f920cc4e57 docs: fix typo 2024-11-08 00:51:11 +08:00
sbwml e314553fdc openwrt-21.02
Signed-off-by: sbwml <admin@cooluc.com>
2024-02-24 09:41:07 +08:00
sbwml 97f2cc3f50 packages-23.05
Signed-off-by: sbwml <admin@cooluc.com>
2024-01-15 23:08:43 +08:00
sbwml 125e94165c node: fix host build 2024-01-15 22:00:17 +08:00
Bard 2b8e82b4e4 makefile: only compatible with musl 2023-11-20 01:07:10 +08:00
Bard 06018d78be fix host-compile 2023-10-27 19:30:40 +08:00
Bard f6b9f3f378 fix node-npm build 2023-10-26 03:57:31 +08:00
sbwml 7a31bd2937 init
Signed-off-by: sbwml <admin@cooluc.com>
2023-10-25 22:23:21 +08:00
2 changed files with 25 additions and 24 deletions
+21 -17
View File
@@ -8,8 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=node
PKG_VERSION:=$(shell curl -s https://api.github.com/repos/sbwml/node_workflow/tags | grep '"name"' | head -n 1 | sed -E 's/.*"name": "v([^"]+)".*/\1/')
PKG_RELEASE:=1
PKG_BASE:=packages-21.02
PKG_VERSION:=$(shell curl -s https://downloads.openwrt.org/releases/$(PKG_BASE)/aarch64_generic/packages/ | grep node_v | grep -oP 'node_v\d+\.\d+\.\d+-\d+' | sed -n 's/node_//p' | head -n1)
NODE_VERSION:=$(shell echo $(PKG_VERSION) | sed 's/-.*//')
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Adrian Panella <ianchi74@outlook.com>
PKG_LICENSE:=MIT
@@ -27,18 +28,17 @@ define Package/node
SUBMENU:=Node.js
TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
URL:=https://nodejs.org/
DEPENDS:=@USE_MUSL @HAS_FPU @(i386||x86_64||arm||aarch64) \
+libstdcpp +libopenssl +zlib +libnghttp2 \
+libcares +libatomic
DEPENDS:=@USE_MUSL @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 12.2 or higher is required.
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
@@ -58,19 +58,19 @@ define Package/node-npm/description
endef
ifeq ($(HOST_ARCH),x86_64)
NODE_HOST_ARCH:=x64
NODE_ARCH:=x64
endif
ifeq ($(HOST_ARCH),aarch64)
NODE_HOST_ARCH:=arm64
NODE_ARCH:=arm64
endif
define Host/Compile
( \
pushd $(HOST_BUILD_DIR) ; \
$(RM) node-v* ; \
wget https://nodejs.org/dist/v$(PKG_VERSION)/node-v$(PKG_VERSION)-linux-$(NODE_HOST_ARCH).tar.xz ; \
$(TAR) -xf node-v$(PKG_VERSION)-linux-$(NODE_HOST_ARCH).tar.xz ; \
$(RM) node-v* ; \
wget https://nodejs.org/dist/$(NODE_VERSION)/node-$(NODE_VERSION)-linux-$(NODE_ARCH).tar.xz ; \
$(TAR) -xf node-$(NODE_VERSION)-linux-$(NODE_ARCH).tar.xz ; \
popd ; \
)
endef
@@ -78,10 +78,14 @@ endef
define Build/Compile
( \
pushd $(PKG_BUILD_DIR) ; \
wget https://github.com/sbwml/node_workflow/releases/download/v$(PKG_VERSION)/$(ARCH_PACKAGES).tar.gz ; \
$(TAR) -zxf $(ARCH_PACKAGES).tar.gz ; \
$(STAGING_DIR_HOST)/bin/apk extract --allow-untrusted *.apk ; \
$(RM) *.tar.gz *.apk ; \
wget https://downloads.openwrt.org/releases/$(PKG_BASE)/$(ARCH_PACKAGES)/packages/node_$(PKG_VERSION)_$(ARCH_PACKAGES).ipk ; \
$(TAR) -zxf node_$(PKG_VERSION)_$(ARCH_PACKAGES).ipk ; \
$(TAR) -zxf data.tar.gz ; \
rm -f data.tar.gz control.tar.gz debian-binary ; \
wget https://downloads.openwrt.org/releases/$(PKG_BASE)/$(ARCH_PACKAGES)/packages/node-npm_$(PKG_VERSION)_$(ARCH_PACKAGES).ipk ; \
$(TAR) -zxf node-npm_$(PKG_VERSION)_$(ARCH_PACKAGES).ipk ; \
$(TAR) -zxf data.tar.gz ; \
rm -f data.tar.gz control.tar.gz debian-binary ; \
popd ; \
)
endef
@@ -105,7 +109,7 @@ define Package/node-npm/install
endef
define Host/Install
$(CP) $(HOST_BUILD_DIR)/node-v$(PKG_VERSION)-linux-$(NODE_HOST_ARCH)/* $(STAGING_DIR_HOST)/
$(CP) $(HOST_BUILD_DIR)/node-$(NODE_VERSION)-linux-$(NODE_ARCH)/* $(STAGING_DIR_HOST)/
endef
$(eval $(call HostBuild))
+4 -7
View File
@@ -1,11 +1,8 @@
## openwrt-25.12 - Fast Build for Node.js Dependent Packages
# openwrt-21.02 - node
When building packages that require Node.js on the OpenWrt branch, use the prebuilt Node.js feed instead of compiling Node.js from source. This approach significantly reduces build time and ensures compatibility with dependent packages.
### quickly build package that require node dependent
```bash
# remove the default Node.js feed
```shell
rm -rf feeds/packages/lang/node
# clone the prebuilt Node.js feed (packages-25.12 branch)
git clone https://github.com/sbwml/feeds_packages_lang_node -b packages-25.12 feeds/packages/lang/node
git clone https://github.com/sbwml/feeds_packages_lang_node-prebuilt -b packages-21.02 feeds/packages/lang/node
```