meta-agl-flutter: add agl-flutter-env 82/28982/1
authorScott Murray <scott.murray@konsulko.com>
Fri, 2 Jun 2023 14:48:45 +0000 (10:48 -0400)
committerScott Murray <scott.murray@konsulko.com>
Fri, 2 Jun 2023 14:51:46 +0000 (10:51 -0400)
Add agl-flutter-env recipe that installs a /etc/default/flutter
environment file that can be sourced to get the default Flutter
version and runtime type.  The variable AGL_FLUTTER_DEFAULT_RUNTIME
can be overridden at build time to switch the default runtime from
release to something else.

Bug-AGL: SPEC-4819

Change-Id: I33ef50c932116aecddb746007722ce8163079389
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
meta-agl-flutter/recipes-config/agl-flutter-env/agl-flutter-env_1.0.bb [new file with mode: 0644]

diff --git a/meta-agl-flutter/recipes-config/agl-flutter-env/agl-flutter-env_1.0.bb b/meta-agl-flutter/recipes-config/agl-flutter-env/agl-flutter-env_1.0.bb
new file mode 100644 (file)
index 0000000..aaff166
--- /dev/null
@@ -0,0 +1,15 @@
+SUMMARY = "AGL Flutter environment file"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit allarch
+
+AGL_FLUTTER_DEFAULT_RUNTIME ?= "release"
+
+do_compile[noexec] = "1"
+
+do_install() {
+    install -d ${D}${sysconfdir}/default
+    echo "FLUTTER_VERSION=${FLUTTER_SDK_TAG}" > ${D}${sysconfdir}/default/flutter
+    echo "FLUTTER_RUNTIME=${AGL_FLUTTER_DEFAULT_RUNTIME}" >> ${D}${sysconfdir}/default/flutter
+}