diff options
| author | Khem Raj <raj.khem@gmail.com> | 2021-10-16 08:18:32 -0700 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2021-10-17 16:15:21 -0700 |
| commit | 246b20b92c0e7e6d907385c32eb11f4350a7defa (patch) | |
| tree | ddccd9e72712ea951aff20dd19a82cd3276b2c0d /meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb | |
| parent | 948ee7c2e99fa275de437eee168bc63eee33cea4 (diff) | |
| download | meta-openembedded-246b20b92c0e7e6d907385c32eb11f4350a7defa.tar.gz | |
nodejs: Upgrade to 14.18.1
License-Update: Reflect new location of gtest sources
remove node-inspect from license
update Acorn to v8.4.1
Use internal openssl until nodejs is fixed to work with openssl3
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb deleted file mode 100644 index d468f2518e..0000000000 --- a/meta-oe/recipes-devtools/nodejs/nodejs_14.17.1.bb +++ /dev/null | |||
| @@ -1,204 +0,0 @@ | |||
| 1 | DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript" | ||
| 2 | HOMEPAGE = "http://nodejs.org" | ||
| 3 | LICENSE = "MIT & BSD & Artistic-2.0" | ||
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a1016f9b7979cfe6fc3466a9bba60b1e" | ||
| 5 | |||
| 6 | DEPENDS = "openssl" | ||
| 7 | DEPENDS:append:class-target = " qemu-native" | ||
| 8 | |||
| 9 | inherit pkgconfig python3native qemu | ||
| 10 | |||
| 11 | COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*" | ||
| 12 | COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*" | ||
| 13 | COMPATIBLE_MACHINE:mips64 = "(!.*mips64).*" | ||
| 14 | |||
| 15 | COMPATIBLE_HOST:riscv64 = "null" | ||
| 16 | COMPATIBLE_HOST:riscv32 = "null" | ||
| 17 | |||
| 18 | SRC_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 | file://big-endian.patch \ | ||
| 23 | file://mips-warnings.patch \ | ||
| 24 | file://mips-less-memory.patch \ | ||
| 25 | file://0001-jinja-tests.py-add-py-3.10-fix.patch \ | ||
| 26 | " | ||
| 27 | SRC_URI:append:class-target = " \ | ||
| 28 | file://0002-Using-native-binaries.patch \ | ||
| 29 | " | ||
| 30 | SRC_URI:append:toolchain-clang:x86 = " \ | ||
| 31 | file://libatomic.patch \ | ||
| 32 | " | ||
| 33 | SRC_URI:append:toolchain-clang:powerpc64le = " \ | ||
| 34 | file://0001-ppc64-Do-not-use-mminimal-toc-with-clang.patch \ | ||
| 35 | " | ||
| 36 | SRC_URI[sha256sum] = "ddf1d2d56ddf35ecd98c5ea5ddcd690b245899f289559b4330c921255f5a247f" | ||
| 37 | |||
| 38 | S = "${WORKDIR}/node-v${PV}" | ||
| 39 | |||
| 40 | # v8 errors out if you have set CCACHE | ||
| 41 | CCACHE = "" | ||
| 42 | |||
| 43 | def map_nodejs_arch(a, d): | ||
| 44 | import re | ||
| 45 | |||
| 46 | if re.match('i.86$', a): return 'ia32' | ||
| 47 | elif re.match('x86_64$', a): return 'x64' | ||
| 48 | elif re.match('aarch64$', a): return 'arm64' | ||
| 49 | elif re.match('(powerpc64|powerpc64le|ppc64le)$', a): return 'ppc64' | ||
| 50 | elif re.match('powerpc$', a): return 'ppc' | ||
| 51 | return a | ||
| 52 | |||
| 53 | ARCHFLAGS:arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ | ||
| 54 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ | ||
| 55 | bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ | ||
| 56 | bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ | ||
| 57 | '--with-arm-fpu=vfp', d), d), d)}" | ||
| 58 | GYP_DEFINES:append:mipsel = " mips_arch_variant='r1' " | ||
| 59 | ARCHFLAGS ?= "" | ||
| 60 | |||
| 61 | PACKAGECONFIG ??= "ares brotli icu zlib" | ||
| 62 | |||
| 63 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" | ||
| 64 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli" | ||
| 65 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | ||
| 66 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | ||
| 67 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | ||
| 68 | PACKAGECONFIG[shared] = "--shared" | ||
| 69 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | ||
| 70 | |||
| 71 | # We don't want to cross-compile during target compile, | ||
| 72 | # and we need to use the right flags during host compile, | ||
| 73 | # too. | ||
| 74 | EXTRA_OEMAKE = "\ | ||
| 75 | CC.host='${CC}' \ | ||
| 76 | CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \ | ||
| 77 | CXX.host='${CXX}' \ | ||
| 78 | CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \ | ||
| 79 | LDFLAGS.host='${LDFLAGS}' \ | ||
| 80 | AR.host='${AR}' \ | ||
| 81 | \ | ||
| 82 | builddir_name=./ \ | ||
| 83 | " | ||
| 84 | |||
| 85 | python do_unpack() { | ||
| 86 | import shutil | ||
| 87 | |||
| 88 | bb.build.exec_func('base_do_unpack', d) | ||
| 89 | |||
| 90 | shutil.rmtree(d.getVar('S') + '/deps/openssl', True) | ||
| 91 | if 'ares' in d.getVar('PACKAGECONFIG'): | ||
| 92 | shutil.rmtree(d.getVar('S') + '/deps/cares', True) | ||
| 93 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
| 94 | shutil.rmtree(d.getVar('S') + '/deps/brotli', True) | ||
| 95 | if 'libuv' in d.getVar('PACKAGECONFIG'): | ||
| 96 | shutil.rmtree(d.getVar('S') + '/deps/uv', True) | ||
| 97 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | ||
| 98 | shutil.rmtree(d.getVar('S') + '/deps/nghttp2', True) | ||
| 99 | if 'zlib' in d.getVar('PACKAGECONFIG'): | ||
| 100 | shutil.rmtree(d.getVar('S') + '/deps/zlib', True) | ||
| 101 | } | ||
| 102 | |||
| 103 | # V8's JIT infrastructure requires binaries such as mksnapshot and | ||
| 104 | # mkpeephole to be run in the host during the build. However, these | ||
| 105 | # binaries must have the same bit-width as the target (e.g. a x86_64 | ||
| 106 | # host targeting ARMv6 needs to produce a 32-bit binary). Instead of | ||
| 107 | # depending on a third Yocto toolchain, we just build those binaries | ||
| 108 | # for the target and run them on the host with QEMU. | ||
| 109 | python do_create_v8_qemu_wrapper () { | ||
| 110 | """Creates a small wrapper that invokes QEMU to run some target V8 binaries | ||
| 111 | on the host.""" | ||
| 112 | qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), | ||
| 113 | d.expand('${STAGING_DIR_HOST}${base_libdir}')] | ||
| 114 | qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST', True), | ||
| 115 | qemu_libdirs) | ||
| 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 | # Keep until openssl 3.x compatibility is fixed | ||
| 133 | CXXFLAGS += "-fpermissive" | ||
| 134 | BUILD_CXXFLAGS += "-fpermissive" | ||
| 135 | |||
| 136 | LDFLAGS:append:x86 = " -latomic" | ||
| 137 | |||
| 138 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 139 | do_configure () { | ||
| 140 | export LD="${CXX}" | ||
| 141 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 142 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 143 | python3 configure.py --prefix=${prefix} --cross-compiling --shared-openssl \ | ||
| 144 | --without-dtrace \ | ||
| 145 | --without-etw \ | ||
| 146 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 147 | --dest-os=linux \ | ||
| 148 | --libdir=${D}${libdir} \ | ||
| 149 | ${ARCHFLAGS} \ | ||
| 150 | ${PACKAGECONFIG_CONFARGS} | ||
| 151 | } | ||
| 152 | |||
| 153 | do_compile () { | ||
| 154 | export LD="${CXX}" | ||
| 155 | install -Dm 0755 ${B}/v8-qemu-wrapper.sh ${B}/out/Release/v8-qemu-wrapper.sh | ||
| 156 | oe_runmake BUILDTYPE=Release | ||
| 157 | } | ||
| 158 | |||
| 159 | do_install () { | ||
| 160 | oe_runmake install DESTDIR=${D} | ||
| 161 | |||
| 162 | # wasn't updated since 2009 and is the only thing requiring python2 in runtime | ||
| 163 | # 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] | ||
| 164 | rm -f ${D}${exec_prefix}/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples | ||
| 165 | } | ||
| 166 | |||
| 167 | do_install:append:class-native() { | ||
| 168 | # use node from PATH instead of absolute path to sysroot | ||
| 169 | # node-v0.10.25/tools/install.py is using: | ||
| 170 | # shebang = os.path.join(node_prefix, 'bin/node') | ||
| 171 | # update_shebang(link_path, shebang) | ||
| 172 | # and node_prefix can be very long path to bindir in native sysroot and | ||
| 173 | # when it exceeds 128 character shebang limit it's stripped to incorrect path | ||
| 174 | # and npm fails to execute like in this case with 133 characters show in log.do_install: | ||
| 175 | # 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 | ||
| 176 | # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js | ||
| 177 | # use sed on npm-cli.js because otherwise symlink is replaced with normal file and | ||
| 178 | # npm-cli.js continues to use old shebang | ||
| 179 | sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 180 | |||
| 181 | # Install the native binaries to provide it within sysroot for the target compilation | ||
| 182 | install -d ${D}${bindir} | ||
| 183 | install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque | ||
| 184 | install -m 0755 ${S}/out/Release/bytecode_builtins_list_generator ${D}${bindir}/bytecode_builtins_list_generator | ||
| 185 | if ${@bb.utils.contains('PACKAGECONFIG','icu','true','false',d)}; then | ||
| 186 | install -m 0755 ${S}/out/Release/gen-regexp-special-case ${D}${bindir}/gen-regexp-special-case | ||
| 187 | fi | ||
| 188 | install -m 0755 ${S}/out/Release/mkcodecache ${D}${bindir}/mkcodecache | ||
| 189 | install -m 0755 ${S}/out/Release/node_mksnapshot ${D}${bindir}/node_mksnapshot | ||
| 190 | } | ||
| 191 | |||
| 192 | do_install:append:class-target() { | ||
| 193 | sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 194 | } | ||
| 195 | |||
| 196 | PACKAGES =+ "${PN}-npm" | ||
| 197 | FILES:${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx" | ||
| 198 | RDEPENDS:${PN}-npm = "bash python3-core python3-shell python3-datetime \ | ||
| 199 | python3-misc python3-multiprocessing" | ||
| 200 | |||
| 201 | PACKAGES =+ "${PN}-systemtap" | ||
| 202 | FILES:${PN}-systemtap = "${datadir}/systemtap" | ||
| 203 | |||
| 204 | BBCLASSEXTEND = "native" | ||
