diff options
Diffstat (limited to 'meta-oe/recipes-devtools/nodejs/nodejs_8.9.4.bb')
-rw-r--r-- | meta-oe/recipes-devtools/nodejs/nodejs_8.9.4.bb | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_8.9.4.bb b/meta-oe/recipes-devtools/nodejs/nodejs_8.9.4.bb new file mode 100644 index 000000000..afd2d96d8 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs_8.9.4.bb | |||
@@ -0,0 +1,89 @@ | |||
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=270f7477a1705f7cd3e29d3d4512915d" | ||
5 | |||
6 | DEPENDS = "openssl10 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] = "631ed102fe58c13cf63bc92a68cf4759" | ||
16 | SRC_URI[sha256sum] = "6cdcde9c9c1ca9f450a0b24eafa229ca759e576daa0fae892ce74d541ecdc86f" | ||
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 | |||
85 | PACKAGES =+ "${PN}-systemtap" | ||
86 | FILES_${PN}-systemtap = "${datadir}/systemtap" | ||
87 | |||
88 | |||
89 | BBCLASSEXTEND = "native" | ||