Skip to contentSkip to conversation

nodejs: new package

PATCH Superseded Jonathan Liu 2 participants 5 messages Aug 12, 2012 – Aug 13, 2012

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover nodejs: new package

Jonathan Liu (2):
python: enable bz2 module for host build
nodejs: new package

 package/Config.in        |  1 +
 package/nodejs/Config.in | 38 ++++++++++++++++++++++++++++++++++++++
 package/nodejs/nodejs.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++
 package/python/python.mk |  1 -
 4 files changed, 83 insertions(+), 1 deletion(-)
 create mode 100644 package/nodejs/Config.in
 create mode 100644 package/nodejs/nodejs.mk
Signature · 1 line
1.7.11.3
#1 lore raw

PATCH v3 1/2 python: enable bz2 module for host build

The bz2 module is required for building some Python packages.

---
 package/python/python.mk | 1 -
 1 file changed, 1 deletion(-)
package/python/python.mk +0 -1
index fae4e5c..7b314ab 100644
@@ -27,7 +27,6 @@ HOST_PYTHON_CONF_OPT += 	\
 	--disable-gdbm		\
 	--disable-bsddb		\
 	--disable-test-modules	\
-	--disable-bz2		\
 	--disable-ssl
 
 HOST_PYTHON_MAKE_ENV = \
Signature · 1 line
1.7.11.3
#2 lore raw

PATCH v3 2/2 nodejs: new package

In reply to Jonathan Liu
---
 package/Config.in        |  1 +
 package/nodejs/Config.in | 38 ++++++++++++++++++++++++++++++++++++++
 package/nodejs/nodejs.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 83 insertions(+)
 create mode 100644 package/nodejs/Config.in
 create mode 100644 package/nodejs/nodejs.mk
package/Config.in +1 -0
index f308de7..76c589b 100644
@@ -263,6 +263,7 @@ source "package/xavante/Config.in"
 endmenu
 endif
 source "package/microperl/Config.in"
+source "package/nodejs/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
 if BR2_PACKAGE_PYTHON
package/nodejs/Config.in new file +38 -0
new file mode 100644
index 0000000..feb279b
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_NODEJS
+	bool "nodejs"
+	help
+	  Event-driven I/O server-side JavaScript environment based on V8.
+
+	  http://nodejs.org/
+
+if BR2_PACKAGE_NODEJS
+
+config BR2_PACKAGE_NODEJS_SSL
+	bool "enable SSL support"
+	default y
+	help
+	  Enable SSL support.
+
+if BR2_PACKAGE_NODEJS_SSL
+
+config BR2_PACKAGE_NODEJS_SHARED_OPENSSL
+	bool "use shared OpenSSL"
+	default y
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Use shared OpenSSL library instead of statically linked
+	  OpenSSL bundled with node.js.
+
+endif
+
+config BR2_PACKAGE_NODEJS_NPM
+	bool "npm"
+	help
+	  Enable npm (Node Package Manager).
+
+config BR2_PACKAGE_NODEJS_WAF
+	bool "waf"
+	help
+	  Enable node-waf for building native modules.
+
+endif
package/nodejs/nodejs.mk new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
1.7.11.3
#3 lore raw

PATCH v3 2/2 nodejs: new package

Le Sun, 12 Aug 2012 18:52:05 +1000,
Jonathan Liu <[email protected]> a ?crit :

Quoted 7 lines
package/nodejs/Config.in new file +4 -0
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_NODEJS
+	bool "nodejs"
+	help
+	  Event-driven I/O server-side JavaScript environment based on V8.

package/nodejs/Config.in line 14

Quoted 10 lines
package/nodejs/Config.in new file +10 -0
+
+	  http://nodejs.org/
+
+if BR2_PACKAGE_NODEJS
+
+config BR2_PACKAGE_NODEJS_SSL
+	bool "enable SSL support"
+	default y
+	help
+	  Enable SSL support.

In general, we don't add a suboption to enable OpenSSL support: is the openssl package is enabled, we automatically enable openssl support in the package.

package/nodejs/Config.in line 26

Quoted 11 lines
package/nodejs/Config.in new file +11 -0
+if BR2_PACKAGE_NODEJS_SSL
+
+config BR2_PACKAGE_NODEJS_SHARED_OPENSSL
+	bool "use shared OpenSSL"
+	default y
+	select BR2_PACKAGE_OPENSSL
+	help
+	  Use shared OpenSSL library instead of statically linked
+	  OpenSSL bundled with node.js.
+
+endif

I think this should always be the case: use the Buildroot openssl package if enabled, otherwise disable ssl support. Is there any advantage to using the built-in version?

Quoted 6 lines
package/nodejs/Config.in new file +6 -0
+define NODEJS_CONFIGURE_CMDS
+	(cd $(@D); rm -rf config.cache; \
+		$(TARGET_CONFIGURE_ARGS) \
+		$(TARGET_CONFIGURE_OPTS) \
+		PATH="$(HOST_DIR)/usr/bin:$(PATH)" \
+		./configure \

package/nodejs/Config.in

Quoted 10 lines
package/nodejs/Config.in new file +10 -0
+		--prefix=/usr \
+		--without-snapshot \
+		$(if $(BR2_PACKAGE_NODEJS_SHARED_OPENSSL),--shared-openssl,) \
+		$(if $(BR2_PACKAGE_NODEJS_SSL),,--without-ssl) \
+		$(if $(BR2_PACKAGE_NODEJS_NPM),,--without-npm) \
+		$(if $(BR2_PACKAGE_NODEJS_WAF),,--without-waf) \
+		--without-dtrace \
+		--without-etw \
+	)
+endef

You're using the autotools-package infrastructure, so don't override the _CONFIGURE_CMDS. You should simply need to do:

