meta-agl-flutter: update for meta-agl-core changes 98/28998/2
authorScott Murray <scott.murray@konsulko.com>
Tue, 6 Jun 2023 21:06:54 +0000 (17:06 -0400)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Mon, 12 Jun 2023 11:10:26 +0000 (11:10 +0000)
Changes:
- Pull in image .bb files instead of .inc files.
- Use agl-image-compositor as the base image for agl-image-flutter.
  instead of the appending done to agl-image-weston and its
  packagegroup previously.
- Rework flutter-gallery systemd unit to work again, and update our
  bbappend to install it as disabled as an option for starting up
  flutter-gallery in agl-image-flutter.  It seems useful to keep it
  present to serve as an example of starting Flutter apps via
  systemd and using the agl-flutter-env package.
- Some minor documentation updates in README.md.
- Replace some :append usage with += to avoid creating problems
  for downstream users.

Bug-AGL: SPEC-4813

Change-Id: I8a61d6365ce69ac50b88abc7bc451486b3e1b339
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
meta-agl-flutter/README.md
meta-agl-flutter/recipes-graphics/flutter-apps/flutter-gallery/flutter-gallery.service
meta-agl-flutter/recipes-graphics/flutter-apps/flutter-gallery_aglflutter.inc
meta-agl-flutter/recipes-platform/images/agl-image-flutter.bb
meta-agl-flutter/recipes-platform/images/agl-image-flutter.inc [deleted file]
meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bbappend [deleted file]
meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston_aglflutter.inc [deleted file]

index 84bbf26..ba017d1 100644 (file)
@@ -1,14 +1,14 @@
 # meta-agl-flutter
 
-## Steps to build `agl-demo-platform` image
+## Steps to build `agl-ivi-demo-platform-flutter` image
 
 ```
     export AGL_TOP=$HOME/workspace_agl
     mkdir -p $AGL_TOP && cd $AGL_TOP
     repo init -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo -b master
     repo sync -j $(nproc)
-    source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo agl-flutter
-    bitbake agl-demo-platform
+    source meta-agl/scripts/aglsetup.sh -m qemux86-64 agl-demo
+    bitbake agl-ivi-demo-platform-flutter
 ```
 
 This builds AGL demo image that includes Flutter runtime={debug,profile,release}.
@@ -57,9 +57,7 @@ Additional documentation available [here](https://github.com/meta-flutter/meta-f
 
 ## Startup Service
 
-If you include `flutter-gallery-init` it will install a systemd user service, which starts the Flutter Gallery on boot.  This is not included in the minimal images.
-
-At runtime you can edit `/usr/share/flutter/default.json` to point to any Flutter bundle.
+This layer includes an example systemd user service for the Flutter Gallery application which is disabled by default.  It can be used to start the application in the minimal image by doing 'systemctl start flutter-gallery'.
 
 
 ## `/usr/share/flutter/default.json`
index 3d4ecbf..80e31dd 100644 (file)
@@ -3,8 +3,11 @@ Requires=agl-compositor.service
 After=agl-compositor.service
 
 [Service]
-ExecStart=/usr/bin/flutter-auto --j=/usr/share/flutter/default.json --b=/usr/share/flutter/gallery --f
-Restart=on-failure
+User=agl-driver
+EnvironmentFile=/etc/default/flutter
+EnvironmentFile=-/etc/default/flutter-gallery
+Environment=XDG_RUNTIME_DIR=/run/user/1001/
+ExecStart=/usr/bin/flutter-auto --b=/usr/share/flutter/gallery/${FLUTTER_VERSION}/${FLUTTER_RUNTIME} --f --window-type=BG
 
 [Install]
-WantedBy=agl-session.target
+WantedBy=graphical.target
index c618a2f..61bcaa0 100644 (file)
@@ -1,28 +1,18 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/flutter-gallery:"
 
-SRC_URI += " \
-    file://flutter-gallery.service \
-"
+SRC_URI += "file://flutter-gallery.service"
 
-# To avoid conflicts with the systemd template scheme added via bbappend in
-# meta-agl-demo, package the standalone systemd unit separately.  This is not
-# needed when meta-agl-flutter is used without meta-agl-demo, but that is not
-# going to be the default usecase for most users, so this still allows them to
-# build working agl-image-flutter images in the same build tree.
-#
-# This can be dropped if/when flutter-gallery is no longer packaged as a demo
-# in meta-agl-demo.
-
-#SYSTEMD_SERVICE:${PN}-init = "flutter-gallery.service"
+inherit systemd
 
 do_install:append() {
-    install -D -m 0644 ${WORKDIR}/flutter-gallery.service ${D}${systemd_user_unitdir}/flutter-gallery.service
-    install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
-    ln -s ../flutter-gallery.service ${D}${systemd_user_unitdir}/agl-session.target.wants/flutter-gallery.service
+    install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
 }
 
-PACKAGE_BEFORE_PN += "${PN}-init"
+#FILES:${PN} += "${systemd_system_unitdir}"
 
-FILES:${PN}-init = "${systemd_user_unitdir}"
+RDEPENDS:${PN} += "agl-flutter-env"
 
-RDEPENDS:${PN}-init = "${PN}"
\ No newline at end of file
+SYSTEMD_SERVICE:${PN} = "flutter-gallery.service"
+# Explicitly disable auto-start to avoid interferring with Toyota workspace
+# tooling usecase.
+SYSTEMD_AUTO_ENABLE:${PN} = "disable"
index 37b0f4e..8263c0a 100644 (file)
@@ -1,10 +1,11 @@
-SUMMARY = "Baseline Flutter Image for Development"
+require recipes-platform/images/agl-image-compositor.bb
 
+SUMMARY = "Baseline Flutter Image for Development"
 LICENSE = "MIT"
 
-require agl-image-flutter.inc
+CLANGSDK = "1"
 
-IMAGE_INSTALL:append = "\
+IMAGE_INSTALL += "\
     weston-ini-conf-landscape \
     \
     flutter-auto-with-logging \
@@ -17,6 +18,6 @@ IMAGE_INSTALL:append = "\
     \
     "
 
-IMAGE_FEATURES:append = "\
+IMAGE_FEATURES += "\
     ssh-server-openssh \
     "
diff --git a/meta-agl-flutter/recipes-platform/images/agl-image-flutter.inc b/meta-agl-flutter/recipes-platform/images/agl-image-flutter.inc
deleted file mode 100644 (file)
index defa5d2..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-require recipes-platform/images/agl-image-weston.inc
-
-IMAGE_INSTALL:append = "\
-    agl-compositor \
-    agl-compositor-init \
-    packagegroup-agl-profile-graphical \
-    "
-
-CLANGSDK = "1"
diff --git a/meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bbappend b/meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston.bbappend
deleted file mode 100644 (file)
index cd32272..0000000
+++ /dev/null
@@ -1 +0,0 @@
-require ${@bb.utils.contains('AGL_FEATURES', 'agl-flutter', 'packagegroup-agl-graphical-weston_aglflutter.inc', '', d)}
diff --git a/meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston_aglflutter.inc b/meta-agl-flutter/recipes-platform/packagegroups/packagegroup-agl-graphical-weston_aglflutter.inc
deleted file mode 100644 (file)
index 2b91c17..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-RDEPENDS:${PN}:remove = "weston-init"
-
-RDEPENDS:${PN} += " \
-                  agl-compositor-init \
-                  "