node: bump to 8.10.0
[feed/packages.git] / lang / node / Makefile
1 #
2 # Copyright (C) 2006-2017 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:=v8.10.0
12 PKG_RELEASE:=1
13 PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
14 PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
15 PKG_HASH:=b72d4e71618d6bcbd039b487b51fa7543631a4ac3331d7caf69bdf55b5b2901a
16
17 HOST_BUILD_DEPENDS:=python/host
18 PKG_BUILD_DEPENDS:=python/host
19
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>, Adrian Panella <ianchi74@outlook.com>
27 PKG_LICENSE:=MIT
28 PKG_LICENSE_FILES:=LICENSE
29
30 include $(INCLUDE_DIR)/host-build.mk
31 include $(INCLUDE_DIR)/package.mk
32
33 define Package/node
34 SECTION:=lang
35 CATEGORY:=Languages
36 SUBMENU:=Node.js
37 TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
38 URL:=http://nodejs.org/
39 DEPENDS:=@(HAS_FPU||KERNEL_MIPS_FPU_EMULATOR) +libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt +NODEJS_ICU:icu
40 endef
41
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.
46 endef
47
48 define Package/node-npm
49 SECTION:=lang
50 CATEGORY:=Languages
51 SUBMENU:=Node.js
52 TITLE:=NPM stands for Node Package Manager
53 URL:=http://npmjs.com/
54 DEPENDS:=+node
55 endef
56
57 define Package/node-npm/description
58 NPM is the package manager for NodeJS
59 endef
60
61 define Package/node/config
62 menu "Module Selection"
63
64 config NODEJS_ICU
65 bool "enable i18n features"
66 default n
67
68 endmenu
69 endef
70
71 NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
72
73 MAKE_VARS+= \
74 DESTCPU=$(NODEJS_CPU)
75
76 CONFIGURE_ARGS:= \
77 --dest-cpu=$(NODEJS_CPU) \
78 --dest-os=linux \
79 --without-snapshot \
80 --shared-zlib \
81 --shared-openssl \
82 --prefix=/usr
83
84 ifneq ($(findstring arm,$(NODEJS_CPU)),)
85 ifeq ($(CONFIG_SOFT_FLOAT),y)
86 CONFIGURE_ARGS+= --with-arm-float-abi=softfp
87 else
88
89 CONFIGURE_ARGS+= --with-arm-float-abi=hard
90
91 ifneq ($(findstring vfp,$(CONFIG_CPU_TYPE)),)
92 ARM_FPU=vfp
93 endif
94
95 ifneq ($(findstring vfpv3,$(CONFIG_CPU_TYPE)),)
96 ARM_FPU=vfpv3
97 endif
98
99 ifneq ($(findstring vfpv3-d16,$(CONFIG_CPU_TYPE)),)
100 ARM_FPU=vfpv3-d16
101 endif
102
103 ifneq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
104 ARM_FPU=neon
105 endif
106
107 CONFIGURE_ARGS+= --with-arm-fpu=$(ARM_FPU)
108 endif
109 endif
110
111 ifneq ($(findstring mips,$(NODEJS_CPU)),)
112 ifeq ($(CONFIG_SOFT_FLOAT),y)
113 CONFIGURE_ARGS+= \
114 --with-mips-float-abi=soft
115 endif
116 endif
117
118 ifeq ($(CONFIG_NODEJS_ICU),y)
119 CONFIGURE_ARGS+= \
120 --with-intl=system-icu
121 else
122 CONFIGURE_ARGS+= \
123 --with-intl=none
124 endif
125
126 HOST_CONFIGURE_VARS:=
127
128 HOST_CONFIGURE_ARGS:= \
129 --dest-os=linux \
130 --without-snapshot \
131 --shared-zlib \
132 --prefix=$(STAGING_DIR_HOSTPKG)
133
134 HOST_CONFIGURE_CMD:=python ./configure
135
136 define Build/InstallDev
137 $(INSTALL_DIR) $(1)/usr/include
138 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
139 endef
140
141 define Package/node/install
142 mkdir -p $(1)/usr/bin
143 $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
144 endef
145
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,npx} $(1)/usr/bin/
149 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE} $(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/bin/npx-cli.js $(1)/usr/lib/node_modules/npm/bin
152 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
154 endef
155
156 $(eval $(call HostBuild))
157 $(eval $(call BuildPackage,node))
158 $(eval $(call BuildPackage,node-npm))