generated from gaoyang3513/SDK_RK3288
[Mod] First commit
This commit is contained in:
88
package/nodejs/0001-add-qemu-wrapper-support.patch
Normal file
88
package/nodejs/0001-add-qemu-wrapper-support.patch
Normal file
@ -0,0 +1,88 @@
|
||||
From fa09fa3ad6a21ae0b35fb860f76d1762e5f29972 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Duskett <aduskett@gmail.com>
|
||||
Date: Mon, 27 Sep 2021 12:55:09 -0700
|
||||
Subject: [PATCH] add qemu-wrapper support
|
||||
|
||||
V8's JIT infrastructure requires binaries such as mksnapshot and mkpeephole to
|
||||
be run in the host during the build. However, these binaries must have the
|
||||
same bit-width as the target (e.g. a x86_64 host targeting ARMv6 needs to
|
||||
produce a 32-bit binary). To work around this issue, cross-compile the
|
||||
binaries for the target and run them on the host with QEMU, much like
|
||||
gobject-introspection.
|
||||
|
||||
However, for the host-variant we do not want to use a
|
||||
qemu-wrapper, so add @MAYBE_WRAPPER@ to the needed files and sed the path to
|
||||
the qemu-wrapper on target builds, and remove @MAYBE_WRAPPER@ entirely on
|
||||
host-builds.
|
||||
|
||||
Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
||||
---
|
||||
node.gyp | 4 ++--
|
||||
tools/v8_gypfiles/v8.gyp | 8 ++++----
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index 8ba0dfeb..c77f6f7d 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -491,7 +491,7 @@
|
||||
'action_name': 'run_mkcodecache',
|
||||
'process_outputs_as_sources': 1,
|
||||
'inputs': [
|
||||
- '<(mkcodecache_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(mkcodecache_exec)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/node_code_cache.cc',
|
||||
@@ -516,7 +516,7 @@
|
||||
'action_name': 'node_mksnapshot',
|
||||
'process_outputs_as_sources': 1,
|
||||
'inputs': [
|
||||
- '<(node_mksnapshot_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
|
||||
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
|
||||
index 48ec392b..f9bb0fbe 100644
|
||||
--- a/tools/v8_gypfiles/v8.gyp
|
||||
+++ b/tools/v8_gypfiles/v8.gyp
|
||||
@@ -220,7 +220,7 @@
|
||||
{
|
||||
'action_name': 'run_torque_action',
|
||||
'inputs': [ # Order matters.
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
'<@(torque_files)',
|
||||
],
|
||||
'outputs': [
|
||||
@@ -351,7 +351,7 @@
|
||||
{
|
||||
'action_name': 'generate_bytecode_builtins_list_action',
|
||||
'inputs': [
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(generate_bytecode_builtins_list_output)',
|
||||
@@ -533,7 +533,7 @@
|
||||
],
|
||||
},
|
||||
'inputs': [
|
||||
- '<(mksnapshot_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(mksnapshot_exec)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(INTERMEDIATE_DIR)/snapshot.cc',
|
||||
@@ -1448,7 +1448,7 @@
|
||||
{
|
||||
'action_name': 'run_gen-regexp-special-case_action',
|
||||
'inputs': [
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From 7c69553d7275bbcaa88fada8ccd0d2d9f787e1ad Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Sat, 4 Mar 2017 20:41:40 +0000
|
||||
Subject: [PATCH] check if uclibc has backtrace support
|
||||
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
---
|
||||
deps/v8/src/base/debug/stack_trace_posix.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/v8/src/base/debug/stack_trace_posix.cc b/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
index 87c0a73..d2c182a 100644
|
||||
--- a/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
+++ b/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#if V8_LIBC_GLIBC || V8_LIBC_BSD || V8_LIBC_UCLIBC || V8_OS_SOLARIS
|
||||
+#if V8_LIBC_GLIBC || V8_LIBC_BSD || ( V8_LIBC_UCLIBC && __UCLIBC_HAS_BACKTRACE__ ) || V8_OS_SOLARIS
|
||||
#define HAVE_EXECINFO_H 1
|
||||
#endif
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
83
package/nodejs/Config.in
Normal file
83
package/nodejs/Config.in
Normal file
@ -0,0 +1,83 @@
|
||||
config BR2_PACKAGE_NODEJS_ARCH_SUPPORTS
|
||||
bool
|
||||
# On ARM, at least ARMv6+ with VFPv2+ is needed
|
||||
default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5 && BR2_ARM_CPU_HAS_VFPV2
|
||||
default y if BR2_mipsel && !BR2_MIPS_SOFT_FLOAT
|
||||
default y if BR2_aarch64 || BR2_i386 || BR2_x86_64
|
||||
# libuv
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4
|
||||
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
|
||||
comment "nodejs needs a toolchain w/ C++, dynamic library, NPTL, gcc >= 7, wchar, host gcc >= 8"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_PACKAGE_NODEJS_ARCH_SUPPORTS
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
|
||||
!BR2_HOST_GCC_AT_LEAST_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || !BR2_USE_WCHAR
|
||||
|
||||
config BR2_PACKAGE_NODEJS
|
||||
bool "nodejs"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_PACKAGE_NODEJS_ARCH_SUPPORTS
|
||||
depends on BR2_HOST_GCC_AT_LEAST_8 # qemu
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7
|
||||
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_HOST_NODEJS
|
||||
select BR2_PACKAGE_C_ARES
|
||||
select BR2_PACKAGE_LIBUV
|
||||
select BR2_PACKAGE_ZLIB
|
||||
select BR2_PACKAGE_NGHTTP2
|
||||
help
|
||||
Event-driven I/O server-side JavaScript environment based on
|
||||
V8.
|
||||
|
||||
http://nodejs.org/
|
||||
|
||||
if BR2_PACKAGE_NODEJS
|
||||
|
||||
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_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.
|
||||
|
||||
endif
|
||||
18
package/nodejs/Config.in.host
Normal file
18
package/nodejs/Config.in.host
Normal file
@ -0,0 +1,18 @@
|
||||
config BR2_PACKAGE_HOST_NODEJS
|
||||
bool "host nodejs"
|
||||
depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
|
||||
depends on BR2_HOST_GCC_AT_LEAST_8
|
||||
select BR2_PACKAGE_HOST_PYTHON3
|
||||
select BR2_PACKAGE_HOST_PYTHON3_BZIP2
|
||||
select BR2_PACKAGE_HOST_PYTHON3_SSL
|
||||
select BR2_PACKAGE_HOST_QEMU
|
||||
select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
|
||||
help
|
||||
Event-driven I/O server-side JavaScript environment based on
|
||||
V8.
|
||||
|
||||
http://nodejs.org/
|
||||
|
||||
comment "host nodejs needs a host gcc >= 8"
|
||||
depends on BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS
|
||||
depends on !BR2_HOST_GCC_AT_LEAST_8
|
||||
5
package/nodejs/nodejs.hash
Normal file
5
package/nodejs/nodejs.hash
Normal file
@ -0,0 +1,5 @@
|
||||
# From https://nodejs.org/dist/v16.16.0/SHASUMS256.txt
|
||||
sha256 145151eff3b2aa5ebe73384009c52271a83740ae687a93c98c628cd7d52736eb node-v16.16.0.tar.xz
|
||||
|
||||
# Hash for license file
|
||||
sha256 6211cc77f9ceaf365db12faf050775b3a1e6da7a1eff3577ba006c4918103c33 LICENSE
|
||||
279
package/nodejs/nodejs.mk
Normal file
279
package/nodejs/nodejs.mk
Normal file
@ -0,0 +1,279 @@
|
||||
################################################################################
|
||||
#
|
||||
# nodejs
|
||||
#
|
||||
################################################################################
|
||||
|
||||
NODEJS_VERSION = 16.16.0
|
||||
NODEJS_SOURCE = node-v$(NODEJS_VERSION).tar.xz
|
||||
NODEJS_SITE = http://nodejs.org/dist/v$(NODEJS_VERSION)
|
||||
NODEJS_DEPENDENCIES = \
|
||||
host-nodejs \
|
||||
host-ninja \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-qemu \
|
||||
c-ares \
|
||||
libuv \
|
||||
nghttp2 \
|
||||
zlib \
|
||||
$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
|
||||
HOST_NODEJS_DEPENDENCIES = \
|
||||
host-icu \
|
||||
host-libopenssl \
|
||||
host-ninja \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-zlib
|
||||
NODEJS_INSTALL_STAGING = YES
|
||||
NODEJS_LICENSE = MIT (core code); MIT, Apache and BSD family licenses (Bundled components)
|
||||
NODEJS_LICENSE_FILES = LICENSE
|
||||
NODEJS_CPE_ID_VENDOR = nodejs
|
||||
NODEJS_CPE_ID_PRODUCT = node.js
|
||||
|
||||
NODEJS_CONF_OPTS = \
|
||||
--shared-zlib \
|
||||
--shared-cares \
|
||||
--shared-libuv \
|
||||
--shared-nghttp2 \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--cross-compiling \
|
||||
--dest-os=linux \
|
||||
--ninja
|
||||
|
||||
HOST_NODEJS_MAKE_OPTS = \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
CXXFLAGS="$(HOST_NODEJS_CXXFLAGS)" \
|
||||
LDFLAGS.host="$(HOST_LDFLAGS)" \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH)
|
||||
|
||||
NODEJS_MAKE_OPTS = \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)"
|
||||
|
||||
# nodejs's build system uses python which can be a symlink to an unsupported
|
||||
# python version (e.g. python 3.10 with nodejs 14.18.1). We work around this by
|
||||
# forcing host-python3 early in the PATH, via a python->python3 symlink.
|
||||
define NODEJS_PYTHON3_SYMLINK
|
||||
mkdir -p $(@D)/bin
|
||||
ln -sf $(HOST_DIR)/bin/python3 $(@D)/bin/python
|
||||
endef
|
||||
HOST_NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_PYTHON3_SYMLINK
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_PYTHON3_SYMLINK
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
NODEJS_DEPENDENCIES += openssl
|
||||
NODEJS_CONF_OPTS += --shared-openssl
|
||||
else
|
||||
NODEJS_CONF_OPTS += --without-ssl
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ICU),y)
|
||||
NODEJS_DEPENDENCIES += icu
|
||||
NODEJS_CONF_OPTS += --with-intl=system-icu
|
||||
else
|
||||
NODEJS_CONF_OPTS += --with-intl=none
|
||||
endif
|
||||
|
||||
ifneq ($(BR2_PACKAGE_NODEJS_NPM),y)
|
||||
NODEJS_CONF_OPTS += --without-npm
|
||||
endif
|
||||
|
||||
define HOST_NODEJS_CONFIGURE_CMDS
|
||||
cd $(@D); \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 ./configure \
|
||||
--prefix=$(HOST_DIR) \
|
||||
--without-dtrace \
|
||||
--without-etw \
|
||||
--shared-openssl \
|
||||
--shared-openssl-includes=$(HOST_DIR)/include \
|
||||
--shared-openssl-libpath=$(HOST_DIR)/lib \
|
||||
--shared-zlib \
|
||||
--no-cross-compiling \
|
||||
--with-intl=system-icu \
|
||||
--ninja
|
||||
endef
|
||||
|
||||
NODEJS_HOST_TOOLS_V8 = \
|
||||
torque \
|
||||
gen-regexp-special-case \
|
||||
bytecode_builtins_list_generator
|
||||
NODEJS_HOST_TOOLS_NODE = mkcodecache
|
||||
NODEJS_HOST_TOOLS = $(NODEJS_HOST_TOOLS_V8) $(NODEJS_HOST_TOOLS_NODE)
|
||||
|
||||
HOST_NODEJS_CXXFLAGS = $(HOST_CXXFLAGS)
|
||||
|
||||
define HOST_NODEJS_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(HOST_NODEJS_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define HOST_NODEJS_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
$(HOST_NODEJS_MAKE_OPTS)
|
||||
|
||||
$(foreach f,$(NODEJS_HOST_TOOLS), \
|
||||
$(INSTALL) -m755 -D $(@D)/out/Release/$(f) $(HOST_DIR)/bin/$(f)
|
||||
)
|
||||
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 = $(GCC_TARGET_FLOAT_ABI)
|
||||
# it also wants to know which FPU to use, but only has support for
|
||||
# vfp, vfpv3, vfpv3-d16 and neon.
|
||||
ifeq ($(BR2_ARM_FPU_VFPV2),y)
|
||||
NODEJS_ARM_FPU = vfp
|
||||
# vfpv4 is a superset of vfpv3
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y)
|
||||
NODEJS_ARM_FPU = vfpv3
|
||||
# vfpv4-d16 is a superset of vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y)
|
||||
NODEJS_ARM_FPU = vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_NEON),y)
|
||||
NODEJS_ARM_FPU = neon
|
||||
endif
|
||||
else ifeq ($(BR2_aarch64),y)
|
||||
NODEJS_CPU = arm64
|
||||
endif
|
||||
|
||||
# MIPS architecture specific options
|
||||
ifeq ($(BR2_mips)$(BR2_mipsel),y)
|
||||
ifeq ($(BR2_MIPS_CPU_MIPS32R6),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r6
|
||||
NODEJS_MIPS_FPU_MODE = fp64
|
||||
else ifeq ($(BR2_MIPS_CPU_MIPS32R2),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r2
|
||||
else ifeq ($(BR2_MIPS_CPU_MIPS32),y)
|
||||
NODEJS_MIPS_ARCH_VARIANT = r1
|
||||
endif
|
||||
endif
|
||||
|
||||
NODEJS_LDFLAGS = $(TARGET_LDFLAGS)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
NODEJS_LDFLAGS += -latomic
|
||||
endif
|
||||
|
||||
# V8's JIT infrastructure requires binaries such as mksnapshot and
|
||||
# mkpeephole to be run in the host during the build. However, these
|
||||
# binaries must have the same bit-width as the target (e.g. a x86_64
|
||||
# host targeting ARMv6 needs to produce a 32-bit binary). To work around this
|
||||
# issue, cross-compile the binaries for the target and run them on the
|
||||
# host with QEMU, much like gobject-introspection.
|
||||
define NODEJS_INSTALL_V8_QEMU_WRAPPER
|
||||
$(INSTALL) -D -m 755 $(NODEJS_PKGDIR)/v8-qemu-wrapper.in \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USERMODE_ARGS@%$(call qstrip,$(BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS))%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
endef
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_INSTALL_V8_QEMU_WRAPPER
|
||||
|
||||
define NODEJS_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
NODEJS_PRE_CONFIGURE_HOOKS += NODEJS_WRAPPER_FIXUP
|
||||
|
||||
# Do not run the qemu-wrapper for the host build.
|
||||
define HOST_NODEJS_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
HOST_NODEJS_PRE_CONFIGURE_HOOKS += HOST_NODEJS_WRAPPER_FIXUP
|
||||
|
||||
define NODEJS_CONFIGURE_CMDS
|
||||
(cd $(@D); \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)" \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 ./configure \
|
||||
--prefix=/usr \
|
||||
--dest-cpu=$(NODEJS_CPU) \
|
||||
$(if $(NODEJS_ARM_FP),--with-arm-float-abi=$(NODEJS_ARM_FP)) \
|
||||
$(if $(NODEJS_ARM_FPU),--with-arm-fpu=$(NODEJS_ARM_FPU)) \
|
||||
$(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)) \
|
||||
$(NODEJS_CONF_OPTS) \
|
||||
)
|
||||
endef
|
||||
|
||||
define NODEJS_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
#
|
||||
# Build the list of modules to install.
|
||||
#
|
||||
NODEJS_MODULES_LIST= $(call qstrip,\
|
||||
$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL))
|
||||
|
||||
# Define NPM for other packages to use
|
||||
NPM = $(TARGET_CONFIGURE_OPTS) \
|
||||
LDFLAGS="$(NODEJS_LDFLAGS)" \
|
||||
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 \
|
||||
npm_config_cache=$(BUILD_DIR)/.npm-cache \
|
||||
$(HOST_DIR)/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_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(STAGING_DIR) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define NODEJS_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(TARGET_DIR) \
|
||||
$(NODEJS_MAKE_OPTS)
|
||||
$(NODEJS_INSTALL_MODULES)
|
||||
endef
|
||||
|
||||
# node.js configure is a Python script and does not use autotools
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
9
package/nodejs/v8-qemu-wrapper.in
Normal file
9
package/nodejs/v8-qemu-wrapper.in
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Pass -r to qemu-user as to trick glibc into not errorings out if the host kernel
|
||||
# is older than the target kernel.
|
||||
exec @QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
|
||||
@QEMU_USERMODE_ARGS@ \
|
||||
-L "${STAGING_DIR}/" \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user