Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ BBFILE_PATTERN_nodejs := "^${LAYERDIR}/"
BBFILE_PRIORITY_nodejs = "45"

LAYERDEPENDS_nodejs = "core"
LAYERSERIES_COMPAT_nodejs = "rocko"
8 changes: 8 additions & 0 deletions recipes-devtools/nodejs/nodejs_10.15.2.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require nodejs_10.inc

INC_PR = "r1"

LIC_FILES_CHKSUM = "file://LICENSE;md5=9ceeba79eb2ea1067b7b3ed16fff8bab"

SRC_URI[src.md5sum] = "4ecb2ff4c835a669502ad98437c75123"
SRC_URI[src.sha256sum] = "3b81ea6b0ae1c887ed4215d6a0b9349284c811bd98c8ddd7a0370f6cc9eb8182"
99 changes: 99 additions & 0 deletions recipes-devtools/nodejs/nodejs_10.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
DESCRIPTION = "Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine"
HOMEPAGE = "http://nodejs.org"

LICENSE = "MIT"

#COMPATIBLE_MACHINE_armv4 = "(!.*armv4).*"
# COMPATIBLE_MACHINE_armv5 = "(!.*armv5).*"
#COMPATIBLE_MACHINE_mips64 = "(!.*mips64).*"

INC_PR = "r1"
PR = "${INC_PR}.4"

PROVIDES = "node"
RPROVIDES_${PN} = "node"

SRC_URI = "https://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz;name=src"

S = "${WORKDIR}/node-v${PV}"

# v8 errors out if you have set CCACHE
CCACHE = ""

inherit nodejs-arch

ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--with-arm-float-abi=hard', '--with-arm-float-abi=softfp', d)} \
${@bb.utils.contains('TUNE_FEATURES', 'neon', '--with-arm-fpu=neon', \
bb.utils.contains('TUNE_FEATURES', 'vfpv3d16', '--with-arm-fpu=vfpv3-d16', \
bb.utils.contains('TUNE_FEATURES', 'vfpv3', '--with-arm-fpu=vfpv3', \
'--with-arm-fpu=vfp', d), d), d)}"
ARCHFLAGS ?= ""

CROSSCONF = "--cross-compiling"
CROSSCONF_class-native ="--no-cross-compiling"

GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' "

#PACKAGECONFIG ??= "zlib openssl"
PACKAGECONFIG ??= ""

PACKAGECONFIG[zlib] = "--shared-zlib,,,"
PACKAGECONFIG[openssl] = "--shared-openssl,,,"
PACKAGECONFIG[v8-inspector] = ",--without-inspector,,"

DISABLE_STATIC = ""

export CXX_host = "${BUILD_CXX}"
export CC_host = "${BUILD_CC}"
export CXXFLAGS_host = "${BUILD_CXXFLAGS}"
export CFLAGS_host = "${BUILD_CFLAGS}"

do_configure () {
GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
./configure --prefix="${prefix}" \
--dest-cpu="${@nodejs_map_dest_cpu(d.getVar('TARGET_ARCH', True), d)}" \
--dest-os=linux ${ARCHFLAGS} \
--with-intl=none \
--without-snapshot \
${CROSSCONF} \
${PACKAGECONFIG_CONFARGS}
}

do_compile () {
oe_runmake BUILDTYPE=Release
}

do_install () {
oe_runmake install DESTDIR="${D}"
}

do_install_append_class-native() {
# make sure we use node from PATH instead of absolute path to sysroot
sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
}

do_install_append_class-nativesdk() {
# make sure we use node from PATH instead of absolute path to sysroot
sed "1s^.*^#\!/usr/bin/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
sed "1s^.*^#\!/usr/bin/env python^g" -i ${D}${exec_prefix}/lib/node_modules/npm/node_modules/node-gyp/gyp/samples/samples
}

do_install_append_class-target() {
# make sure we use node from PATH instead of absolute path to sysroot
sed "1s^.*^#\!${bindir}/env node^g" -i ${D}${exec_prefix}/lib/node_modules/npm/bin/npm-cli.js
}

PACKAGES =+ "${PN}-npm"
FILES_${PN}-npm = "${exec_prefix}/lib/node_modules ${bindir}/npm"
RDEPENDS_${PN}-npm = "bash python-compiler python-shell python-datetime python-subprocess python-multiprocessing python-crypt python-textutils python-netclient python-misc"

PACKAGES =+ "${PN}-dtrace"
FILES_${PN}-dtrace = "${exec_prefix}/lib/dtrace"

PACKAGES =+ "${PN}-systemtap"
FILES_${PN}-systemtap = "${datadir}/systemtap"

INSANE_SKIP_${PN} += "file-rdeps"
INSANE_SKIP_${PN}-dbg += "host-user-contaminated"

BBCLASSEXTEND = "native nativesdk"