Rework the flutter-homescreen and flutter-cluster-dashboard systemd
units to get the Flutter version and runtime type from the environment
file installed by the new agl-flutter-env recipe, and update their
JSON configuration files to remove the hardcoding of their bundle
paths.
Bug-AGL: SPEC-4819
Change-Id: I841db2cbb3acfe4aad173e9b8aa25ff2e201c2e2
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
After=agl-compositor.service
[Service]
After=agl-compositor.service
[Service]
-ExecStart=/usr/bin/flutter-auto --j=/usr/share/flutter/default.json
+EnvironmentFile=/etc/default/flutter
+EnvironmentFile=-/etc/default/flutter-cluster-dashboard
+ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/flutter_cluster_dashboard/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --j=/usr/share/flutter/flutter-cluster-dashboard.json
Restart=on-failure
[Install]
Restart=on-failure
[Install]
"view": [
{
"window_type": "BG",
"view": [
{
"window_type": "BG",
- "bundle_path": "/usr/share/flutter/flutter_cluster_dashboard/3.3.7/release",
"width": 1920,
"height": 1080,
"fullscreen": true
"width": 1920,
"height": 1080,
"fullscreen": true
APP_CONFIG = "flutter_cluster_dashboard_on_bg.json"
do_install:append() {
APP_CONFIG = "flutter_cluster_dashboard_on_bg.json"
do_install:append() {
- install -D -m 0644 ${WORKDIR}/flutter-cluster-dashboard.service ${D}${systemd_user_unitdir}/flutter-cluster-dashboard.service
+ install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_user_unitdir}/${BPN}.service
install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
- ln -s ../flutter-cluster-dashboard.service ${D}${systemd_user_unitdir}/agl-session.target.wants/flutter-cluster-dashboard.service
+ ln -s ../${BPN}.service ${D}${systemd_user_unitdir}/agl-session.target.wants/${BPN}.service
- install -D -m 0644 ${WORKDIR}/${APP_CONFIG} ${D}${datadir}/flutter/default.json
+ install -D -m 0644 ${WORKDIR}/${APP_CONFIG} ${D}${datadir}/flutter/${BPN}.json
install -d ${D}${sysconfdir}/xdg/AGL
install -d ${D}${sysconfdir}/xdg/AGL
- install -m 0644 ${WORKDIR}/flutter-cluster-dashboard.yaml \
- ${D}${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default
- install -m 0644 ${WORKDIR}/flutter-cluster-dashboard.yaml.demo ${D}${sysconfdir}/xdg/AGL/
- sed -i "s/^hostname: .*/hostname: ${CLUSTER_DEMO_VISS_HOSTNAME}/" ${D}${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo
+ install -m 0644 ${WORKDIR}/${BPN}.yaml ${D}${sysconfdir}/xdg/AGL/${BPN}.yaml.default
+ install -m 0644 ${WORKDIR}/${BPN}.yaml.demo ${D}${sysconfdir}/xdg/AGL/
+ sed -i "s/^hostname: .*/hostname: ${CLUSTER_DEMO_VISS_HOSTNAME}/" ${D}${sysconfdir}/xdg/AGL/${BPN}.yaml.demo
install -m 0755 -d ${D}${sysconfdir}/default/
echo 'OPENROUTE_API_KEY:${OPENROUTE_API_KEY}' >> ${D}${sysconfdir}/default/openroutekey
}
install -m 0755 -d ${D}${sysconfdir}/default/
echo 'OPENROUTE_API_KEY:${OPENROUTE_API_KEY}' >> ${D}${sysconfdir}/default/openroutekey
}
-ALTERNATIVE_LINK_NAME[flutter-cluster-dashboard.yaml] = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml"
+ALTERNATIVE_LINK_NAME[flutter-cluster-dashboard.yaml] = "${sysconfdir}/xdg/AGL/${BPN}.yaml"
FILES:${PN} += "${datadir} ${systemd_user_unitdir} ${sysconfdir}/default/"
FILES:${PN} += "${datadir} ${systemd_user_unitdir} ${sysconfdir}/default/"
+RDEPENDS:${PN} += "flutter-auto agl-flutter-env"
PACKAGE_BEFORE_PN += "${PN}-conf ${PN}-conf-demo"
PACKAGE_BEFORE_PN += "${PN}-conf ${PN}-conf-demo"
-FILES:${PN}-conf += "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default"
+FILES:${PN}-conf += "${sysconfdir}/xdg/AGL/${BPN}.yaml.default"
RDEPENDS:${PN}-conf = "${PN}"
RDEPENDS:${PN}-conf = "${PN}"
-RPROVIDES:${PN}-conf = "flutter-cluster-dashboard.yaml"
+RPROVIDES:${PN}-conf = "${BPN}.yaml"
RCONFLICTS:${PN}-conf = "${PN}-conf-demo"
RCONFLICTS:${PN}-conf = "${PN}-conf-demo"
-ALTERNATIVE:${PN}-conf = "flutter-cluster-dashboard.yaml"
-ALTERNATIVE_TARGET_${PN}-conf = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.default"
+ALTERNATIVE:${PN}-conf = "${BPN}.yaml"
+ALTERNATIVE_TARGET_${PN}-conf = "${sysconfdir}/xdg/AGL/${BPN}.yaml.default"
-FILES:${PN}-conf-demo += "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo"
+FILES:${PN}-conf-demo += "${sysconfdir}/xdg/AGL/${BPN}.yaml.demo"
RDEPENDS:${PN}-conf-demo = "${PN}"
RDEPENDS:${PN}-conf-demo = "${PN}"
-RPROVIDES:${PN}-conf-demo = "flutter-cluster-dashboard.yaml"
+RPROVIDES:${PN}-conf-demo = "${BPN}.yaml"
RCONFLICTS:${PN}-conf-demo = "${PN}-conf"
RCONFLICTS:${PN}-conf-demo = "${PN}-conf"
-ALTERNATIVE:${PN}-conf-demo = "flutter-cluster-dashboard.yaml"
-ALTERNATIVE_TARGET_${PN}-conf-demo = "${sysconfdir}/xdg/AGL/flutter-cluster-dashboard.yaml.demo"
+ALTERNATIVE:${PN}-conf-demo = "${BPN}.yaml"
+ALTERNATIVE_TARGET_${PN}-conf-demo = "${sysconfdir}/xdg/AGL/${BPN}.yaml.demo"
{
"view" : [ {
"window_type" : "BG",
{
"view" : [ {
"window_type" : "BG",
- "bundle_path" : "/usr/share/flutter/flutter_homescreen/3.3.7/release",
"width" : 1920,
"height": 1080,
"fullscreen": true
"width" : 1920,
"height": 1080,
"fullscreen": true
After=agl-compositor.service
[Service]
After=agl-compositor.service
[Service]
-ExecStart=/usr/bin/flutter-auto --j=/usr/share/flutter/flutter-homescreen.json --xdg-shell-app-id=homescreen
+EnvironmentFile=/etc/default/flutter
+EnvironmentFile=-/etc/default/flutter-homescreen
+ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/flutter_homescreen/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --j=/usr/share/flutter/flutter-homescreen.json --xdg-shell-app-id=homescreen
Restart=on-failure
[Install]
Restart=on-failure
[Install]
-APP_CONFIG = "flutter-homescreen.json"
+APP_CONFIG = "${BPN}.json"
- install -D -m 0644 ${WORKDIR}/flutter-homescreen.service ${D}${systemd_user_unitdir}/flutter-homescreen.service
+ install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_user_unitdir}/${BPN}.service
install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
- ln -s ../flutter-homescreen.service ${D}${systemd_user_unitdir}/agl-session.target.wants/flutter-homescreen.service
+ ln -s ../${BPN}.service ${D}${systemd_user_unitdir}/agl-session.target.wants/${BPN}.service
- install -D -m 0644 ${WORKDIR}/${APP_CONFIG} ${D}${datadir}/flutter/flutter-homescreen.json
+ install -D -m 0644 ${WORKDIR}/${APP_CONFIG} ${D}${datadir}/flutter/${BPN}.json
install -d ${D}${sysconfdir}/xdg/AGL
install -m 0644 ${WORKDIR}/homescreen_config.yaml ${D}${sysconfdir}/xdg/AGL/
}
FILES:${PN} += "${datadir} ${systemd_user_unitdir} ${sysconfdir}/xdg/AGL"
install -d ${D}${sysconfdir}/xdg/AGL
install -m 0644 ${WORKDIR}/homescreen_config.yaml ${D}${sysconfdir}/xdg/AGL/
}
FILES:${PN} += "${datadir} ${systemd_user_unitdir} ${sysconfdir}/xdg/AGL"
+RDEPENDS:${PN} += "flutter-auto agl-flutter-env"