-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathMakefile
More file actions
160 lines (131 loc) · 3.97 KB
/
Makefile
File metadata and controls
160 lines (131 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=node
ifeq ($(CONFIG_NODEJS_8),y)
PKG_VERSION:=v8.15.1
PKG_RELEASE:=1
PKG_MD5SUM:=8c1db510258220877e5bed48f1ea0c27
PATCH_DIR:=./patches/v8.x
else
ifeq ($(CONFIG_NODEJS_4),y)
PKG_VERSION:=v4.9.1
PKG_RELEASE:=1
PKG_MD5SUM:=b69940f0c201f753ec1eaffd35a36231
PATCH_DIR:=./patches/v4.x
else
PKG_VERSION:=v6.17.1
PKG_RELEASE:=1
PKG_MD5SUM:=61d29e619c9acf202349a5e89a4d3e56
PATCH_DIR:=./patches/v6.x
endif
endif
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DEPENDS:=python/host
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
HOST_BUILD_PARALLEL:=1
PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/node
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Node.js
TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
URL:=http://nodejs.org/
DEPENDS:=+libstdcpp +libopenssl +zlib +USE_UCLIBC:libpthread +USE_UCLIBC:librt
endef
define Package/node/description
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
endef
define Package/node-npm
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Node.js
TITLE:=NPM stands for Node Package Manager
URL:=http://npmjs.com/
DEPENDS:=+node
endef
define Package/node-npm/description
NPM is the package manager for Node.js
endef
define Package/node/config
menu "Configuration"
depends on PACKAGE_node
choice
prompt "Version Selection"
default NODEJS_6
help
Select node.js version.
config NODEJS_4
bool "4.x End-of-life : NO LONGER SUPPORTED"
config NODEJS_6
bool "6.x End-of-life : NO LONGER SUPPORTED"
config NODEJS_8
bool "8.x End-of-life : NO LONGER SUPPORTED"
endchoice
endmenu
endef
NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
MAKE_VARS+= \
DESTCPU=$(NODEJS_CPU)
CONFIGURE_VARS:= \
CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
CC_host="$(HOSTCC)"
CONFIGURE_ARGS:= \
--dest-cpu=$(NODEJS_CPU) \
--dest-os=linux \
--without-snapshot \
--shared-zlib \
--shared-openssl \
$(if $(CONFIG_NODEJS_4),,--with-intl=none) \
$(if $(findstring mips,$(NODEJS_CPU)), \
$(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft)) \
$(if $(findstring +neon,$(CONFIG_CPU_TYPE)),--with-arm-fpu=neon) \
$(if $(findstring +vfp",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfp) \
$(if $(findstring +vfpv3",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3-d16) \
$(if $(findstring +vfpv4",$(CONFIG_CPU_TYPE)),--with-arm-fpu=vfpv3) \
--prefix=/usr
HOST_CONFIGURE_VARS:=
HOST_CONFIGURE_ARGS:= \
--dest-os=linux \
--without-snapshot \
--with-intl=none \
--prefix=$(STAGING_DIR_HOST)
HOST_CONFIGURE_CMD:=python ./configure
define Build/Prepare
$(if $(findstring arm,$(NODEJS_CPU)), $(if $(CONFIG_SOFT_FLOAT), \
echo "You can't running Node.js on ARM CPU without hardware FPU."; \
exit 1; \
))
$(Build/Prepare/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef
define Package/node/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
endef
define Package/node-npm/install
$(INSTALL_DIR) $(1)/usr/lib/node_modules
$(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node_modules/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) ../lib/node_modules/npm/bin/npm-cli.js $(1)/usr/bin/npm
ifeq ($(CONFIG_NODEJS_8),y)
$(LN) ../lib/node_modules/npm/bin/npx-cli.js $(1)/usr/bin/npx
endif
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,node))
$(eval $(call BuildPackage,node-npm))