libmicrohttpd: build parallel
[feed/packages.git] / lang / node / Makefile
1 #
2 # Copyright (C) 2006-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=node
11 PKG_VERSION:=v0.12.7
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=node-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
16
17 HOST_BUILD_DEPENDS:=python/host
18 PKG_BUILD_DEPENDS:=python/host
19 PKG_INSTALL:=1
20 PKG_USE_MIPS16:=0
21
22 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
23 PKG_LICENSE:=
24
25 include $(INCLUDE_DIR)/host-build.mk
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/node
29 SECTION:=lang
30 CATEGORY:=Languages
31 SUBMENU:=Node.js
32 TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
33 URL:=http://nodejs.org/
34 DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv
35 endef
36
37 define Package/node/description
38 Node.jsĀ® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
39 an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
40 package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
41 endef
42
43 CONFIGURE_ARGS= \
44 --dest-cpu=$(CONFIG_ARCH) \
45 --dest-os=linux \
46 --without-snapshot \
47 --shared-zlib \
48 --shared-openssl \
49 --prefix=/usr
50
51 HOST_CONFIGURE_VARS:=
52 HOST_CONFIGURE_ARGS:= \
53 --dest-os=linux \
54 --without-snapshot \
55 --prefix=$(STAGING_DIR_HOST)/
56
57 HOST_CONFIGURE_CMD:=python ./configure
58
59 define Build/InstallDev
60 $(INSTALL_DIR) $(1)/usr/include
61 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
62 endef
63
64 define Package/node/install
65 mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
66 $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
69 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
71 endef
72
73 $(eval $(call HostBuild))
74 $(eval $(call BuildPackage,node))