|
| 1 | +DESCRIPTION = "Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine" |
| 2 | +HOMEPAGE = "http://nodejs.org" |
| 3 | + |
| 4 | +LICENSE = "MIT" |
| 5 | + |
| 6 | +COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*" |
| 7 | +# COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*" |
| 8 | +COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*" |
| 9 | + |
| 10 | +INC_PR = "r1" |
| 11 | +PR = "${INC_PR}.0" |
| 12 | + |
| 13 | +PROVIDES = "node" |
| 14 | +RPROVIDES_${PN} = "node" |
| 15 | + |
| 16 | +SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz;name=src" |
| 17 | + |
| 18 | +S = "${WORKDIR}/node-v${PV}" |
| 19 | + |
| 20 | +# v8 errors out if you have set CCACHE |
| 21 | +CCACHE = "" |
| 22 | + |
| 23 | +inherit nodejs-arch |
| 24 | + |
| 25 | +ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \ |
| 26 | + ${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \ |
| 27 | + bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \ |
| 28 | + bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \ |
| 29 | + '--with-arm-fpu=vfp', d), d), d)}" |
| 30 | +ARCHFLAGS ?= "" |
| 31 | + |
| 32 | +GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " |
| 33 | + |
| 34 | +PACKAGECONFIG ??= "zlib openssl" |
| 35 | + |
| 36 | +PACKAGECONFIG[zlib] = "--shared-zlib,,zlib," |
| 37 | +PACKAGECONFIG[openssl] = "--shared-openssl,,openssl," |
| 38 | +PACKAGECONFIG[v8-inspector] = ",--without-inspector,," |
| 39 | + |
| 40 | +DISABLE_STATIC = "" |
| 41 | + |
| 42 | +do_configure () { |
| 43 | + export LD="${CXX}" |
| 44 | + GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES |
| 45 | + ./configure --prefix="${prefix}" \ |
| 46 | + --dest-cpu="${@nodejs_map_dest_cpu(d.getVar('TARGET_ARCH', True), d)}" \ |
| 47 | + --dest-os=linux ${ARCHFLAGS} \ |
| 48 | + --without-snapshot \ |
| 49 | + --with-intl=none \ |
| 50 | + ${EXTRA_OECONF} |
| 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 | + # make sure we use node from PATH instead of absolute path to sysroot |
| 64 | + sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js |
| 65 | +} |
| 66 | + |
| 67 | +do_install_append_class-nativesdk() { |
| 68 | + # make sure we use node from PATH instead of absolute path to sysroot |
| 69 | + sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js |
| 70 | + sed "1s^.*^#\!/usr/bin/env python^g" -i ${D}${exec_prefix}/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples |
| 71 | +} |
| 72 | + |
| 73 | +do_install_append_class-target() { |
| 74 | + # make sure we use node from PATH instead of absolute path to sysroot |
| 75 | + sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js |
| 76 | +} |
| 77 | + |
| 78 | +PACKAGES =+ "${PN}-npm" |
| 79 | +FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm" |
| 80 | +RDEPENDS_${PN}-npm = "bash python-compiler python-shell python-datetime python-subprocess python-multiprocessing python-crypt python-textutils python-netclient python-misc" |
| 81 | + |
| 82 | +PACKAGES =+ "${PN}-dtrace" |
| 83 | +FILES_${PN}-dtrace = "${exec_prefix}/lib/dtrace" |
| 84 | + |
| 85 | +PACKAGES =+ "${PN}-systemtap" |
| 86 | +FILES_${PN}-systemtap = "${datadir}/systemtap" |
| 87 | + |
| 88 | +INSANE_SKIP_${PN} += "file-rdeps" |
| 89 | +INSANE_SKIP_${PN}-dbg += "host-user-contaminated" |
| 90 | + |
| 91 | +BBCLASSEXTEND = "native nativesdk" |
0 commit comments