diff options
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_8.11.2.bb')
| -rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_8.11.2.bb | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_8.11.2.bb b/meta-oe/recipes-devtools/nodejs/nodejs_8.11.2.bb new file mode 100644 index 0000000000..4e81b03926 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_8.11.2.bb | |||
| @@ -0,0 +1,90 @@ | |||
| 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=fde91d5c5bbd1e0389623e1ac018d9e8" | ||
| 5 | |||
| 6 | DEPENDS = "openssl zlib" | ||
| 7 | |||
| 8 | COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*" | ||
| 9 | COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*" | ||
| 10 | COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" | ||
| 11 | |||
| 12 | SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | ||
| 13 | file://0001-Disable-running-gyp-files-for-bundled-deps.patch \ | ||
| 14 | " | ||
| 15 | SRC_URI[md5sum] = "56be405b63b8c6c8ecd98c002fb15e4a" | ||
| 16 | SRC_URI[sha256sum] = "539946c0381809576bed07424a35fc1740d52f4bd56305d6278d9e76c88f4979" | ||
| 17 | |||
| 18 | S = "${WORKDIR}/node-v${PV}" | ||
| 19 | |||
| 20 | # v8 errors out if you have set CCACHE | ||
| 21 | CCACHE = "" | ||
| 22 | |||
| 23 | def map_nodejs_arch(a, d): | ||
| 24 | import re | ||
| 25 | |||
| 26 | if re.match('i.86$', a): return 'ia32' | ||
| 27 | elif re.match('x86_64$', a): return 'x64' | ||
| 28 | elif re.match('aarch64$', a): return 'arm64' | ||
| 29 | elif re.match('(powerpc64|ppc64le)$', a): return 'ppc64' | ||
| 30 | elif re.match('powerpc$', a): return 'ppc' | ||
| 31 | return a | ||
| 32 | |||
| 33 | ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ | ||
| 34 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ | ||
| 35 | bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ | ||
| 36 | bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ | ||
| 37 | '--with-arm-fpu=vfp', d), d), d)}" | ||
| 38 | GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " | ||
| 39 | ARCHFLAGS ?= "" | ||
| 40 | |||
| 41 | # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi | ||
| 42 | do_configure () { | ||
| 43 | rm -rf ${S}/deps/openssl | ||
| 44 | export LD="${CXX}" | ||
| 45 | GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES | ||
| 46 | # $TARGET_ARCH settings don't match --dest-cpu settings | ||
| 47 | ./configure --prefix=${prefix} --without-intl --without-snapshot --shared-openssl --shared-zlib \ | ||
| 48 | --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ | ||
| 49 | --dest-os=linux \ | ||
| 50 | ${ARCHFLAGS} | ||
| 51 | } | ||
| 52 | |||
| 53 | do_compile () { | ||
| 54 | export LD="${CXX}" | ||
| 55 | oe_runmake BUILDTYPE=Release | ||
| 56 | } | ||
| 57 | |||
| 58 | do_install () { | ||
| 59 | oe_runmake install DESTDIR=${D} | ||
| 60 | } | ||
| 61 | |||
| 62 | do_install_append_class-native() { | ||
| 63 | # use node from PATH instead of absolute path to sysroot | ||
| 64 | # node-v0.10.25/tools/install.py is using: | ||
| 65 | # shebang = os.path.join(node_prefix, 'bin/node') | ||
| 66 | # update_shebang(link_path, shebang) | ||
| 67 | # and node_prefix can be very long path to bindir in native sysroot and | ||
| 68 | # when it exceeds 128 character shebang limit it's stripped to incorrect path | ||
| 69 | # and npm fails to execute like in this case with 133 characters show in log.do_install: | ||
| 70 | # 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 | ||
| 71 | # /usr/bin/npm is symlink to /usr/lib/node_modules/npm/bin/npm-cli.js | ||
| 72 | # use sed on npm-cli.js because otherwise symlink is replaced with normal file and | ||
| 73 | # npm-cli.js continues to use old shebang | ||
| 74 | sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 75 | } | ||
| 76 | |||
| 77 | do_install_append_class-target() { | ||
| 78 | sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js | ||
| 79 | } | ||
| 80 | |||
| 81 | PACKAGES =+ "${PN}-npm" | ||
| 82 | FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm ${bindir}/npx" | ||
| 83 | RDEPENDS_${PN}-npm = "bash python-shell python-datetime python-subprocess python-textutils \ | ||
| 84 | python-compiler python-misc python-multiprocessing" | ||
| 85 | |||
| 86 | PACKAGES =+ "${PN}-systemtap" | ||
| 87 | FILES_${PN}-systemtap = "${datadir}/systemtap" | ||
| 88 | |||
| 89 | |||
| 90 | BBCLASSEXTEND = "native" | ||
