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 define Package/node-npm
51 TITLE:=NPM stands for Node Package Manager
52 URL:=http://npmjs.com/
56 define Package/node-npm/description
57 NPM is the package manager for NodeJS
60 CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
73 ifneq ($(findstring arm,$(ARCH)),)
75 $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
78 ifneq ($(findstring mips,$(ARCH)),)
80 $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
85 HOST_CONFIGURE_ARGS:= \
88 --prefix=$(STAGING_DIR_HOSTPKG)
90 HOST_CONFIGURE_CMD:=python ./configure
92 define Build/InstallDev
93 $(INSTALL_DIR) $(1)/usr/include
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
97 define Package/node/install
99 $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
102 define Package/node-npm/install
103 mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
104 $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
106 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
107 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
111 $(eval $(call HostBuild))
112 $(eval $(call BuildPackage,node))
113 $(eval $(call BuildPackage,node-npm))