diff options
| author | Martin Jansa <martin.jansa@gmail.com> | 2023-10-18 12:28:21 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-10-18 08:47:09 -0700 |
| commit | fca128559b07f21d30ef3297f87af8701a1dbee2 (patch) | |
| tree | b7e4651e7f9c44fd5979ef2c683b9c649abe90a2 /meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb | |
| parent | 22cd25c3f7caac38459e6eeeed7d68436cd7ef7b (diff) | |
| download | meta-openembedded-fca128559b07f21d30ef3297f87af8701a1dbee2.tar.gz | |
nodejs: update to latest v20 version 20.8.1
* updates to latest v20 version
* LIC_FILES_CHKSUM changed due to small Copyright update from:
https://github.com/nodejs/node/commit/660da785e687ab0517397616a9e55b5782582ff5
* this still doesn't resolve the issue with pseudo reported in:
https://lists.openembedded.org/g/openembedded-devel/message/105308
and further debugged in:
https://github.com/shr-project/com.webos.app.minimal/tree/recipes
which shows that it's easily reproducible with plain webpack "Hello world".
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_20.8.1.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb | 180 |
1 files changed, 180 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb new file mode 100644 index 0000000000..d02e733ba6 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_20.8.1.bb | |||
| @@ -0,0 +1,180 @@ | |||
| 1 | DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript" | ||
| 2 | HOMEPAGE = "http://nodejs.org" | ||
| 3 | LICENSE = "MIT & ISC & BSD-2-Clause & BSD-3-Clause & Artistic-2.0 & Apache-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=162595a4a2f3453a0534e60b0afe4e7b" | ||
| 5 | |||
| 6 | CVE_PRODUCT = "nodejs node.js" | ||
| 7 | |||
| 8 | DEPENDS = "openssl file-replacement-native" | ||
| 9 | DEPENDS:append:class-target = " qemu-native" | ||
| 10 | DEPENDS:append:class-native = " c-ares-native" | ||
| 11 | |||
| 12 | inherit pkgconfig python3native qemu ptest | ||
| 13 | |||
| 14 | COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*" | ||
| 15 | COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*" | ||
| 16 | COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*" | ||
| 17 | |||
| 18 | COMPATIBLE_HOST:riscv64 = "null" | ||
| 19 | COMPATIBLE_HOST:riscv32 = "null" | ||
| 20 | COMPATIBLE_HOST:powerpc = "null" | ||
| 21 | |||
| 22 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | ||
| 23 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ | ||
| 24 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | ||
| 25 | file://system-c-ares.patch \ | ||
| 26 | file://0001-liftoff-Correct-function-signatures.patch \ | ||
| 27 | file://run-ptest \ | ||
| 28 | " | ||
| 29 | |||
| 30 | SRC_URI:append:class-target = " \ | ||
| 31 | file://0001-Using-native-binaries.patch \ | ||
| 32 | " | ||
| 33 | SRC_URI:append:toolchain-clang:x86 = " \ | ||
| 34 | file://libatomic.patch \ | ||
| 35 | " | ||
| 36 | SRC_URI:append:toolchain-clang:powerpc64le = " \ | ||
| 37 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ | ||
| 38 | " | ||
| 39 | SRC_URI[sha256sum] = "f799c66f6a6386bb8ac2c75a378f740c455e97f1fe964393dd39c9f9f6efbc70" | ||
| 40 | |||
| 41 | S = "${WORKDIR}/node-v${PV}" | ||
| 42 | |||
| 43 | # v8 errors out if you have set CCACHE | ||
| 44 | CCACHE = "" | ||
| 45 | |||
| 46 | def map_nodejs_arch(a, d): | ||
| 47 | import re | ||
| 48 | |||
| 49 | if re.match('i.86$', a): return 'ia32' | ||
| 50 | elif re.match('x86_64$', a): return 'x64' | ||
| 51 | elif re.match('aarch64$', a): return 'arm64' | ||
| 52 | elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64' | ||
| 53 | elif re.match('powerpc$', a): return 'ppc' | ||
| 54 | return a | ||
| 55 | |||
| 56 | ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ | ||
| 57 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ | ||
| 58 | bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ | ||
| 59 | bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ | ||
| 60 | '--with-arm-fpu=vfp', d), d), d)}" | ||
| 61 | ARCHFLAGS:append:mips = " --v8-lite-mode" | ||
| 62 | ARCHFLAGS:append:mipsel = " --v8-lite-mode" | ||
| 63 | ARCHFLAGS ?= "" | ||
| 64 | |||
| 65 | PACKAGECONFIG ??= "ares brotli icu zlib" | ||
| 66 | |||
| 67 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" | ||
| 68 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli" | ||
| 69 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | ||
| 70 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | ||
| 71 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | ||
| 72 | PACKAGECONFIG[shared] = "--shared" | ||
| 73 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | ||
| 74 | |||
| 75 | # We don't want to cross-compile during target compile, | ||
| 76 | # and we need to use the right flags during host compile, | ||
| 77 | # too. | ||
| 78 | EXTRA_OEMAKE = "\ | ||
| 79 | CC.host='${CC} -pie -fPIE' \ | ||
| 80 | CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \ | ||
| 81 | CXX.host='${CXX} -pie -fPIE' \ | ||
| 82 | CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \ | ||
| 83 | LDFLAGS.host='${LDFLAGS}' \ | ||
| 84 | AR.host='${AR}' \ | ||
| 85 | \ | ||
| 86 | builddir_name=./ \ | ||
| 87 | " | ||
| 88 | |||
| 89 | EXTRANATIVEPATH += "file-native" | ||
| 90 | |||
| 91 | python prune_sources() { | ||
| 92 | import shutil | ||
| 93 | |||
| 94 | shutil.rmtree(d.getVar('S') + '/deps/openssl') | ||
| 95 | if 'ares' in d.getVar('PACKAGECONFIG'): | ||
| 96 | shutil.rmtree(d.getVar('S') + '/deps/cares') | ||
| 97 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
| 98 | shutil.rmtree(d.getVar('S') + '/deps/brotli') | ||
| 99 | if 'libuv' in d.getVar('PACKAGECONFIG'): | ||
| 100 | shutil.rmtree(d.getVar('S') + '/deps/uv') | ||
| 101 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | ||
| 102 | shutil.rmtree(d.getVar('S') + '/deps/nghttp2') | ||
| 103 | if 'zlib' in d.getVar('PACKAGECONFIG'): | ||
| 104 | shutil.rmtree(d.getVar('S') + '/deps/zlib') | ||
| 105 | } | ||
| 106 | do_unpack[postfuncs] += "prune_sources" | ||
| 107 | |||
| 108 | # V8's JIT infrastructure requires binaries such as mksnapshot and | ||
| 109 | # mkpeephole to be run in the host during the build. However, these | ||
| 110 | # binaries must have the same bit-width as the target (e.g. a x86_64 | ||
| 111 | # host targeting ARMv6 needs to produce a 32-bit binary). Instead of | ||
| 112 | # depending on a third Yocto toolchain, we just build those binaries | ||
| 113 | # for the target and run them on the host with QEMU. | ||
| 114 | python do_create_v8_qemu_wrapper () { | ||
| 115 | """Creates a small wrapper that invokes QEMU to run some target V8 binaries | ||
| 116 | on the host.""" | ||
| 117 | qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), | ||
| 118 | d.expand('${STAGING_DIR_HOST}${base_libdir}')] | ||
| 119 | qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), | ||
| 120 | qemu_libdirs) | ||
| 121 | wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh') | ||
| 122 | with open(wrapper_path, 'w') as wrapper_file: | ||
| 123 | wrapper_file.write("""#!/bin/sh | ||
| 124 | |||
| 125 | # This file has been generated automatically. | ||
| 126 | # It invokes QEMU to run binaries built for the target in the host during the | ||
| 127 | # build process. | ||
| 128 | |||
| 129 | %s "$@" | ||
| 130 | """ % qemu_cmd) | ||
| 131 | os.chmod(wrapper_path, 0o755) | ||
| 132 | } | ||
| 133 | |||
| 134 | do_create_v8_qemu_wrapper[dirs] = "${B}" | ||
| 135 | addtask create_v8_qemu_wrapper after do_configure before do_compile | ||
| 136 | |||
| 137 | LDFLAGS:append:x86 = " -latomic" | ||
| 138 | |||
| 139 | CROSS_FLAGS = "--cross-compiling" | ||
| 140 | CROSS_FLAGS:class-native = "--no-cross-compiling" | ||
| 141 | |||
| 142 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 143 | do_configure () { | ||
| 144 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 145 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 146 | python3 configure.py --verbose --prefix=${prefix} \ | ||
| 147 | --shared-openssl \ | ||
| 148 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 149 | --dest-os=linux \ | ||
| 150 | --libdir=${baselib} \ | ||
| 151 | ${CROSS_FLAGS} \ | ||
| 152 | ${ARCHFLAGS} \ | ||
| 153 | ${PACKAGECONFIG_CONFARGS} | ||
| 154 | } | ||
| 155 | |||
| 156 | do_compile () { | ||
| 157 | install -D ${RECIPE_SYSROOT_NATIVE}/etc/ssl/openssl.cnf ${B}/deps/openssl/nodejs-openssl.cnf | ||
| 158 | install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh | ||
| 159 | oe_runmake BUILDTYPE=Release | ||
| 160 | } | ||
| 161 | |||
| 162 | do_install () { | ||
| 163 | oe_runmake install DESTDIR=${D} | ||
| 164 | } | ||
| 165 | |||
| 166 | do_install_ptest () { | ||
| 167 | cp -r ${B}/out/Release/cctest ${D}${PTEST_PATH}/ | ||
| 168 | cp -r ${B}/test ${D}${PTEST_PATH} | ||
| 169 | chown -R root:root ${D}${PTEST_PATH} | ||
| 170 | } | ||
| 171 | |||
| 172 | PACKAGES =+ "${PN}-npm" | ||
| 173 | FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx ${bindir}/corepack" | ||
| 174 | RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ | ||
| 175 | python3-misc python3-multiprocessing" | ||
| 176 | |||
| 177 | PACKAGES =+ "${PN}-systemtap" | ||
| 178 | FILES:${PN}-systemtap = "${datadir}/systemtap" | ||
| 179 | |||
| 180 | BBCLASSEXTEND = "native" | ||
