diff mbox

[1/4] package/nodejs: Update to allow selecting node.js version

Message ID 1434298376-31893-1-git-send-email-martin@barkynet.com
State Superseded
Headers show

Commit Message

Martin Bark June 14, 2015, 4:12 p.m. UTC
Signed-off-by: Martin Bark <martin@barkynet.com>
---
 .../{ => 0.10.38}/0001-remove-python-bz2-dependency.patch  |  0
 .../0002-gyp-force-link-command-to-use-CXX.patch           |  0
 .../nodejs/{ => 0.10.38}/0003-use-python-variable.patch    |  0
 .../0004-fix-build-error-without-OpenSSL-support.patch     |  0
 package/nodejs/Config.in                                   | 14 ++++++++++++++
 package/nodejs/nodejs.mk                                   |  2 +-
 6 files changed, 15 insertions(+), 1 deletion(-)
 rename package/nodejs/{ => 0.10.38}/0001-remove-python-bz2-dependency.patch (100%)
 rename package/nodejs/{ => 0.10.38}/0002-gyp-force-link-command-to-use-CXX.patch (100%)
 rename package/nodejs/{ => 0.10.38}/0003-use-python-variable.patch (100%)
 rename package/nodejs/{ => 0.10.38}/0004-fix-build-error-without-OpenSSL-support.patch (100%)

Comments

Thomas Petazzoni June 14, 2015, 8:53 p.m. UTC | #1
Dear Martin Bark,

On Sun, 14 Jun 2015 17:12:53 +0100, Martin Bark wrote:
> Signed-off-by: Martin Bark <martin@barkynet.com>

What is the motivation for supporting more than one version of NodeJS
at a time?

We generally try to avoid supporting multiple versions of a given
component, unless there are some really good reasons to do so (like
python2 vs. python3, or qt4 vs. qt5).

Thanks,

Thomas
Jörg Krause June 15, 2015, 7:38 a.m. UTC | #2
Dear Thomas,

On So, 2015-06-14 at 22:53 +0200, Thomas Petazzoni wrote:
> Dear Martin Bark,
> 
> On Sun, 14 Jun 2015 17:12:53 +0100, Martin Bark wrote:
> > Signed-off-by: Martin Bark <martin@barkynet.com>
> 
> What is the motivation for supporting more than one version of NodeJS
> at a time?

Nodejs 0.10 and 0.12 use different versions of the V8 engine. The V8
version used in 0.12 unfortunatly dropped support for the ARMv5
architecture.

> We generally try to avoid supporting multiple versions of a given
> component, unless there are some really good reasons to do so (like
> python2 vs. python3, or qt4 vs. qt5).

Nodejs 0.10 is still maintaned and new versions will follow. I would
suggest to support both version until maintenance is dropped.

Best regards
Jörg Krause
Martin Bark June 16, 2015, 9:56 a.m. UTC | #3
Dear Thomas & Jörg,

On 15 June 2015 at 08:38, Jörg Krause <joerg.krause@embedded.rocks> wrote:
> Dear Thomas,
>
> On So, 2015-06-14 at 22:53 +0200, Thomas Petazzoni wrote:
>> Dear Martin Bark,
>>
>> What is the motivation for supporting more than one version of NodeJS
>> at a time?
>
> Nodejs 0.10 and 0.12 use different versions of the V8 engine. The V8
> version used in 0.12 unfortunatly dropped support for the ARMv5
> architecture.

Yes and now i think about it i probably should have added something like

    depends on !BR2_ARM_CPU_ARMV5

for node.js v0.12.4.  V8 after version 3.18 increased the minimum to
ARMv6 with VFPv2.  See
https://groups.google.com/forum/#!topic/v8-users/aSOFbaAQvMk.  To
confirm I just ran a test and the qemu_arm_versatile_defconfig will
build node.js v0.12.4 but it fails to run. qemu_arm_vexpress_defconfig
will build and run node v0.12.4.

>
>> We generally try to avoid supporting multiple versions of a given
>> component, unless there are some really good reasons to do so (like
>> python2 vs. python3, or qt4 vs. qt5).
>
> Nodejs 0.10 is still maintaned and new versions will follow. I would
> suggest to support both version until maintenance is dropped.
>

That was my thought too.  There are some details on the upcoming
0.10.39 release here https://github.com/joyent/node/milestones/0.10.39

Thanks

Martin
diff mbox

Patch

diff --git a/package/nodejs/0001-remove-python-bz2-dependency.patch b/package/nodejs/0.10.38/0001-remove-python-bz2-dependency.patch
similarity index 100%
rename from package/nodejs/0001-remove-python-bz2-dependency.patch
rename to package/nodejs/0.10.38/0001-remove-python-bz2-dependency.patch
diff --git a/package/nodejs/0002-gyp-force-link-command-to-use-CXX.patch b/package/nodejs/0.10.38/0002-gyp-force-link-command-to-use-CXX.patch
similarity index 100%
rename from package/nodejs/0002-gyp-force-link-command-to-use-CXX.patch
rename to package/nodejs/0.10.38/0002-gyp-force-link-command-to-use-CXX.patch
diff --git a/package/nodejs/0003-use-python-variable.patch b/package/nodejs/0.10.38/0003-use-python-variable.patch
similarity index 100%
rename from package/nodejs/0003-use-python-variable.patch
rename to package/nodejs/0.10.38/0003-use-python-variable.patch
diff --git a/package/nodejs/0004-fix-build-error-without-OpenSSL-support.patch b/package/nodejs/0.10.38/0004-fix-build-error-without-OpenSSL-support.patch
similarity index 100%
rename from package/nodejs/0004-fix-build-error-without-OpenSSL-support.patch
rename to package/nodejs/0.10.38/0004-fix-build-error-without-OpenSSL-support.patch
diff --git a/package/nodejs/Config.in b/package/nodejs/Config.in
index 3140683..8b0573a 100644
--- a/package/nodejs/Config.in
+++ b/package/nodejs/Config.in
@@ -22,6 +22,20 @@  comment "nodejs needs a toolchain w/ C++, threads"
 
 if BR2_PACKAGE_NODEJS
 
+choice
+	prompt "Node.js Version"
+	default BR2_BR2_PACKAGE_NODEJS_0_10_38
+	help
+	  Select the version of Node.js you wish to use.
+
+	config BR2_BR2_PACKAGE_NODEJS_0_10_38
+		bool "v0.10.38"
+
+endchoice
+
+config BR2_PACKAGE_NODEJS_VERSION_STRING
+	string
+	default "0.10.38"	if BR2_BR2_PACKAGE_NODEJS_0_10_38
 menu "Module Selection"
 
 config BR2_PACKAGE_NODEJS_NPM
diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 5ee7714..59e03b0 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -4,7 +4,7 @@ 
 #
 ################################################################################
 
-NODEJS_VERSION = 0.10.38
+NODEJS_VERSION = $(call qstrip,$(BR2_PACKAGE_NODEJS_VERSION_STRING))
 NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.gz
 NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
 NODEJS_DEPENDENCIES = host-python host-nodejs zlib \