f12ca5c7ca8474a6a863557a715f0af8cec50049
[AGL/meta-agl-demo.git] / recipes-demo / agl-demo-control-panel / agl-demo-control-panel_git.bb
1 SUMMARY     = "AGL demo control panel"
2 LICENSE     = "Apache-2.0"
3 LIC_FILES_CHKSUM = "file://LICENSE;md5=685e0faaaec2c2334cf8159ca6bd2975"
4
5 PV = "1.0+git${SRCPV}"
6
7 SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-demo-control-panel;protocol=https;branch=${AGL_BRANCH} \
8            file://agl-demo-control-panel.service \
9 "
10 SRCREV = "edfd96499fdbcf869c5182f2cfa89703cfb0dfd0"
11
12 S = "${WORKDIR}/git"
13
14 inherit systemd allarch
15
16 require recipes-config/agl-users/agl-users.inc
17
18 SYSTEMD_SERVICE:${PN} = "${BPN}.service"
19
20 do_configure[noexec] = "1"
21 do_compile[noexec] = "1"
22
23 do_install() {
24     # There's no provision for a Pythonic install into /usr/lib, so dump
25     # into a directory /usr/libexec.
26     install -d ${D}${libexecdir}/${BPN}
27     cp -drv ${S}/* ${D}${libexecdir}/${BPN}
28
29     # Remove stray shell script from Docker container build support to
30     # avoid QA complaints
31     rm -rf ${D}${libexecdir}/${BPN}/docker
32
33     install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
34     
35     # Install conf file
36     install -d ${D}/home/agl-driver/.local/share/agl-demo-control-panel
37     sed 's/=user-session/=AGL-databroker/' ${S}/extras/config.ini > \
38         ${D}/home/agl-driver/.local/share/agl-demo-control-panel/config.ini
39     chown -R agl-driver:agl-driver ${D}/home/agl-driver
40 }
41
42 # For now generate resource wrapper on first boot, as it looks non-trivial
43 # to get python3-pyqt5-native working to run pyrcc5 during build.
44 pkg_postinst_ontarget:${PN} () {
45     /usr/bin/pyrcc5 -o ${libexecdir}/${BPN}/res_rc.py ${libexecdir}/${BPN}/assets/res.qrc
46     true
47 }
48
49 FILES:${PN} += "/home/agl-driver"
50
51 RDEPENDS:${PN} += " \
52     python3 \
53     python3-modules \
54     python3-packaging \
55     python3-qtwidgets \
56     python3-can \
57     agl-users \
58     weston \
59 "