2015-08-02 06:26:39 +00:00
|
|
|
#
|
2017-01-03 21:23:51 +00:00
|
|
|
# Copyright (C) 2006-2017 OpenWrt.org
|
2015-08-02 06:26:39 +00: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
|
2019-08-16 02:23:47 +00:00
|
|
|
PKG_VERSION:=v8.16.1
|
|
|
|
PKG_RELEASE:=1
|
2016-05-09 13:57:18 +00:00
|
|
|
PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
|
2018-11-15 04:30:51 +00:00
|
|
|
PKG_SOURCE_URL:=https://nodejs.org/dist/${PKG_VERSION}
|
2019-08-16 02:23:47 +00:00
|
|
|
PKG_HASH:=d8c190acdf2d967faf49c22df883d31a8d4e249d67852dae3c2d8a0f756b0512
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2015-10-28 00:10:09 +00:00
|
|
|
HOST_BUILD_DEPENDS:=python/host
|
2015-10-20 11:23:01 +00:00
|
|
|
PKG_BUILD_DEPENDS:=python/host
|
2017-01-03 21:23:51 +00:00
|
|
|
|
2015-08-02 06:26:39 +00:00
|
|
|
PKG_INSTALL:=1
|
2015-10-24 07:57:36 +00:00
|
|
|
PKG_USE_MIPS16:=0
|
2015-08-02 06:26:39 +00:00
|
|
|
|
2016-05-09 13:57:18 +00:00
|
|
|
HOST_BUILD_PARALLEL:=1
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
|
2017-08-17 01:50:29 +00:00
|
|
|
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>, Adrian Panella <ianchi74@outlook.com>
|
2017-01-03 21:23:51 +00:00
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2018-11-15 04:30:51 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:nodejs:node.js
|
2015-08-02 06:26:39 +00: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 04:30:51 +00:00
|
|
|
URL:=https://nodejs.org/
|
2019-04-25 14:02:22 +00:00
|
|
|
DEPENDS:=@(HAS_FPU||KERNEL_MIPS_FPU_EMULATOR) @!arc @!armeb \
|
|
|
|
+libstdcpp +libopenssl +zlib +libnghttp2 +libuv +libhttp-parser \
|
|
|
|
+NODEJS_ICU:icu
|
2015-08-02 06:26:39 +00: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.
|
|
|
|
endef
|
|
|
|
|
2017-04-03 12:21:39 +00:00
|
|
|
define Package/node-npm
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
|
|
|
SUBMENU:=Node.js
|
|
|
|
TITLE:=NPM stands for Node Package Manager
|
2018-11-15 04:30:51 +00:00
|
|
|
URL:=https://npmjs.com/
|
2017-04-03 12:21:39 +00:00
|
|
|
DEPENDS:=+node
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/node-npm/description
|
|
|
|
NPM is the package manager for NodeJS
|
|
|
|
endef
|
|
|
|
|
2017-01-03 21:23:51 +00:00
|
|
|
define Package/node/config
|
2019-04-25 14:02:22 +00:00
|
|
|
if PACKAGE_node
|
2017-01-03 21:23:51 +00:00
|
|
|
|
|
|
|
config NODEJS_ICU
|
|
|
|
bool "enable i18n features"
|
|
|
|
default n
|
|
|
|
|
2019-04-25 14:02:22 +00:00
|
|
|
endif
|
2017-01-03 21:23:51 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
|
2015-12-19 13:16:02 +00:00
|
|
|
|
2017-01-03 21:23:51 +00:00
|
|
|
MAKE_VARS+= \
|
|
|
|
DESTCPU=$(NODEJS_CPU)
|
2015-12-19 13:16:02 +00:00
|
|
|
|
2018-05-17 06:16:52 +00:00
|
|
|
CONFIGURE_VARS:= \
|
|
|
|
CC="$(TARGET_CC) $(TARGET_OPTIMIZATION)" \
|
|
|
|
CXX="$(TARGET_CXX) $(TARGET_OPTIMIZATION)" \
|
|
|
|
CC_host="$(HOSTCC)" \
|
|
|
|
CXX_host="$(HOSTCXX)"
|
|
|
|
|
2017-01-03 21:23:51 +00:00
|
|
|
CONFIGURE_ARGS:= \
|
|
|
|
--dest-cpu=$(NODEJS_CPU) \
|
2015-08-02 06:26:39 +00:00
|
|
|
--dest-os=linux \
|
|
|
|
--without-snapshot \
|
|
|
|
--shared-zlib \
|
|
|
|
--shared-openssl \
|
2018-12-13 10:14:09 +00:00
|
|
|
--shared-nghttp2 \
|
|
|
|
--shared-libuv \
|
|
|
|
--shared-http-parser \
|
2018-05-17 06:16:52 +00:00
|
|
|
--with-intl=$(if $(CONFIG_NODEJS_ICU),system-icu,none) \
|
|
|
|
$(if $(findstring mips,$(NODEJS_CPU)), \
|
|
|
|
$(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft)) \
|
|
|
|
$(if $(findstring +neon,$(CONFIG_CPU_TYPE)),--with-arm-fpu=neon) \
|
|
|
|
$(if $(findstring +vfp",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfp) \
|
|
|
|
$(if $(findstring +vfpv3",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3-d16) \
|
|
|
|
$(if $(findstring +vfpv4",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3) \
|
2015-08-02 06:26:39 +00:00
|
|
|
--prefix=/usr
|
|
|
|
|
|
|
|
HOST_CONFIGURE_VARS:=
|
2016-08-02 13:16:33 +00:00
|
|
|
|
2015-08-02 06:26:39 +00:00
|
|
|
HOST_CONFIGURE_ARGS:= \
|
2019-08-01 07:43:13 +00:00
|
|
|
--dest-os=$(if $(findstring Darwin,$(HOST_OS)),mac,linux) \
|
2015-08-02 06:26:39 +00:00
|
|
|
--without-snapshot \
|
2017-01-10 14:02:50 +00:00
|
|
|
--prefix=$(STAGING_DIR_HOSTPKG)
|
2015-08-02 06:26:39 +00:00
|
|
|
|
|
|
|
HOST_CONFIGURE_CMD:=python ./configure
|
|
|
|
|
|
|
|
define Build/InstallDev
|
|
|
|
$(INSTALL_DIR) $(1)/usr/include
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/node/install
|
2017-04-03 12:21:39 +00:00
|
|
|
mkdir -p $(1)/usr/bin
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/node-npm/install
|
2015-08-02 06:26:39 +00:00
|
|
|
mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
|
2018-03-09 13:07:26 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/bin/{npm,npx} $(1)/usr/bin/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE} $(1)/usr/lib/node_modules/npm
|
2015-08-02 06:26:39 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
|
2018-03-09 13:07:26 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npx-cli.js $(1)/usr/lib/node_modules/npm/bin
|
2015-08-02 06:26:39 +00:00
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
|
|
|
|
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call HostBuild))
|
|
|
|
$(eval $(call BuildPackage,node))
|
2017-04-03 12:21:39 +00:00
|
|
|
$(eval $(call BuildPackage,node-npm))
|