NODEJS_CONF_OPT =

	--without-snapshot \
	$(if $(BR2_PACKAGE_NODEJS_SHARED_OPENSSL),--shared-openssl,) \
	$(if $(BR2_PACKAGE_NODEJS_SSL),,--without-ssl) \
	$(if $(BR2_PACKAGE_NODEJS_NPM),,--without-npm) \
	$(if $(BR2_PACKAGE_NODEJS_WAF),,--without-waf) \
	--without-dtrace \
	--without-etw

package/nodejs/Config.in

Quoted 2 lines
package/nodejs/Config.in new file +2 -0
+NODEJS_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)
+NODEJS_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) install

And you can get rid of this as well.

package/nodejs/Config.in

Quoted 9 lines
package/nodejs/Config.in new file +9 -0
+define NODEJS_INSTALL_TARGET_CMDS
+       $(INSTALL) -D -m 775 $(@D)/out/Release/node $(TARGET_DIR)/usr/bin/node
+endef
+
+define NODEJS_UNINSTALL_TARGET_CMDS
+       rm -f $(TARGET_DIR)/usr/bin/node
+endef
+
+$(eval $(autotools-package))

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH v3 2/2 nodejs: new package

Quoted 16 lines · Thomas Petazzoni

Le Sun, 12 Aug 2012 18:52:05 +1000,
Jonathan Liu <[email protected]> a ?crit :

Quoted 13 lines
package/nodejs/Config.in new file +10 -0
@@ -0,0 +1,38 @@
+config BR2_PACKAGE_NODEJS
+     bool "nodejs"
+     help
+       Event-driven I/O server-side JavaScript environment based on V8.
+
+       http://nodejs.org/
+
+if BR2_PACKAGE_NODEJS
+
+config BR2_PACKAGE_NODEJS_SSL
Quoted 9 lines

package/nodejs/Config.in line 14

Quoted 4 lines
package/nodejs/Config.in new file +4 -0
+     bool "enable SSL support"
+     default y
+     help
+       Enable SSL support.

In general, we don't add a suboption to enable OpenSSL support: is the openssl package is enabled, we automatically enable openssl support in the package.

Ok.

Quoted 17 lines

package/nodejs/Config.in line 26

Quoted 12 lines
package/nodejs/Config.in new file +11 -0
+if BR2_PACKAGE_NODEJS_SSL
+
+config BR2_PACKAGE_NODEJS_SHARED_OPENSSL
+     bool "use shared OpenSSL"
+     default y
+     select BR2_PACKAGE_OPENSSL
+     help
+       Use shared OpenSSL library instead of statically linked
+       OpenSSL bundled with node.js.
+
+endif

I think this should always be the case: use the Buildroot openssl package if enabled, otherwise disable ssl support. Is there any advantage to using the built-in version?

Not much advantage I guess. I can remove it.

Quoted 22 lines

package/nodejs/Config.in line 34

Quoted 10 lines
package/nodejs/Config.in new file +9 -0
+define NODEJS_CONFIGURE_CMDS
+     (cd $(@D); rm -rf config.cache; \
+             $(TARGET_CONFIGURE_ARGS) \
+             $(TARGET_CONFIGURE_OPTS) \
+             PATH="$(HOST_DIR)/usr/bin:$(PATH)" \
+             ./configure \
+             --prefix=/usr \
+             --without-snapshot \
+             $(if

$(BR2_PACKAGE_NODEJS_SHARED_OPENSSL),--shared-openssl,) \

package/nodejs/Config.in

Quoted 7 lines
package/nodejs/Config.in new file +7 -0
+             $(if $(BR2_PACKAGE_NODEJS_SSL),,--without-ssl) \
+             $(if $(BR2_PACKAGE_NODEJS_NPM),,--without-npm) \
+             $(if $(BR2_PACKAGE_NODEJS_WAF),,--without-waf) \
+             --without-dtrace \
+             --without-etw \
+     )
+endef

You're using the autotools-package infrastructure, so don't override the _CONFIGURE_CMDS. You should simply need to do:

Quoted 11 lines

NODEJS_CONF_OPT =

        --without-snapshot \
        $(if $(BR2_PACKAGE_NODEJS_SHARED_OPENSSL),--shared-openssl,) \
        $(if $(BR2_PACKAGE_NODEJS_SSL),,--without-ssl) \
        $(if $(BR2_PACKAGE_NODEJS_NPM),,--without-npm) \
        $(if $(BR2_PACKAGE_NODEJS_WAF),,--without-waf) \
        --without-dtrace \
        --without-etw
Quoted 1 line

+NODEJS_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)

The make command needs have CC, CXX, etc. set again because node.js isn't using a real autotools based configure. It doesn't remember the variables. I am thinking I should probably change it back to generic package because it isn't a real autotools based system but just a Python-based configure behaves similar to autotools.

Quoted 4 lines
Quoted 1 line

+NODEJS_INSTALL_STAGING_OPT = DESTDIR=$(STAGING_DIR) install

And you can get rid of this as well.

Ok.

Quoted 12 lines

package/nodejs/Config.in

Quoted 3 lines
package/nodejs/Config.in new file +2 -0
+define NODEJS_INSTALL_TARGET_CMDS
+       $(INSTALL) -D -m 775 $(@D)/out/Release/node

$(TARGET_DIR)/usr/bin/node

package/nodejs/Config.in

Quoted 7 lines
package/nodejs/Config.in new file +7 -0
+endef
+
+define NODEJS_UNINSTALL_TARGET_CMDS
+       rm -f $(TARGET_DIR)/usr/bin/node
+endef
+
+$(eval $(autotools-package))

Regards,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120813/dd6130a1/attachment-0001.html>