summaryrefslogtreecommitdiffstats
path: root/meta-uhmi/meta-distributed-display-fw/recipes-core/ula-tools/ula-tools_git.bb
blob: 9b945a3f0ca4749011501fdb8625d3a567ed3f29 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
SUMMARY = "Unified HMI Layout Tools"
SECTION = "graphics"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/ula-tools/LICENSE.md;md5=e789951aab02a3028d2e58b90fc933ba"

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

PN="ula-tools"
PROVIDES += "ula-tools"

SRCREV = "4403efd88fd4e79b092787ac727afe996dd7ca12"
BRANCH ?= "main"
SRC_URI = " \
    git://github.com/unified-hmi/ula-tools.git;protocol=https;branch=${BRANCH} \
"
PV = "0.0+git${SRCPV}"

S = "${WORKDIR}/git"


export GO111MODULE="auto"

GO_IMPORT = "ula-tools"
GO_INSTALL = " ${GO_IMPORT}/cmd/ula-distrib-com  ${GO_IMPORT}/cmd/ula-node"


inherit go
RDEPENDS:${PN}  = "jq bash"
RDEPENDS:${PN}-dev  = "bash"

inherit systemd

SRC_URI += " \
	file://ula-node.service \
	file://virtual-screen-def.json \
	"

REQUIRED_DISTRO_FEATURES = "systemd"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "ula-node.service"
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
FILES:${PN} += " \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/${SYSTEMD_SERVICE}', '', d)} \
    /etc/uhmi-framework/virtual-screen-def.json \
    "

do_compile:append() {
    export CGO_ENABLED="1"
    ${GO} build  -buildmode=c-shared -o ${GOPATH}/pkg/libulaclient.so -v -ldflags '-extldflags "-Wl,-soname=libulaclient.so"' ${GO_IMPORT}/pkg/ula-client-lib
}


do_install:append() {
    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}${systemd_system_unitdir}
        install -m 644 ${WORKDIR}/*.service ${D}/${systemd_system_unitdir}
    fi

    install -d ${D}/etc/uhmi-framework
    install -m 644 ${WORKDIR}/virtual-screen-def.json ${D}/etc/uhmi-framework

    install -d ${D}${libdir}
    install -m 0755 ${GOPATH}/pkg/libulaclient.so ${D}${libdir}

    install -d ${D}${includedir}
    install -m 644 ${GOPATH}/pkg/libulaclient.h ${D}${includedir}

}

FILES:${PN} += "${libdir}"
FILES:${PN} += "${includedir}"