summaryrefslogtreecommitdiff
path: root/recipes-devtools/node-red/node-red_0.11.1.bb
blob: bcf5a67645f10b6dd57f7bd43cd917450a62791e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
DESCRIPTION = "Node-RED"
HOMEPAGE = "http://nodered.org"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
DEPENDS = "nodejs nodejs-native"
RDEPENDS_${PN} += "bash"
PR = "r0"

inherit npm-base


S = "${WORKDIR}"

do_install() {

    # npm install locally
    oe_runnpm install --prefix ./ node-red@0.11.1

    # npm install more stuff
    oe_runnpm install --prefix./node_modules/node-red nodemailer 
    # Build patched serialport.
    # Original is https://registry.npmjs.org/serialport/-/serialport-1.7.4.tgz
    oe_runnpm install  --prefix ./node_modules/node-red http://multitech.net/mlinux/sources/node-red-serialport-1.7.4-mt1.tgz

    # modules needed for loragw
    oe_runnpm install --prefix ./node_modules/node-red extend dissolve node-constants

    # install m2x node
    oe_runnpm install --prefix ./node_modules/node-red node-red-m2x

    # remove dupe deps
    oe_runnpm dedupe

    # remove Raspberry PI node
    rm ./node_modules/node-red/nodes/core/hardware/36-rpi-gpio.html
    rm ./node_modules/node-red/nodes/core/hardware/36-rpi-gpio.js
    rm ./node_modules/node-red/nodes/core/hardware/nrgpio
    rm ./node_modules/node-red/nodes/core/hardware/nrgpio.py

    # remove x86_64 serialport 0.0.5
    rm -r ./node_modules/node-red/node_modules/node-red-node-serialport

    # install node-red
    install -d ${D}/opt/node-red
    cp -r ./node_modules/node-red/* ${D}/opt/node-red/
}

FILES_${PN} += "/opt/node-red"