2 # Copyright (C) 2006-2016 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
14 PKG_SOURCE
:=node-
$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=http
://nodejs.org
/dist/${PKG_VERSION}
16 PKG_MD5SUM
:=376140907bbe362f36065a30af04f020
18 HOST_BUILD_DEPENDS
:=python
/host
19 PKG_BUILD_DEPENDS
:=python
/host
23 HOST_BUILD_PARALLEL
:=1
26 PKG_MAINTAINER
:=John Crispin
<blogic@openwrt.org
>
29 include $(INCLUDE_DIR
)/host-build.mk
30 include $(INCLUDE_DIR
)/package.mk
36 TITLE
:=Node.js is a platform built on Chrome
's JavaScript runtime
37 URL:=http://nodejs.org/
38 DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib
41 define Package/node/description
42 Node.jsĀ® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
43 an event-driven
, non-blocking I
/O model that makes it lightweight and efficient. Node.js
'
44 package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
47 CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
60 ifneq ($(findstring arm,$(ARCH)),)
62 $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
65 ifneq ($(findstring mips,$(ARCH)),)
67 $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
72 HOST_CONFIGURE_ARGS:= \
75 --prefix=$(STAGING_DIR_HOSTPKG)
77 HOST_CONFIGURE_CMD:=python ./configure
79 define Build/InstallDev
80 $(INSTALL_DIR) $(1)/usr/include
81 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
84 define Package/node/install
85 mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
86 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
93 $(eval $(call HostBuild))
94 $(eval $(call BuildPackage,node))