Move buildroot to bsp directory.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
Remove dependency on Python bz2 module
|
||||
|
||||
The Python bz2 module is only needed in certain cases, so only import
|
||||
it when needed. In the normal nodejs build, this allows to remove the
|
||||
dependency on this module.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Index: b/deps/v8/tools/js2c.py
|
||||
===================================================================
|
||||
--- a/deps/v8/tools/js2c.py
|
||||
+++ b/deps/v8/tools/js2c.py
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
import os, re, sys, string
|
||||
import jsmin
|
||||
-import bz2
|
||||
|
||||
|
||||
def ToCAsciiArray(lines):
|
||||
@@ -344,6 +343,7 @@
|
||||
else:
|
||||
raw_sources_declaration = RAW_SOURCES_COMPRESSION_DECLARATION
|
||||
if env['COMPRESSION'] == 'bz2':
|
||||
+ import bz2
|
||||
all_sources = bz2.compress("".join(all_sources))
|
||||
total_length = len(all_sources)
|
||||
sources_data = ToCArray(all_sources)
|
||||
@@ -0,0 +1,26 @@
|
||||
From 00d809e9305241f8636a2d75e22c493293e6971a Mon Sep 17 00:00:00 2001
|
||||
From: Samuel Martin <s.martin49@gmail.com>
|
||||
Date: Sun, 20 Apr 2014 15:03:01 +0200
|
||||
Subject: [PATCH] gyp: force link command to use CXX
|
||||
|
||||
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
||||
---
|
||||
tools/gyp/pylib/gyp/generator/make.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
|
||||
index 0de510e..54e4c96 100644
|
||||
--- a/tools/gyp/pylib/gyp/generator/make.py
|
||||
+++ b/tools/gyp/pylib/gyp/generator/make.py
|
||||
@@ -134,7 +134,7 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
|
||||
# special "figure out circular dependencies" flags around the entire
|
||||
# input list during linking.
|
||||
quiet_cmd_link = LINK($(TOOLSET)) $@
|
||||
-cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
|
||||
+cmd_link = $(CXX.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
|
||||
|
||||
# We support two kinds of shared objects (.so):
|
||||
# 1) shared_library, which is just bundling together many dependent libraries
|
||||
--
|
||||
1.9.2
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
Use a python variable instead of hardcoding Python
|
||||
|
||||
The nodejs build system uses python in a number of locations. However,
|
||||
there are some locations where it hardcodes 'python' as the Python
|
||||
interpreter. However, this causes problems when we need to use python2
|
||||
instead of just python.
|
||||
|
||||
This patch fixes that by using the python variable already in place in
|
||||
the nodejs build system.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/deps/v8/tools/gyp/v8.gyp
|
||||
===================================================================
|
||||
--- a/deps/v8/tools/gyp/v8.gyp
|
||||
+++ b/deps/v8/tools/gyp/v8.gyp
|
||||
@@ -792,7 +792,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<@(_outputs)',
|
||||
'CORE',
|
||||
@@ -810,7 +810,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<@(_outputs)',
|
||||
'EXPERIMENTAL',
|
||||
@@ -840,7 +840,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/gen-postmortem-metadata.py',
|
||||
'<@(_outputs)',
|
||||
'<@(heapobject_files)'
|
||||
@@ -0,0 +1,47 @@
|
||||
From 0bc482abeb814573251ecafb5a1e045c885b13a2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
|
||||
Date: Mon, 25 May 2015 16:22:57 +0200
|
||||
Subject: [PATCH 1/1] Fix musl __USE_MISC issue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The musl C library does not define __USE_MISC and so libuv (built-in dependency)
|
||||
does not use the correct struct stat definition for musl.
|
||||
|
||||
The feature test macro __USE_MISC is defined by glibc if _BSD_SOURCE or
|
||||
_SVID_SOURCE is defined.
|
||||
|
||||
The libuv build system enables the feature test macro _GNU_SOURCE for linux
|
||||
builds.
|
||||
|
||||
Since glibc 2.19, defining _GNU_SOURCE also has the effect of implicitly
|
||||
defining _DEFAULT_SOURCE - the replacement for _BSD_SOURCE and _SVID_SOURCE.
|
||||
|
||||
In glibc versions before 2.20, defining _GNU_SOURCE also had the effect of
|
||||
implicitly defining _BSD_SOURCE and _SVID_SOURCE. This is also true for uClibc.
|
||||
|
||||
Alltogether, we can safely replace __USE_MISC by _GNU_SOURCE to support building
|
||||
nodejs 0.10.x with the musl C library.
|
||||
|
||||
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
|
||||
---
|
||||
deps/uv/src/fs-poll.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/uv/src/fs-poll.c b/deps/uv/src/fs-poll.c
|
||||
index ad27f18..094447e 100644
|
||||
--- a/deps/uv/src/fs-poll.c
|
||||
+++ b/deps/uv/src/fs-poll.c
|
||||
@@ -198,7 +198,7 @@ static int statbuf_eq(const uv_statbuf_t* a, const uv_statbuf_t* b) {
|
||||
|
||||
/* Jump through a few hoops to get sub-second granularity on Linux. */
|
||||
# if defined(__linux__)
|
||||
-# if defined(__USE_MISC) /* _BSD_SOURCE || _SVID_SOURCE */
|
||||
+# if defined(_GNU_SOURCE) /* _BSD_SOURCE || _SVID_SOURCE */
|
||||
if (a->st_ctim.tv_nsec != b->st_ctim.tv_nsec) return 0;
|
||||
if (a->st_mtim.tv_nsec != b->st_mtim.tv_nsec) return 0;
|
||||
# else
|
||||
--
|
||||
2.4.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 1cc08f6ceacbb0e5ba1f4638ca3a97ac002d7792 Mon Sep 17 00:00:00 2001
|
||||
From: "Bark, Martin" <martin.bark@te.com>
|
||||
Date: Mon, 14 Dec 2015 13:26:10 +0000
|
||||
Subject: [PATCH 2/2] Fix support for uClibc-ng
|
||||
|
||||
uClibc-ng is currently at v1.0.9. The patch corrects the uClibc
|
||||
version test so that HAVE_IFADDRS_H is defined for uClibc versions
|
||||
after v0.9.32.
|
||||
|
||||
Submitted upstream to libuv and accepted, see
|
||||
https://github.com/libuv/libuv/pull/653 and
|
||||
https://github.com/libuv/libuv/commit/c861972
|
||||
|
||||
Signed-off-by: Bark, Martin <martin.bark@te.com>
|
||||
---
|
||||
deps/uv/src/unix/linux-core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c
|
||||
index e6e6828..6cbbb71 100644
|
||||
--- a/deps/uv/src/unix/linux-core.c
|
||||
+++ b/deps/uv/src/unix/linux-core.c
|
||||
@@ -39,7 +39,7 @@
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
#ifdef __UCLIBC__
|
||||
-# if __UCLIBC_MAJOR__ < 0 || __UCLIBC_MINOR__ < 9 || __UCLIBC_SUBLEVEL__ < 32
|
||||
+# if __UCLIBC_MAJOR__ < 0 && __UCLIBC_MINOR__ < 9 && __UCLIBC_SUBLEVEL__ < 32
|
||||
# undef HAVE_IFADDRS_H
|
||||
# endif
|
||||
#endif
|
||||
--
|
||||
2.6.2
|
||||
@@ -0,0 +1,31 @@
|
||||
From 3d4817c152d6f3afddcc699949c4d1664da91e2b Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Tue, 30 Jun 2015 09:43:11 +0100
|
||||
Subject: [PATCH 1/4] Remove dependency on Python bz2 module
|
||||
|
||||
Do not import the bz2 module, it is not used.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
[Martin: adapt to 0.12.5]
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
[yann.morin.1998@free.fr: adapt to 4.1.2]
|
||||
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
---
|
||||
deps/v8/tools/js2c.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/v8/tools/js2c.py b/deps/v8/tools/js2c.py
|
||||
index 77485f6..371caf5 100755
|
||||
--- a/deps/v8/tools/js2c.py
|
||||
+++ b/deps/v8/tools/js2c.py
|
||||
@@ -34,7 +34,6 @@
|
||||
import os, re, sys, string
|
||||
import optparse
|
||||
import jsmin
|
||||
-import bz2
|
||||
import textwrap
|
||||
|
||||
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 90a3c113c19ec615249ab880c45c6c0a8d369098 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Tue, 30 Jun 2015 09:43:47 +0100
|
||||
Subject: [PATCH 2/4] gyp: force link command to use CXX
|
||||
|
||||
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
[yann.morin.1998@free.fr: adapt to 4.1.2]
|
||||
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
---
|
||||
tools/gyp/pylib/gyp/generator/make.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py
|
||||
index b88a433..0a1f2e0 100644
|
||||
--- a/tools/gyp/pylib/gyp/generator/make.py
|
||||
+++ b/tools/gyp/pylib/gyp/generator/make.py
|
||||
@@ -142,7 +142,7 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
|
||||
# special "figure out circular dependencies" flags around the entire
|
||||
# input list during linking.
|
||||
quiet_cmd_link = LINK($(TOOLSET)) $@
|
||||
-cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
|
||||
+cmd_link = $(CXX.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
|
||||
|
||||
# We support two kinds of shared objects (.so):
|
||||
# 1) shared_library, which is just bundling together many dependent libraries
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
From 4a48c65921b0f05b621aef5b902b6aa54811ad7a Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Tue, 30 Jun 2015 09:44:33 +0100
|
||||
Subject: [PATCH 3/4] Use a python variable instead of hardcoding Python
|
||||
|
||||
The nodejs build system uses python in a number of locations. However,
|
||||
there are some locations where it hardcodes 'python' as the Python
|
||||
interpreter. However, this causes problems when we need to use python2
|
||||
instead of just python.
|
||||
|
||||
This patch fixes that by using the python variable already in place in
|
||||
the nodejs build system.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
[Martin: adapt to 0.12.5]
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
[yann.morin.1998@free.fr: adapt to 4.1.2]
|
||||
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
[Martin: adapt to 5.5.0]
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
---
|
||||
deps/v8/tools/gyp/v8.gyp | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp
|
||||
index 1e5705d..e2e5dfe 100644
|
||||
--- a/deps/v8/tools/gyp/v8.gyp
|
||||
+++ b/deps/v8/tools/gyp/v8.gyp
|
||||
@@ -1723,14 +1723,14 @@
|
||||
'<(PRODUCT_DIR)/natives_blob_host.bin',
|
||||
],
|
||||
'action': [
|
||||
- 'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob_host.bin'
|
||||
+ '<(python)', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob_host.bin'
|
||||
],
|
||||
}, {
|
||||
'outputs': [
|
||||
'<(PRODUCT_DIR)/natives_blob.bin',
|
||||
],
|
||||
'action': [
|
||||
- 'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob.bin'
|
||||
+ '<(python)', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob.bin'
|
||||
],
|
||||
}],
|
||||
],
|
||||
@@ -1739,7 +1739,7 @@
|
||||
'<(PRODUCT_DIR)/natives_blob.bin',
|
||||
],
|
||||
'action': [
|
||||
- 'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob.bin'
|
||||
+ '<(python)', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob.bin'
|
||||
],
|
||||
}],
|
||||
],
|
||||
@@ -1847,7 +1847,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
|
||||
'CORE',
|
||||
@@ -1873,7 +1873,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
|
||||
'EXPERIMENTAL',
|
||||
@@ -1898,7 +1898,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/code-stub-libraries.cc',
|
||||
'CODE_STUB',
|
||||
@@ -1923,7 +1923,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/js2c.py',
|
||||
'<(SHARED_INTERMEDIATE_DIR)/extras-libraries.cc',
|
||||
'EXTRAS',
|
||||
@@ -1960,7 +1960,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
|
||||
],
|
||||
'action': [
|
||||
- 'python',
|
||||
+ '<(python)',
|
||||
'../../tools/gen-postmortem-metadata.py',
|
||||
'<@(_outputs)',
|
||||
'<@(heapobject_files)'
|
||||
diff --git a/deps/v8/build/toolchain.gypi b/deps/v8/build/toolchain.gypi
|
||||
index c703155..06c0b2b 100644
|
||||
--- a/deps/v8/build/toolchain.gypi
|
||||
+++ b/deps/v8/build/toolchain.gypi
|
||||
@@ -38,7 +38,7 @@
|
||||
'ubsan%': 0,
|
||||
'ubsan_vptr%': 0,
|
||||
'v8_target_arch%': '<(target_arch)',
|
||||
- 'v8_host_byteorder%': '<!(python -c "import sys; print sys.byteorder")',
|
||||
+ 'v8_host_byteorder%': '<!(<(python) -c "import sys; print sys.byteorder")',
|
||||
# Native Client builds currently use the V8 ARM JIT and
|
||||
# arm/simulator-arm.cc to defer the significant effort required
|
||||
# for NaCl JIT support. The nacl_target_arch variable provides
|
||||
@@ -0,0 +1,39 @@
|
||||
From 5b3dd2599ebde1846750aaf7c79576ad45246ffa Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Tue, 8 Dec 2015 11:41:08 +0000
|
||||
Subject: [PATCH] Fix va_list not declared
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When compiling with uClibc-ng the following error is seen.
|
||||
|
||||
In file included from ../deps/v8/src/log-utils.cc:5:0:
|
||||
../deps/v8/src/log-utils.h:64:39: error: ‘va_list’ has not been declared
|
||||
void AppendVA(const char* format, va_list args);
|
||||
|
||||
This patch fixes the issue by adding the missing #include <cstdarg>. Note
|
||||
that this fix has already be included upstream, see
|
||||
https://github.com/nodejs/node/blob/8a43a3d/deps/v8/src/log-utils.h
|
||||
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
---
|
||||
deps/v8/src/log-utils.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/deps/v8/src/log-utils.h b/deps/v8/src/log-utils.h
|
||||
index 87dab52..6714307 100644
|
||||
--- a/deps/v8/src/log-utils.h
|
||||
+++ b/deps/v8/src/log-utils.h
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef V8_LOG_UTILS_H_
|
||||
#define V8_LOG_UTILS_H_
|
||||
|
||||
+#include <cstdarg>
|
||||
+
|
||||
#include "src/allocation.h"
|
||||
#include "src/base/platform/mutex.h"
|
||||
#include "src/flags.h"
|
||||
--
|
||||
2.5.0
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 1cc08f6ceacbb0e5ba1f4638ca3a97ac002d7792 Mon Sep 17 00:00:00 2001
|
||||
From: "Bark, Martin" <martin.bark@te.com>
|
||||
Date: Mon, 14 Dec 2015 13:26:10 +0000
|
||||
Subject: [PATCH 2/2] Fix support for uClibc-ng
|
||||
|
||||
uClibc-ng is currently at v1.0.9. The patch corrects the uClibc
|
||||
version test so that HAVE_IFADDRS_H is defined for uClibc versions
|
||||
after v0.9.32.
|
||||
|
||||
Submitted upstream to libuv and accepted, see
|
||||
https://github.com/libuv/libuv/pull/653 and
|
||||
https://github.com/libuv/libuv/commit/c861972
|
||||
|
||||
Signed-off-by: Bark, Martin <martin.bark@te.com>
|
||||
---
|
||||
deps/uv/src/unix/linux-core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c
|
||||
index e6e6828..6cbbb71 100644
|
||||
--- a/deps/uv/src/unix/linux-core.c
|
||||
+++ b/deps/uv/src/unix/linux-core.c
|
||||
@@ -39,7 +39,7 @@
|
||||
#define HAVE_IFADDRS_H 1
|
||||
|
||||
#ifdef __UCLIBC__
|
||||
-# if __UCLIBC_MAJOR__ < 0 || __UCLIBC_MINOR__ < 9 || __UCLIBC_SUBLEVEL__ < 32
|
||||
+# if __UCLIBC_MAJOR__ < 0 && __UCLIBC_MINOR__ < 9 && __UCLIBC_SUBLEVEL__ < 32
|
||||
# undef HAVE_IFADDRS_H
|
||||
# endif
|
||||
#endif
|
||||
--
|
||||
2.6.2
|
||||
107
bsp/buildroot/package/nodejs/Config.in
Normal file
107
bsp/buildroot/package/nodejs/Config.in
Normal file
@@ -0,0 +1,107 @@
|
||||
comment "nodejs needs a toolchain w/ C++, dynamic library, threads, gcc >= 4.8, wchar"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_arm || BR2_i386 || BR2_x86_64 || BR2_mipsel
|
||||
depends on !BR2_MIPS_SOFT_FLOAT
|
||||
depends on !BR2_ARM_CPU_ARMV4
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
!BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || !BR2_USE_WCHAR
|
||||
|
||||
config BR2_PACKAGE_NODEJS
|
||||
bool "nodejs"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_arm || BR2_i386 || BR2_x86_64 || BR2_mipsel
|
||||
depends on !BR2_MIPS_SOFT_FLOAT
|
||||
# ARM needs BLX, so v5t+
|
||||
depends on !BR2_ARM_CPU_ARMV4
|
||||
# 0.10.x could be built without the following toolchain dependencies but
|
||||
# simplify things by requiring these basic dependencies for all versions.
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_8
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
|
||||
depends on BR2_USE_WCHAR
|
||||
# uses fork()
|
||||
depends on BR2_USE_MMU
|
||||
# uses dlopen(). On ARMv5, we could technically support static
|
||||
# linking, but that's too much of a corner case to support it.
|
||||
depends on !BR2_STATIC_LIBS
|
||||
select BR2_PACKAGE_ZLIB
|
||||
help
|
||||
Event-driven I/O server-side JavaScript environment based on V8.
|
||||
|
||||
http://nodejs.org/
|
||||
|
||||
if BR2_PACKAGE_NODEJS
|
||||
|
||||
# Starting with 0.12.x, on ARM, V8 (the JS engine)
|
||||
# now requires an armv6+ and a VFPv2+.
|
||||
config BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
|
||||
bool
|
||||
# On supported architectures other than ARM, no special requirement
|
||||
default y if !BR2_arm
|
||||
# On ARM, at least ARMv6+ with VFPv2+ is needed
|
||||
default y if !BR2_ARM_CPU_ARMV5 && BR2_ARM_CPU_HAS_VFPV2
|
||||
|
||||
config BR2_PACKAGE_NODEJS_VERSION_STRING
|
||||
string
|
||||
default "5.5.0" if BR2_PACKAGE_NODEJS_V8_ARCH_SUPPORTS
|
||||
default "0.10.42"
|
||||
|
||||
menu "Module Selection"
|
||||
|
||||
config BR2_PACKAGE_NODEJS_NPM
|
||||
bool "NPM for the target"
|
||||
select BR2_PACKAGE_OPENSSL
|
||||
help
|
||||
NPM is the package manager for the Node JavaScript platform.
|
||||
Note that enabling NPM on the target also selects OpenSSL for the
|
||||
target.
|
||||
|
||||
http://www.npmjs.org
|
||||
|
||||
Note that NPM is always built for the buildroot host.
|
||||
|
||||
config BR2_PACKAGE_NODEJS_MODULES_EXPRESS
|
||||
bool "Express web application framework"
|
||||
help
|
||||
Express is a minimal and flexible node.js web application
|
||||
framework, providing a robust set of features for building
|
||||
single and multi-page, and hybrid web applications.
|
||||
|
||||
http://www.expressjs.com
|
||||
https://github.com/visionmedia/express
|
||||
|
||||
config BR2_PACKAGE_NODEJS_MODULES_COFFEESCRIPT
|
||||
bool "CoffeeScript"
|
||||
help
|
||||
CoffeeScript is a little language that compiles into JavaScript.
|
||||
|
||||
http://www.coffeescript.org
|
||||
|
||||
config BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL
|
||||
string "Additional modules"
|
||||
help
|
||||
List of space-separated nodejs modules to install via npm.
|
||||
See https://npmjs.org/ to find modules and 'npm help install'
|
||||
for available installation methods. For repeatable builds,
|
||||
download and save tgz files or clone git repos for the
|
||||
components you care about.
|
||||
|
||||
Example: serialport uglify-js@1.3.4 /my/module/mymodule.tgz git://github.com/someuser/somemodule.git#v1.2
|
||||
|
||||
This would install the serialport module (at the newest version),
|
||||
the uglify-js module at 1.3.4, a module from a filesystem path,
|
||||
and a module from a git repository.
|
||||
|
||||
config BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS
|
||||
string "Additional module dependencies"
|
||||
help
|
||||
List of space-separated buildroot recipes which must be built before
|
||||
your npms can be installed. For example, if in 'Additional modules'
|
||||
you specified 'node-curl' (see:
|
||||
https://github.com/jiangmiao/node-curl), you could then specify
|
||||
'libcurl' here, to ensure that buildroot builds the libcurl package,
|
||||
and does so before building your node modules.
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
5
bsp/buildroot/package/nodejs/nodejs.hash
Normal file
5
bsp/buildroot/package/nodejs/nodejs.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# From upstream URL: http://nodejs.org/dist/v0.10.42/SHASUMS256.txt
|
||||
sha256 9b4cc1b5bc397d80dfe217625b04bb6212a3b5a8b1e0eb36000a30d7ae567b8a node-v0.10.42.tar.xz
|
||||
|
||||
# From upstream URL: http://nodejs.org/dist/v5.5.0/SHASUMS256.txt
|
||||
sha256 9c46b4dc9548e43826f71f6571f56e39783c456b9516045b496ea73321731e22 node-v5.5.0.tar.xz
|
||||
147
bsp/buildroot/package/nodejs/nodejs.mk
Normal file
147
bsp/buildroot/package/nodejs/nodejs.mk
Normal file
@@ -0,0 +1,147 @@
|
||||
################################################################################
|
||||
#
|
||||
# nodejs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
NODEJS_VERSION = $(call qstrip,$(BR2_PACKAGE_NODEJS_VERSION_STRING))
|
||||
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
|
||||
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
|
||||
NODEJS_DEPENDENCIES = host-python host-nodejs zlib \
|
||||
$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
|
||||
HOST_NODEJS_DEPENDENCIES = host-python host-zlib
|
||||
NODEJS_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components)
|
||||
NODEJS_LICENSE_FILES = LICENSE
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
NODEJS_DEPENDENCIES += openssl
|
||||
endif
|
||||
|
||||
# nodejs build system is based on python, but only support python-2.6 or
|
||||
# python-2.7. So, we have to enforce PYTHON interpreter to be python2.
|
||||
define HOST_NODEJS_CONFIGURE_CMDS
|
||||
# Build with the static, built-in OpenSSL which is supplied as part of
|
||||
# the nodejs source distribution. This is needed on the host because
|
||||
# NPM is non-functional without it, and host-openssl isn't part of
|
||||
# buildroot.
|
||||
(cd $(@D); \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(HOST_DIR)/usr/bin/python2 ./configure \
|
||||
--prefix=$(HOST_DIR)/usr \
|
||||
--without-snapshot \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--shared-zlib \
|
||||
)
|
||||
endef
|
||||
|
||||
define HOST_NODEJS_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(HOST_CONFIGURE_OPTS)
|
||||
endef
|
||||
|
||||
define HOST_NODEJS_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
$(HOST_CONFIGURE_OPTS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_i386),y)
|
||||
NODEJS_CPU = ia32
|
||||
else ifeq ($(BR2_x86_64),y)
|
||||
NODEJS_CPU = x64
|
||||
else ifeq ($(BR2_mips),y)
|
||||
NODEJS_CPU = mips
|
||||
else ifeq ($(BR2_mipsel),y)
|
||||
NODEJS_CPU = mipsel
|
||||
else ifeq ($(BR2_arm),y)
|
||||
NODEJS_CPU = arm
|
||||
# V8 needs to know what floating point ABI the target is using.
|
||||
NODEJS_ARM_FP = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
|
||||
endif
|
||||
|
||||
# MIPS architecture specific options
|
||||
ifeq ($(BR2_mips)$(BR2_mipsel),y)
|
||||
ifeq ($(BR2_mips_32r6),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r6
|
||||
NODEJS_MIPS_FPU_MODE = fp64
|
||||
else ifeq ($(BR2_mips_32r2),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r2
|
||||
else ifeq ($(BR2_mips_32),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r1
|
||||
endif
|
||||
endif
|
||||
|
||||
define NODEJS_CONFIGURE_CMDS
|
||||
(cd $(@D); \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
LD="$(TARGET_CXX)" \
|
||||
PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(HOST_DIR)/usr/bin/python2 ./configure \
|
||||
--prefix=/usr \
|
||||
--without-snapshot \
|
||||
--shared-zlib \
|
||||
$(if $(BR2_PACKAGE_OPENSSL),--shared-openssl,--without-ssl) \
|
||||
$(if $(BR2_PACKAGE_NODEJS_NPM),,--without-npm) \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--dest-cpu=$(NODEJS_CPU) \
|
||||
$(if $(NODEJS_ARM_FP),--with-arm-float-abi=$(NODEJS_ARM_FP)) \
|
||||
$(if $(NODEJS_MIPS_ARCH_VARIANT),--with-mips-arch-variant=$(NODEJS_MIPS_ARCH_VARIANT)) \
|
||||
$(if $(NODEJS_MIPS_FPU_MODE),--with-mips-fpu-mode=$(NODEJS_MIPS_FPU_MODE)) \
|
||||
--dest-os=linux \
|
||||
)
|
||||
endef
|
||||
|
||||
define NODEJS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
LD="$(TARGET_CXX)"
|
||||
endef
|
||||
|
||||
#
|
||||
# Build the list of modules to install based on the booleans for
|
||||
# popular modules, as well as the "additional modules" list.
|
||||
#
|
||||
NODEJS_MODULES_LIST= $(call qstrip,\
|
||||
$(if $(BR2_PACKAGE_NODEJS_MODULES_EXPRESS),express) \
|
||||
$(if $(BR2_PACKAGE_NODEJS_MODULES_COFFEESCRIPT),coffee-script) \
|
||||
$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL))
|
||||
|
||||
# Define NPM for other packages to use
|
||||
NPM = $(TARGET_CONFIGURE_OPTS) \
|
||||
LD="$(TARGET_CXX)" \
|
||||
npm_config_arch=$(NODEJS_CPU) \
|
||||
npm_config_target_arch=$(NODEJS_CPU) \
|
||||
npm_config_build_from_source=true \
|
||||
npm_config_nodedir=$(BUILD_DIR)/nodejs-$(NODEJS_VERSION) \
|
||||
npm_config_prefix=$(TARGET_DIR)/usr \
|
||||
$(HOST_DIR)/usr/bin/npm
|
||||
|
||||
#
|
||||
# We can only call NPM if there's something to install.
|
||||
#
|
||||
ifneq ($(NODEJS_MODULES_LIST),)
|
||||
define NODEJS_INSTALL_MODULES
|
||||
# If you're having trouble with module installation, adding -d to the
|
||||
# npm install call below and setting npm_config_rollback=false can both
|
||||
# help in diagnosing the problem.
|
||||
$(NPM) install -g $(NODEJS_MODULES_LIST)
|
||||
endef
|
||||
endif
|
||||
|
||||
define NODEJS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(TARGET_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
LD="$(TARGET_CXX)"
|
||||
$(NODEJS_INSTALL_MODULES)
|
||||
endef
|
||||
|
||||
# node.js configure is a Python script and does not use autotools
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
Reference in New Issue
Block a user