Make cluster dashboard KUKSA.val server configurable
[AGL/meta-agl-demo.git] / recipes-demo / flutter-cluster-dashboard / flutter-cluster-dashboard_git.bb
1 SUMMARY = "Flutter Instrument Cluster "
2 DESCRIPTION = "An instrument cluster app written in dart for the flutter runtime"
3 AUTHOR = "Aakash Solanki"
4 HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/apps/flutter-instrument-cluster"
5
6 SECTION = "graphics"
7
8 LICENSE = "Apache-2.0"
9 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0c52b0e4b5f0dbf57ea7d44bebb2e29d"
10
11 SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/flutter-instrument-cluster;protocol=https;branch=${AGL_BRANCH} \
12     file://flutter-cluster-dashboard.service \
13     file://flutter_cluster_dashboard_on_bg-debug.json \
14     file://flutter_cluster_dashboard_on_bg-profile.json \
15     file://flutter_cluster_dashboard_on_bg-release.json \
16     file://flutter-cluster-dashboard.yaml \
17     file://flutter-cluster-dashboard.yaml.demo \
18 "
19
20 PV = "1.0+git${SRCPV}"
21 SRCREV = "be4da312ad1f33cea62ba7c8768bb4060ee6a178"
22
23 S = "${WORKDIR}/git"
24
25 PUBSPEC_APPNAME = "flutter_cluster_dashboard"
26
27 FLUTTER_APPLICATION_INSTALL_PREFIX = "/flutter"
28
29 OPENROUTE_API_KEY ??= "YOU_NEED_TO_SET_IT_IN_LOCAL_CONF"
30
31 inherit flutter-app update-alternatives
32
33 CLUSTER_DEMO_VISS_HOSTNAME ??= "192.168.10.2"
34
35 APP_CONFIG = "flutter_cluster_dashboard_on_bg-release.json"
36 APP_CONFIG:class-runtimedebug = "flutter_cluster_dashboard_on_bg-debug.json"
37 APP_CONFIG:class-runtimeprofile = "flutter_cluster_dashboard_on_bg-profile.json"
38
39 do_install:append() {
40     install -D -m 0644 ${WORKDIR}/flutter-cluster-dashboard.service ${D}${systemd_user_unitdir}/flutter-cluster-dashboard.service
41     install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
42     ln -s ../flutter-cluster-dashboard.service ${D}${systemd_user_unitdir}/agl-session.target.wants/flutter-cluster-dashboard.service
43
44     install -D -m 0644 ${WORKDIR}/${APP_CONFIG} ${D}${datadir}/flutter/default.json
45
46     install -d ${D}${sysconfdir}/xdg/AGL
47     install -m 0644 ${WORKDIR}/flutter-cluster-dashboard.yaml \
48         ${D}${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default
49     install -m 0644 ${WORKDIR}/flutter-cluster-dashboard.yaml.demo ${D}${sysconfdir}/xdg/AGL/
50     sed -i "s/^hostname: .*/hostname: ${CLUSTER_DEMO_VISS_HOSTNAME}/" ${D}${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo
51
52     install -m 0755 -d ${D}${sysconfdir}/default/ 
53     echo 'OPENROUTE_API_KEY:${OPENROUTE_API_KEY}' >> ${D}${sysconfdir}/default/openroutekey
54 }
55
56 ALTERNATIVE_LINK_NAME[flutter-cluster-dashboard.yaml] = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml"
57
58 FILES:${PN} += "${datadir} ${systemd_user_unitdir} ${sysconfdir}/default/"
59
60 PACKAGE_BEFORE_PN += "${PN}-conf ${PN}-conf-demo"
61
62 FILES:${PN}-conf += "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default"
63 RDEPENDS:${PN}-conf = "${PN}"
64 RPROVIDES:${PN}-conf = "flutter-cluster-dashboard.yaml"
65 RCONFLICTS:${PN}-conf = "${PN}-conf-demo"
66 ALTERNATIVE:${PN}-conf = "flutter-cluster-dashboard.yaml"
67 ALTERNATIVE_TARGET_${PN}-conf = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default"
68
69 FILES:${PN}-conf-demo += "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo"
70 RDEPENDS:${PN}-conf-demo = "${PN}"
71 RPROVIDES:${PN}-conf-demo = "flutter-cluster-dashboard.yaml"
72 RCONFLICTS:${PN}-conf-demo = "${PN}-conf"
73 ALTERNATIVE:${PN}-conf-demo = "flutter-cluster-dashboard.yaml"
74 ALTERNATIVE_TARGET_${PN}-conf-demo = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo"