diff options
| author | Khem Raj <raj.khem@gmail.com> | 2020-08-13 21:54:13 -0700 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2021-01-13 08:10:20 -0800 |
| commit | 3fdb654e51a367a3efaf53bfe9a8e40d19b284f8 (patch) | |
| tree | 99e78f3dd4cd604b2094105d2e012f834622d698 /meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb | |
| parent | 85f254c7444a3fa51556502b1c3f6efe1ad5e8a0 (diff) | |
| download | meta-openembedded-3fdb654e51a367a3efaf53bfe9a8e40d19b284f8.tar.gz | |
nodejs: Upgrade to 12.18.3
Drop already upstreamed patches
use builtin uv, it does not build without it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit bda3ee6276d76a10d2b5564da5709db4c21b8f13)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb b/meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb new file mode 100644 index 0000000000..8a9f32bce2 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_12.18.3.bb | |||
| @@ -0,0 +1,160 @@ | |||
| 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=30e27bd6830002d9415e4a5da7901f03" | ||
| 5 | |||
| 6 | DEPENDS = "openssl" | ||
| 7 | DEPENDS_append_class-target = " nodejs-native" | ||
| 8 | |||
| 9 | inherit pkgconfig python3native | ||
| 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 | " | ||
| 25 | SRC_URI_append_class-target = " \ | ||
| 26 | file://0002-Using-native-binaries.patch \ | ||
| 27 | " | ||
| 28 | SRC_URI[sha256sum] = "71158026579487422fd13cc2553b34cddb76519098aa6030faab52f88c6e0d0e" | ||
| 29 | |||
| 30 | S = "${WORKDIR}/node-v${PV}" | ||
| 31 | |||
| 32 | # v8 errors out if you have set CCACHE | ||
| 33 | CCACHE = "" | ||
| 34 | |||
| 35 | def 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 | |||
| 45 | ARCHFLAGS_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)}" | ||
| 50 | GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " | ||
| 51 | ARCHFLAGS ?= "" | ||
| 52 | |||
| 53 | PACKAGECONFIG ??= "ares brotli icu zlib" | ||
| 54 | |||
| 55 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" | ||
| 56 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli" | ||
| 57 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | ||
| 58 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | ||
| 59 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | ||
| 60 | PACKAGECONFIG[shared] = "--shared" | ||
| 61 | PACKAGECONFIG[zlib] = "--shared-zlib,,zlib" | ||
| 62 | |||
| 63 | # We don't want to cross-compile during target compile, | ||
| 64 | # and we need to use the right flags during host compile, | ||
| 65 | # too. | ||
| 66 | EXTRA_OEMAKE = "\ | ||
| 67 | CC.host='${CC}' \ | ||
| 68 | CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \ | ||
| 69 | CXX.host='${CXX}' \ | ||
| 70 | CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \ | ||
| 71 | LDFLAGS.host='${LDFLAGS}' \ | ||
| 72 | AR.host='${AR}' \ | ||
| 73 | \ | ||
| 74 | builddir_name=./ \ | ||
| 75 | " | ||
| 76 | |||
| 77 | python do_unpack() { | ||
| 78 | import shutil | ||
| 79 | |||
| 80 | bb.build.exec_func('base_do_unpack', d) | ||
| 81 | |||
| 82 | shutil.rmtree(d.getVar('S') + '/deps/openssl', True) | ||
| 83 | if 'ares' in d.getVar('PACKAGECONFIG'): | ||
| 84 | shutil.rmtree(d.getVar('S') + '/deps/cares', True) | ||
| 85 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
| 86 | shutil.rmtree(d.getVar('S') + '/deps/brotli', True) | ||
| 87 | if 'libuv' in d.getVar('PACKAGECONFIG'): | ||
| 88 | shutil.rmtree(d.getVar('S') + '/deps/uv', True) | ||
| 89 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | ||
| 90 | shutil.rmtree(d.getVar('S') + '/deps/nghttp2', True) | ||
| 91 | if 'zlib' in d.getVar('PACKAGECONFIG'): | ||
| 92 | shutil.rmtree(d.getVar('S') + '/deps/zlib', True) | ||
| 93 | } | ||
| 94 | |||
| 95 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 96 | do_configure () { | ||
| 97 | export LD="${CXX}" | ||
| 98 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 99 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 100 | python3 configure.py --prefix=${prefix} --cross-compiling --without-snapshot --shared-openssl \ | ||
| 101 | --without-dtrace \ | ||
| 102 | --without-etw \ | ||
| 103 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 104 | --dest-os=linux \ | ||
| 105 | --libdir=${D}${libdir} \ | ||
| 106 | ${ARCHFLAGS} \ | ||
| 107 | ${PACKAGECONFIG_CONFARGS} | ||
| 108 | } | ||
| 109 | |||
| 110 | do_compile () { | ||
| 111 | export LD="${CXX}" | ||
| 112 | oe_runmake BUILDTYPE=Release | ||
| 113 | } | ||
| 114 | |||
| 115 | do_install () { | ||
| 116 | oe_runmake install DESTDIR=${D} | ||
| 117 | |||
| 118 | # wasn't updated since 2009 and is the only thing requiring python2 in runtime | ||
| 119 | # 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] | ||
| 120 | rm -f ${D}${exec_prefix}/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples | ||
| 121 | } | ||
| 122 | |||
| 123 | do_install_append_class-native() { | ||
| 124 | # use node from PATH instead of absolute path to sysroot | ||
| 125 | # node-v0.10.25/tools/install.py is using: | ||
| 126 | # shebang = os.path.join(node_prefix, 'bin/node') | ||
| 127 | # update_shebang(link_path, shebang) | ||
| 128 | # and node_prefix can be very long path to bindir in native sysroot and | ||
| 129 | # when it exceeds 128 character shebang limit it's stripped to incorrect path | ||
| 130 | # and npm fails to execute like in this case with 133 characters show in log.do_install: | ||
| 131 | # 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 | ||
| 132 | # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js | ||
| 133 | # use sed on npm-cli.js because otherwise symlink is replaced with normal file and | ||
| 134 | # npm-cli.js continues to use old shebang | ||
| 135 | sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 136 | |||
| 137 | # Install the native binaries to provide it within sysroot for the target compilation | ||
| 138 | install -d ${D}${bindir} | ||
| 139 | install -m 0755 ${S}/out/Release/torque ${D}${bindir}/torque | ||
| 140 | install -m 0755 ${S}/out/Release/bytecode_builtins_list_generator ${D}${bindir}/bytecode_builtins_list_generator | ||
| 141 | if ${@bb.utils.contains('PACKAGECONFIG','icu','true','false',d)}; then | ||
| 142 | install -m 0755 ${S}/out/Release/gen-regexp-special-case ${D}${bindir}/gen-regexp-special-case | ||
| 143 | fi | ||
| 144 | install -m 0755 ${S}/out/Release/mkcodecache ${D}${bindir}/mkcodecache | ||
| 145 | install -m 0755 ${S}/out/Release/node_mksnapshot ${D}${bindir}/node_mksnapshot | ||
| 146 | } | ||
| 147 | |||
| 148 | do_install_append_class-target() { | ||
| 149 | sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 150 | } | ||
| 151 | |||
| 152 | PACKAGES =+ "${PN}-npm" | ||
| 153 | FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx" | ||
| 154 | RDEPENDS_${PN}-npm = "bash python3-core python3-shell python3-datetime \ | ||
| 155 | python3-misc python3-multiprocessing" | ||
| 156 | |||
| 157 | PACKAGES =+ "${PN}-systemtap" | ||
| 158 | FILES_${PN}-systemtap = "${datadir}/systemtap" | ||
| 159 | |||
| 160 | BBCLASSEXTEND = "native" | ||
