summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2020-01-23 17:44:07 +0100
committerKhem Raj <raj.khem@gmail.com>2020-01-23 14:16:25 -0800
commit50d550aa4e99a8a62db275e4e85626e6b73c3c51 (patch)
tree36da0f5694ab235d42b3cd771d8ae06ac13a0ef4 /meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb
parenteaf9cfb01864a7a64c6ba4142283a8cf76cadd9a (diff)
downloadmeta-openembedded-50d550aa4e99a8a62db275e4e85626e6b73c3c51.tar.gz
nodejs: upgrade to 12.14.1
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb')
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb155
1 files changed, 155 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb
new file mode 100644
index 0000000000..e9ec500e51
--- /dev/null
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb
@@ -0,0 +1,155 @@
1DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
2HOMEPAGE = "http://nodejs.org"
3LICENSE = "MIT & BSD & Artistic-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=be4d5107c64dc3d7c57e3797e1a0674b"
5
6DEPENDS = "openssl"
7DEPENDS_append_class-target = " nodejs-native"
8
9inherit pkgconfig python3native
10
11COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
12COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
13COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"
14
15COMPATIBLE_HOST_riscv64 = "null"
16COMPATIBLE_HOST_riscv32 = "null"
17
18SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
19 file://0001-Disable-running-gyp-files-for-bundled-deps.patch \
20 file://0003-Install-both-binaries-and-use-libdir.patch \
21 file://0004-v8-don-t-override-ARM-CFLAGS.patch \
22 "
23SRC_URI_append_class-target = " \
24 file://0002-Using-native-binaries.patch \
25 "
26
27SRC_URI[md5sum] = "1c78a75f5c95321f533ecccca695e814"
28SRC_URI[sha256sum] = "877b4b842318b0e09bc754faf7343f2f097f0fc4f88ab9ae57cf9944e88e7adb"
29
30S = "${WORKDIR}/node-v${PV}"
31
32# v8 errors out if you have set CCACHE
33CCACHE = ""
34
35def map_nodejs_arch(a, d):
36 import re
37
38 if re.match('i.86$', a): return 'ia32'
39 elif re.match('x86_64$', a): return 'x64'
40 elif re.match('aarch64$', a): return 'arm64'
41 elif re.match('(powerpc64|ppc64le)$', a): return 'ppc64'
42 elif re.match('powerpc$', a): return 'ppc'
43 return a
44
45ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
46 ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
47 bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
48 bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
49 '--with-arm-fpu=vfp', d), d), d)}"
50GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' "
51ARCHFLAGS ?= ""
52
53PACKAGECONFIG ??= "ares icu libuv zlib"
54PACKAGECONFIG[ares] = "--shared-cares,,c-ares"
55PACKAGECONFIG[gyp] = ",,gyp-py2-native"
56PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu"
57PACKAGECONFIG[libuv] = "--shared-libuv,,libuv"
58PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2"
59PACKAGECONFIG[shared] = "--shared"
60PACKAGECONFIG[zlib] = "--shared-zlib,,zlib"
61
62# We don't want to cross-compile during target compile,
63# and we need to use the right flags during host compile,
64# too.
65EXTRA_OEMAKE = "\
66 CC.host='${CC}' \
67 CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \
68 CXX.host='${CXX}' \
69 CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \
70 LDFLAGS.host='${LDFLAGS}' \
71 AR.host='${AR}' \
72 \
73 builddir_name=./ \
74"
75
76python do_unpack() {
77 import shutil
78
79 bb.build.exec_func('base_do_unpack', d)
80
81 shutil.rmtree(d.getVar('S') + '/deps/openssl', True)
82 if 'ares' in d.getVar('PACKAGECONFIG'):
83 shutil.rmtree(d.getVar('S') + '/deps/cares', True)
84 if 'gyp' in d.getVar('PACKAGECONFIG'):
85 shutil.rmtree(d.getVar('S') + '/tools/gyp', True)
86 if 'libuv' in d.getVar('PACKAGECONFIG'):
87 shutil.rmtree(d.getVar('S') + '/deps/uv', True)
88 if 'nghttp2' in d.getVar('PACKAGECONFIG'):
89 shutil.rmtree(d.getVar('S') + '/deps/nghttp2', True)
90 if 'zlib' in d.getVar('PACKAGECONFIG'):
91 shutil.rmtree(d.getVar('S') + '/deps/zlib', True)
92}
93
94# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
95do_configure () {
96 export LD="${CXX}"
97 GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
98 # $TARGET_ARCH settings don't match --dest-cpu settings
99 python3 configure.py --prefix=${prefix} --without-snapshot --shared-openssl \
100 --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
101 --dest-os=linux \
102 --libdir=${D}${libdir} \
103 ${ARCHFLAGS} \
104 ${PACKAGECONFIG_CONFARGS}
105}
106
107do_compile () {
108 export LD="${CXX}"
109 oe_runmake BUILDTYPE=Release
110}
111
112do_install () {
113 oe_runmake install DESTDIR=${D}
114
115 # wasn't updated since 2009 and is the only thing requiring python2 in runtime
116 # ERROR: nodejs-12.14.1-r0 do_package_qa: QA Issue: /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples contained in package nodejs-npm requires /usr/bin/python, but no providers found in RDEPENDS_nodejs-npm? [file-rdeps]
117 rm -f ${D}${exec_prefix}/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples
118}
119
120do_install_append_class-native() {
121 # use node from PATH instead of absolute path to sysroot
122 # node-v0.10.25/tools/install.py is using:
123 # shebang = os.path.join(node_prefix, 'bin/node')
124 # update_shebang(link_path, shebang)
125 # and node_prefix can be very long path to bindir in native sysroot and
126 # when it exceeds 128 character shebang limit it's stripped to incorrect path
127 # and npm fails to execute like in this case with 133 characters show in log.do_install:
128 # updating shebang of /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/work/x86_64-linux/nodejs-native/0.10.15-r0/image/home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/npm to /home/jenkins/workspace/build-webos-nightly/device/qemux86/label/open-webos-builder/BUILD-qemux86/sysroots/x86_64-linux/usr/bin/node
129 # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js
130 # use sed on npm-cli.js because otherwise symlink is replaced with normal file and
131 # npm-cli.js continues to use old shebang
132 sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
133
134 # Install the native binaries to provide it within sysroot for the target compilation
135 install -d ${D}${bindir}
136 install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque
137 install -m 0755 ${S}/out/Release/bytecode_builtins_list_generator ${D}${bindir}/bytecode_builtins_list_generator
138 install -m 0755 ${S}/out/Release/gen-regexp-special-case ${D}${bindir}/gen-regexp-special-case
139 install -m 0755 ${S}/out/Release/mkcodecache ${D}${bindir}/mkcodecache
140 install -m 0755 ${S}/out/Release/node_mksnapshot ${D}${bindir}/node_mksnapshot
141}
142
143do_install_append_class-target() {
144 sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
145}
146
147PACKAGES =+ "${PN}-npm"
148FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx"
149RDEPENDS_${PN}-npm = "bash python3-core python3-shell python3-datetime \
150 python3-misc python3-multiprocessing"
151
152PACKAGES =+ "${PN}-systemtap"
153FILES_${PN}-systemtap = "${datadir}/systemtap"
154
155BBCLASSEXTEND = "native"