diff options
| author | Jason Schonberg <schonm@gmail.com> | 2025-03-18 13:53:42 -0400 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-03-18 11:30:45 -0700 |
| commit | 3989427ca7e348627f9a66e45d3652596b66fe94 (patch) | |
| tree | 21a5b92d3fd9c93970e2c1be8904a1d158c3675b /meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb | |
| parent | 134978803ec5f4e4ae5c1d3311896ccd52827851 (diff) | |
| download | meta-openembedded-3989427ca7e348627f9a66e45d3652596b66fe94.tar.gz | |
nodejs: upgrade 22.13.0 -> 22.14.0
License-Update: Change the location of the inspector_protocol
https://github.com/nodejs/node/commit/a48430d4d34eb9f598522410dd7723f069c574d0
Changelog: https://github.com/nodejs/node/releases/tag/v22.14.0
Signed-off-by: Jason Schonberg <schonm@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb new file mode 100644 index 0000000000..dee4c9df4f --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.14.0.bb | |||
| @@ -0,0 +1,215 @@ | |||
| 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=da350b022352bee62fe22feb6ad681c8" | ||
| 5 | |||
| 6 | CVE_PRODUCT = "nodejs node.js" | ||
| 7 | |||
| 8 | DEPENDS = "openssl openssl-native file-replacement-native python3-packaging-native" | ||
| 9 | DEPENDS:append:class-target = " qemu-native" | ||
| 10 | DEPENDS:append:class-native = " c-ares-native" | ||
| 11 | |||
| 12 | inherit pkgconfig python3native qemu ptest siteinfo | ||
| 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-Do-not-use-glob-in-deps.patch \ | ||
| 24 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ | ||
| 25 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | ||
| 26 | file://system-c-ares.patch \ | ||
| 27 | file://0001-liftoff-Correct-function-signatures.patch \ | ||
| 28 | file://libatomic.patch \ | ||
| 29 | file://0001-deps-disable-io_uring-support-in-libuv.patch \ | ||
| 30 | file://0001-positional-args.patch \ | ||
| 31 | file://0001-custom-env.patch \ | ||
| 32 | file://run-ptest \ | ||
| 33 | " | ||
| 34 | SRC_URI:append:class-target = " \ | ||
| 35 | file://0001-Using-native-binaries.patch \ | ||
| 36 | " | ||
| 37 | SRC_URI:append:toolchain-clang:powerpc64le = " \ | ||
| 38 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ | ||
| 39 | " | ||
| 40 | SRC_URI[sha256sum] = "c609946bf793b55c7954c26582760808d54c16185d79cb2fb88065e52de21914" | ||
| 41 | |||
| 42 | S = "${WORKDIR}/node-v${PV}" | ||
| 43 | |||
| 44 | CVE_PRODUCT += "node.js" | ||
| 45 | |||
| 46 | # v8 errors out if you have set CCACHE | ||
| 47 | CCACHE = "" | ||
| 48 | |||
| 49 | def map_nodejs_arch(a, d): | ||
| 50 | import re | ||
| 51 | |||
| 52 | if re.match('i.86$', a): return 'ia32' | ||
| 53 | elif re.match('x86_64$', a): return 'x64' | ||
| 54 | elif re.match('aarch64$', a): return 'arm64' | ||
| 55 | elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64' | ||
| 56 | elif re.match('powerpc$', a): return 'ppc' | ||
| 57 | return a | ||
| 58 | |||
| 59 | ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ | ||
| 60 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ | ||
| 61 | bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ | ||
| 62 | bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ | ||
| 63 | '--with-arm-fpu=vfp', d), d), d)}" | ||
| 64 | ARCHFLAGS:append:mips = " --v8-lite-mode" | ||
| 65 | ARCHFLAGS:append:mipsel = " --v8-lite-mode" | ||
| 66 | ARCHFLAGS ?= "" | ||
| 67 | |||
| 68 | PACKAGECONFIG ??= "ares brotli icu zlib" | ||
| 69 | |||
| 70 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares c-ares-native" | ||
| 71 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli brotli-native" | ||
| 72 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu icu-native" | ||
| 73 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | ||
| 74 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | ||
| 75 | PACKAGECONFIG[shared] = "--shared" | ||
| 76 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | ||
| 77 | |||
| 78 | EXTRANATIVEPATH += "file-native" | ||
| 79 | |||
| 80 | python prune_sources() { | ||
| 81 | import shutil | ||
| 82 | |||
| 83 | shutil.rmtree(d.getVar('S') + '/deps/openssl') | ||
| 84 | if 'ares' in d.getVar('PACKAGECONFIG'): | ||
| 85 | shutil.rmtree(d.getVar('S') + '/deps/cares') | ||
| 86 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
| 87 | shutil.rmtree(d.getVar('S') + '/deps/brotli') | ||
| 88 | if 'libuv' in d.getVar('PACKAGECONFIG'): | ||
| 89 | shutil.rmtree(d.getVar('S') + '/deps/uv') | ||
| 90 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | ||
| 91 | shutil.rmtree(d.getVar('S') + '/deps/nghttp2') | ||
| 92 | if 'zlib' in d.getVar('PACKAGECONFIG'): | ||
| 93 | shutil.rmtree(d.getVar('S') + '/deps/zlib') | ||
| 94 | } | ||
| 95 | do_unpack[postfuncs] += "prune_sources" | ||
| 96 | |||
| 97 | # V8's JIT infrastructure requires binaries such as mksnapshot and | ||
| 98 | # mkpeephole to be run in the host during the build. However, these | ||
| 99 | # binaries must have the same bit-width as the target (e.g. a x86_64 | ||
| 100 | # host targeting ARMv6 needs to produce a 32-bit binary). | ||
| 101 | # 1. If host and target have the different bit width, run those | ||
| 102 | # binaries for the target and run them on the host with QEMU. | ||
| 103 | # 2. If host and target have the same bit width, enable upstream | ||
| 104 | # cross compile support and no QEMU | ||
| 105 | python do_create_v8_qemu_wrapper () { | ||
| 106 | """Creates a small wrapper that invokes QEMU to run some target V8 binaries | ||
| 107 | on the host.""" | ||
| 108 | qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), | ||
| 109 | d.expand('${STAGING_DIR_HOST}${base_libdir}')] | ||
| 110 | qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), | ||
| 111 | qemu_libdirs) | ||
| 112 | |||
| 113 | if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1": | ||
| 114 | qemu_cmd = "" | ||
| 115 | |||
| 116 | wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh') | ||
| 117 | with open(wrapper_path, 'w') as wrapper_file: | ||
| 118 | wrapper_file.write("""#!/bin/sh | ||
| 119 | |||
| 120 | # This file has been generated automatically. | ||
| 121 | # It invokes QEMU to run binaries built for the target in the host during the | ||
| 122 | # build process. | ||
| 123 | |||
| 124 | %s "$@" | ||
| 125 | """ % qemu_cmd) | ||
| 126 | os.chmod(wrapper_path, 0o755) | ||
| 127 | } | ||
| 128 | |||
| 129 | do_create_v8_qemu_wrapper[dirs] = "${B}" | ||
| 130 | addtask create_v8_qemu_wrapper after do_configure before do_compile | ||
| 131 | |||
| 132 | LDFLAGS:append:x86 = " -latomic" | ||
| 133 | |||
| 134 | export CC_host | ||
| 135 | export CFLAGS_host | ||
| 136 | export CXX_host | ||
| 137 | export CXXFLAGS_host | ||
| 138 | export LDFLAGS_host | ||
| 139 | export AR_host | ||
| 140 | export HOST_AND_TARGET_SAME_WIDTH | ||
| 141 | |||
| 142 | CROSS_FLAGS = "--cross-compiling" | ||
| 143 | CROSS_FLAGS:class-native = "--no-cross-compiling" | ||
| 144 | |||
| 145 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 146 | do_configure () { | ||
| 147 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 148 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 149 | python3 configure.py --verbose --prefix=${prefix} \ | ||
| 150 | --shared-openssl \ | ||
| 151 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 152 | --dest-os=linux \ | ||
| 153 | --libdir=${baselib} \ | ||
| 154 | ${CROSS_FLAGS} \ | ||
| 155 | ${ARCHFLAGS} \ | ||
| 156 | ${PACKAGECONFIG_CONFARGS} | ||
| 157 | } | ||
| 158 | |||
| 159 | do_compile () { | ||
| 160 | install -D ${RECIPE_SYSROOT_NATIVE}/etc/ssl/openssl.cnf ${B}/deps/openssl/nodejs-openssl.cnf | ||
| 161 | install -D ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh | ||
| 162 | oe_runmake BUILDTYPE=Release | ||
| 163 | } | ||
| 164 | |||
| 165 | do_install () { | ||
| 166 | oe_runmake install DESTDIR=${D} | ||
| 167 | } | ||
| 168 | |||
| 169 | do_install_ptest () { | ||
| 170 | cp -r ${B}/out/Release/cctest ${D}${PTEST_PATH}/ | ||
| 171 | cp -r ${B}/test ${D}${PTEST_PATH} | ||
| 172 | chown -R root:root ${D}${PTEST_PATH} | ||
| 173 | } | ||
| 174 | |||
| 175 | PACKAGES =+ "${PN}-npm" | ||
| 176 | FILES:${PN}-npm = "${nonarch_libdir}/node_modules ${bindir}/npm ${bindir}/npx ${bindir}/corepack" | ||
| 177 | RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ | ||
| 178 | python3-misc python3-multiprocessing" | ||
| 179 | |||
| 180 | PACKAGES =+ "${PN}-systemtap" | ||
| 181 | FILES:${PN}-systemtap = "${datadir}/systemtap" | ||
| 182 | |||
| 183 | do_configure[prefuncs] += "set_gyp_variables" | ||
| 184 | do_compile[prefuncs] += "set_gyp_variables" | ||
| 185 | do_install[prefuncs] += "set_gyp_variables" | ||
| 186 | python set_gyp_variables () { | ||
| 187 | if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "0": | ||
| 188 | # We don't want to cross-compile during target compile, | ||
| 189 | # and we need to use the right flags during host compile, | ||
| 190 | # too. | ||
| 191 | d.setVar("CC_host", d.getVar("CC") + " -pie -fPIE") | ||
| 192 | d.setVar("CFLAGS_host", d.getVar("CFLAGS")) | ||
| 193 | d.setVar("CXX_host", d.getVar("CXX") + " -pie -fPIE") | ||
| 194 | d.setVar("CXXFLAGS_host", d.getVar("CXXFLAGS")) | ||
| 195 | d.setVar("LDFLAGS_host", d.getVar("LDFLAGS")) | ||
| 196 | d.setVar("AR_host", d.getVar("AR")) | ||
| 197 | elif d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1": | ||
| 198 | # Enable upstream cross compile support | ||
| 199 | d.setVar("CC_host", d.getVar("BUILD_CC")) | ||
| 200 | d.setVar("CFLAGS_host", d.getVar("BUILD_CFLAGS")) | ||
| 201 | d.setVar("CXX_host", d.getVar("BUILD_CXX")) | ||
| 202 | d.setVar("CXXFLAGS_host", d.getVar("BUILD_CXXFLAGS")) | ||
| 203 | d.setVar("LDFLAGS_host", d.getVar("BUILD_LDFLAGS")) | ||
| 204 | d.setVar("AR_host", d.getVar("BUILD_AR")) | ||
| 205 | } | ||
| 206 | |||
| 207 | python __anonymous () { | ||
| 208 | # 32 bit target and 64 bit host (x86-64 or aarch64) have different bit width | ||
| 209 | if d.getVar("SITEINFO_BITS") == "32" and "64" in d.getVar("BUILD_ARCH"): | ||
| 210 | d.setVar("HOST_AND_TARGET_SAME_WIDTH", "0") | ||
| 211 | else: | ||
| 212 | d.setVar("HOST_AND_TARGET_SAME_WIDTH", "1") | ||
| 213 | } | ||
| 214 | |||
| 215 | BBCLASSEXTEND = "native" | ||
