noddos: Noddos v0.5.0 with mDNS / DNS-SD support
[feed/packages.git] / lang / node / Makefile
1 #
2 # Copyright (C) 2006-2016 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:=v4.4.5
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
16 PKG_MD5SUM:=376140907bbe362f36065a30af04f020
17
18 HOST_BUILD_DEPENDS:=python/host
19 PKG_BUILD_DEPENDS:=python/host
20 PKG_INSTALL:=1
21 PKG_USE_MIPS16:=0
22
23 HOST_BUILD_PARALLEL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
27 PKG_LICENSE:=
28
29 include $(INCLUDE_DIR)/host-build.mk
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/node
33 SECTION:=lang
34 CATEGORY:=Languages
35 SUBMENU:=Node.js
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
39 endef
40
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.
45 endef
46
47 define Package/node-npm
48 SECTION:=lang
49 CATEGORY:=Languages
50 SUBMENU:=Node.js
51 TITLE:=NPM stands for Node Package Manager
52 URL:=http://npmjs.com/
53 DEPENDS:=+node
54 endef
55
56 define Package/node-npm/description
57 NPM is the package manager for NodeJS
58 endef
59
60 CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
61
62 MAKE_VARS += \
63 DESTCPU=$(CPU)
64
65 CONFIGURE_ARGS= \
66 --dest-cpu=$(CPU) \
67 --dest-os=linux \
68 --without-snapshot \
69 --shared-zlib \
70 --shared-openssl \
71 --prefix=/usr
72
73 ifneq ($(findstring arm,$(ARCH)),)
74 CONFIGURE_ARGS+= \
75 $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
76 endif
77
78 ifneq ($(findstring mips,$(ARCH)),)
79 CONFIGURE_ARGS+= \
80 $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
81 endif
82
83 HOST_CONFIGURE_VARS:=
84
85 HOST_CONFIGURE_ARGS:= \
86 --dest-os=linux \
87 --without-snapshot \
88 --prefix=$(STAGING_DIR_HOSTPKG)
89
90 HOST_CONFIGURE_CMD:=python ./configure
91
92 define Build/InstallDev
93 $(INSTALL_DIR) $(1)/usr/include
94 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
95 endef
96
97 define Package/node/install
98 mkdir -p $(1)/usr/bin
99 $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
100 endef
101
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/
109 endef
110
111 $(eval $(call HostBuild))
112 $(eval $(call BuildPackage,node))
113 $(eval $(call BuildPackage,node-npm))