1 ################################################################################
5 ################################################################################
7 NODEJS_VERSION
= 0.8.22
8 NODEJS_SOURCE
= node-v
$(NODEJS_VERSION
).
tar.gz
9 NODEJS_SITE
= http
://nodejs.org
/dist/v
$(NODEJS_VERSION
)
10 NODEJS_DEPENDENCIES
= host-python host-nodejs \
11 $(call qstrip
,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS
))
12 HOST_NODEJS_DEPENDENCIES
= host-python
13 NODEJS_LICENSE
= MIT
(core code
); MIT
, Apache and BSD family licenses
(Bundled components
)
14 NODEJS_LICENSE_FILES
= LICENSE
16 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
17 NODEJS_DEPENDENCIES
+= openssl
20 define HOST_NODEJS_CONFIGURE_CMDS
21 # Build with the static, built-in OpenSSL which is supplied as part of
22 # the nodejs source distribution. This is needed on the host because
23 # NPM is non-functional without it, and host-openssl isn't part of
27 --prefix=$(HOST_DIR
)/usr \
34 define HOST_NODEJS_BUILD_CMDS
35 $(HOST_MAKE_ENV
) $(MAKE
) -C
$(@D
)
38 define HOST_NODEJS_INSTALL_CMDS
39 $(HOST_MAKE_ENV
) $(MAKE
) -C
$(@D
) install
44 else ifeq ($(BR2_x86_64
),y
)
46 else ifeq ($(BR2_arm
),y
)
48 # V8 needs to know what floating point ABI the target is using. There's also
49 # a 'hard' option which we're not exposing here at the moment, because
50 # buildroot itself doesn't really support it at present.
51 ifeq ($(BR2_SOFT_FLOAT
),y
)
58 define NODEJS_CONFIGURE_CMDS
60 $(TARGET_CONFIGURE_OPTS
) \
65 $(if
$(BR2_PACKAGE_OPENSSL
),--shared-openssl
,--without-ssl
) \
66 $(if
$(BR2_PACKAGE_NODEJS_NPM
),,--without-npm
) \
69 --dest-cpu
=$(NODEJS_CPU
) \
70 $(if
$(NODEJS_ARM_FP
),--with-arm-float-abi
=$(NODEJS_ARM_FP
)) \
75 define NODEJS_BUILD_CMDS
76 $(TARGET_MAKE_ENV
) $(MAKE
) $(TARGET_CONFIGURE_OPTS
) -C
$(@D
)
80 # Build the list of modules to install based on the booleans for
81 # popular modules, as well as the "additional modules" list.
83 NODEJS_MODULES_LIST
= $(call qstrip
,\
84 $(if
$(BR2_PACKAGE_NODEJS_MODULES_EXPRESS
),express
) \
85 $(if
$(BR2_PACKAGE_NODEJS_MODULES_COFFEESCRIPT
),coffee-script
) \
86 $(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL
))
89 # We can only call NPM if there's something to install.
91 ifneq ($(NODEJS_MODULES_LIST
),)
92 define NODEJS_INSTALL_MODULES
93 # If you're having trouble with module installation, adding -d to the
94 # npm install call below and setting npm_config_rollback=false can both
95 # help in diagnosing the problem.
96 (cd
$(TARGET_DIR
)/usr
/lib
&& mkdir
-p node_modules
&& \
97 $(TARGET_CONFIGURE_OPTS
) \
99 npm_config_arch
=$(NODEJS_CPU
) \
100 npm_config_nodedir
=$(BUILD_DIR
)/nodejs-
$(NODEJS_VERSION
) \
101 $(HOST_DIR
)/usr
/bin
/npm
install \
102 $(NODEJS_MODULES_LIST
) \
107 define NODEJS_INSTALL_TARGET_CMDS
108 $(MAKE
) $(TARGET_CONFIGURE_OPTS
) -C
$(@D
) DESTDIR
=$(TARGET_DIR
) install
109 $(NODEJS_INSTALL_MODULES
)
112 # node.js configure is a Python script and does not use autotools
113 $(eval
$(generic-package
))
114 $(eval
$(host-generic-package
))