2 # Copyright (C) 2006-2017 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
13 PKG_SOURCE
:=node-
$(PKG_VERSION
).
tar.xz
14 PKG_SOURCE_URL
:=http
://nodejs.org
/dist/${PKG_VERSION}
15 PKG_HASH
:=04af4992238b19124ea56f1bcfda36827613a24eb3b00fc3b50f261a415a26e4
17 HOST_BUILD_DEPENDS
:=python
/host
18 PKG_BUILD_DEPENDS
:=python
/host
23 HOST_BUILD_PARALLEL
:=1
26 PKG_MAINTAINER
:=John Crispin
<blogic@openwrt.org
>, Adrian Panella
<ianchi74@outlook.com
>
28 PKG_LICENSE_FILES
:=LICENSE
30 include $(INCLUDE_DIR
)/host-build.mk
31 include $(INCLUDE_DIR
)/package.mk
37 TITLE
:=Node.js is a platform built on Chrome
's JavaScript runtime
38 URL:=http://nodejs.org/
39 DEPENDS:=+libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
42 define Package/node/description
43 Node.jsĀ® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
44 an event-driven
, non-blocking I
/O model that makes it lightweight and efficient. Node.js
'
45 package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
48 define Package/node-npm
52 TITLE:=NPM stands for Node Package Manager
53 URL:=http://npmjs.com/
57 define Package/node-npm/description
58 NPM is the package manager for NodeJS
61 define Package/node/config
62 menu "Module Selection"
65 bool "enable i18n features"
71 NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
77 --dest-cpu=$(NODEJS_CPU) \
84 ifneq ($(findstring arm,$(NODEJS_CPU)),)
85 ifeq ($(CONFIG_SOFT_FLOAT),y)
86 CONFIGURE_ARGS+= --with-arm-float-abi=softfp
89 CONFIGURE_ARGS+= --with-arm-float-abi=hard
91 ifneq ($(findstring vfp,$(CONFIG_CPU_TYPE)),)
95 ifneq ($(findstring vfpv3,$(CONFIG_CPU_TYPE)),)
99 ifneq ($(findstring vfpv3-d16,$(CONFIG_CPU_TYPE)),)
103 ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
107 CONFIGURE_ARGS+= --with-arm-fpu=$(ARM_FPU)
111 ifneq ($(findstring mips,$(NODEJS_CPU)),)
112 ifeq ($(CONFIG_SOFT_FLOAT),y)
114 --with-mips-float-abi=soft
118 ifeq ($(CONFIG_NODEJS_ICU),y)
120 --with-intl=system-icu
126 HOST_CONFIGURE_VARS:=
128 HOST_CONFIGURE_ARGS:= \
132 --prefix=$(STAGING_DIR_HOSTPKG)
134 HOST_CONFIGURE_CMD:=python ./configure
136 define Build/InstallDev
137 $(INSTALL_DIR) $(1)/usr/include
138 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
141 define Package/node/install
142 mkdir -p $(1)/usr/bin
143 $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
146 define Package/node-npm/install
147 mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
148 $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
150 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
151 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
152 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
155 $(eval $(call HostBuild))
156 $(eval $(call BuildPackage,node))
157 $(eval $(call BuildPackage,node-npm))