summaryrefslogtreecommitdiffstats
path: root/meta-agl-flutter/recipes-graphics
diff options
context:
space:
mode:
authorJoel Winarske <joel.winarske@gmail.com>2023-05-31 18:35:35 -0700
committerScott Murray <scott.murray@konsulko.com>2023-06-01 18:59:41 -0400
commit882eeb6a44b443ef13a4b3111330cd0b603d3f1b (patch)
tree0be68e27cf36bef0707767350123ef8520719ba8 /meta-agl-flutter/recipes-graphics
parent95e1b466426763d761b171677c86b36f925c9d88 (diff)
Flutter bbclass refactor
-remove use of bbclass runtime modes -use external automation-workspace repo Scott Murray: - update flutter-auto agl-shell platform channel plugin patch with reworked version from Marius Vlad. Bug-AGL: SPEC-4819 Change-Id: I7510f916ab70d8bab78fdb9ab235092f84c3713a Signed-off-by: Joel Winarske <joel.winarske@gmail.com> Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'meta-agl-flutter/recipes-graphics')
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/files/0001-clang-toolchain.patch44
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/files/0002-x64-sysroot-assert.patch25
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/files/0003-remove-x11-dependency.patch29
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/files/0004-prevent-redefinition-of-glib_autoptr_clear_AtkObject.patch36
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_%.bbappend1
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_aglflutter.inc11
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_%.bbappend1
-rw-r--r--meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_aglflutter.inc (renamed from meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_git.bbappend)0
-rw-r--r--meta-agl-flutter/recipes-graphics/toyota/files/0001-Add-optional-agl_shell-plugin.patch111
9 files changed, 206 insertions, 52 deletions
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/files/0001-clang-toolchain.patch b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0001-clang-toolchain.patch
new file mode 100644
index 00000000..8553a3a5
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0001-clang-toolchain.patch
@@ -0,0 +1,44 @@
+From 2ee90379fbfa4bda0274f691c2c832621c2333df Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarske@linux.com>
+Date: Fri, 19 Feb 2021 22:15:24 +0000
+Subject: [PATCH 1/2] clang toolchain
+
+---
+ build/toolchain/custom/BUILD.gn | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn
+index 65b1623..8b3f6f8 100644
+--- a/build/toolchain/custom/BUILD.gn
++++ b/build/toolchain/custom/BUILD.gn
+@@ -12,11 +12,11 @@ toolchain("custom") {
+ # these values in our scope.
+ cc = "${toolchain_bin}/clang"
+ cxx = "${toolchain_bin}/clang++"
+- ar = "${toolchain_bin}/${custom_target_triple}-ar"
++ ar = "${toolchain_bin}/llvm-ar"
+ ld = "${toolchain_bin}/clang++"
+- readelf = "${toolchain_bin}/${custom_target_triple}-readelf"
+- nm = "${toolchain_bin}/${custom_target_triple}-nm"
+- strip = "${toolchain_bin}/${custom_target_triple}-strip"
++ readelf = "${toolchain_bin}/llvm-readelf"
++ nm = "${toolchain_bin}/llvm-nm"
++ strip = "${toolchain_bin}/llvm-strip"
+
+ target_triple_flags = "--target=${custom_target_triple}"
+ sysroot_flags = "--sysroot ${custom_sysroot}"
+@@ -84,10 +84,9 @@ toolchain("custom") {
+ link_command = "$ld $target_triple_flags $sysroot_flags -shared {{ldflags}} -o $unstripped_sofile $custom_lib_flags -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile"
+ toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f posix $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname"
+ replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi"
+- strip_command = "$strip -o $sofile $unstripped_sofile"
+
+ command =
+- "$link_command && $toc_command && $replace_command && $strip_command"
++ "$link_command && $toc_command && $replace_command"
+ rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}"
+
+ description = "SOLINK $sofile"
+--
+2.29.2
+
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/files/0002-x64-sysroot-assert.patch b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0002-x64-sysroot-assert.patch
new file mode 100644
index 00000000..6265b2f3
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0002-x64-sysroot-assert.patch
@@ -0,0 +1,25 @@
+From 528c1f2f05a5eae710905547140f4a4f465d7d88 Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarske@linux.com>
+Date: Fri, 19 Feb 2021 22:16:00 +0000
+Subject: [PATCH 2/2] x64 sysroot assert
+
+---
+ build/config/sysroot.gni | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
+index 12187df..2eb385c 100644
+--- a/build/config/sysroot.gni
++++ b/build/config/sysroot.gni
+@@ -14,7 +14,7 @@ declare_args() {
+
+ # Whether to use the default sysroot when building for Linux, if an explicit
+ # sysroot isn't set.
+- use_default_linux_sysroot = true
++ use_default_linux_sysroot = false
+
+ # The absolute path to the Xcode toolchain. This is used to look for headers
+ # that usually ship with the toolchain like c++/v1.
+--
+2.29.2
+
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/files/0003-remove-x11-dependency.patch b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0003-remove-x11-dependency.patch
new file mode 100644
index 00000000..f6ede795
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0003-remove-x11-dependency.patch
@@ -0,0 +1,29 @@
+
+From dbe21e0e1ceb41da5a99f97937f2f6dd03f7e2e4 Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarske@gmail.com>
+Date: Sun, 29 May 2022 09:38:46 -0700
+Subject: [PATCH] Remove x11 dependency
+
+Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
+---
+ flutter/shell/platform/linux/config/BUILD.gn | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/flutter/shell/platform/linux/config/BUILD.gn b/flutter/shell/platform/linux/config/BUILD.gn
+index da0ac056bc..70c7a0ea16 100644
+--- a/flutter/shell/platform/linux/config/BUILD.gn
++++ b/flutter/shell/platform/linux/config/BUILD.gn
+@@ -5,10 +5,6 @@
+ import("//build/config/linux/pkg_config.gni")
+ import("//flutter/shell/platform/glfw/config.gni")
+
+-pkg_config("x11") {
+- packages = [ "x11" ]
+-}
+-
+ pkg_config("gtk") {
+ packages = [ "gtk+-3.0" ]
+ }
+--
+2.34.3
+
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/files/0004-prevent-redefinition-of-glib_autoptr_clear_AtkObject.patch b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0004-prevent-redefinition-of-glib_autoptr_clear_AtkObject.patch
new file mode 100644
index 00000000..2e1dcbdf
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/files/0004-prevent-redefinition-of-glib_autoptr_clear_AtkObject.patch
@@ -0,0 +1,36 @@
+From 1a4f274b071a1486204470392d2427069533f8ca Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarske@gmail.com>
+Date: Thu, 8 Sep 2022 16:15:06 -0700
+Subject: [PATCH] prevent redefinition of glib_autoptr_clear_AtkObject
+
+Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
+---
+ flutter/shell/platform/linux/fl_accessible_node.h | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/flutter/shell/platform/linux/fl_accessible_node.h b/flutter/shell/platform/linux/fl_accessible_node.h
+index ff38ad49c6..190cb982a1 100644
+--- a/flutter/shell/platform/linux/fl_accessible_node.h
++++ b/flutter/shell/platform/linux/fl_accessible_node.h
+@@ -5,17 +5,14 @@
+ #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_ACCESSIBLE_NODE_H_
+ #define FLUTTER_SHELL_PLATFORM_LINUX_FL_ACCESSIBLE_NODE_H_
+
+-#include <gtk/gtk.h>
++#include <gio/gio.h>
++#include <atk/atk.h>
+
+ #include "flutter/shell/platform/embedder/embedder.h"
+ #include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
+
+ G_BEGIN_DECLS
+
+-// ATK doesn't have the g_autoptr macros, so add them manually.
+-// https://gitlab.gnome.org/GNOME/atk/-/issues/10
+-G_DEFINE_AUTOPTR_CLEANUP_FUNC(AtkObject, g_object_unref)
+-
+ #define FL_TYPE_ACCESSIBLE_NODE fl_accessible_node_get_type()
+ G_DECLARE_DERIVABLE_TYPE(FlAccessibleNode,
+ fl_accessible_node,
+--
+2.34.3
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_%.bbappend b/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_%.bbappend
new file mode 100644
index 00000000..56660ab6
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-flutter', 'flutter-engine_aglflutter.inc', '', d)}
diff --git a/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_aglflutter.inc b/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_aglflutter.inc
new file mode 100644
index 00000000..3c66fb2e
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-engine/flutter-engine_aglflutter.inc
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+#
+# Patch set for 3.3.7 Engine
+#
+FLUTTER_ENGINE_PATCHES = "\
+ file://0001-clang-toolchain.patch \
+ file://0002-x64-sysroot-assert.patch \
+ file://0003-remove-x11-dependency.patch \
+ file://0004-prevent-redefinition-of-glib_autoptr_clear_AtkObject.patch \
+ "
diff --git a/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_%.bbappend b/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_%.bbappend
new file mode 100644
index 00000000..f983e7e9
--- /dev/null
+++ b/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_%.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-flutter', 'flutter-sdk_aglflutter.inc', '', d)}
diff --git a/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_git.bbappend b/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_aglflutter.inc
index ce3574d7..ce3574d7 100644
--- a/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_git.bbappend
+++ b/meta-agl-flutter/recipes-graphics/flutter-sdk/flutter-sdk_aglflutter.inc
diff --git a/meta-agl-flutter/recipes-graphics/toyota/files/0001-Add-optional-agl_shell-plugin.patch b/meta-agl-flutter/recipes-graphics/toyota/files/0001-Add-optional-agl_shell-plugin.patch
index b5ab653e..79fac9e3 100644
--- a/meta-agl-flutter/recipes-graphics/toyota/files/0001-Add-optional-agl_shell-plugin.patch
+++ b/meta-agl-flutter/recipes-graphics/toyota/files/0001-Add-optional-agl_shell-plugin.patch
@@ -1,6 +1,6 @@
-From 278945f12726692bc8b148ea1a59697a1c01405a Mon Sep 17 00:00:00 2001
+From 164756be1d20b555f43e2eb3160da3efa7d38865 Mon Sep 17 00:00:00 2001
From: Scott Murray <scott.murray@konsulko.com>
-Date: Mon, 14 Nov 2022 17:58:12 -0500
+Date: Thu, 1 Jun 2023 14:34:03 -0400
Subject: [PATCH] Add optional agl_shell plugin
Add an optional agl_shell static plugin to expose the activate_app
@@ -10,7 +10,10 @@ application to activate other application surfaces to switch between
multiple applications as is needed for the AGL demo.
Upstream-Status: Pending
+
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+[Updated to work with upstream OSS 0223 release]
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
---
cmake/plugins.cmake | 5 ++
shell/engine.cc | 6 ++
@@ -18,21 +21,21 @@ Signed-off-by: Scott Murray <scott.murray@konsulko.com>
shell/platform_channel.cc | 6 ++
shell/static_plugins/agl_shell/agl_shell.cc | 77 +++++++++++++++++++++
shell/static_plugins/agl_shell/agl_shell.h | 31 +++++++++
- shell/wayland/display.cc | 8 +++
- shell/wayland/display.h | 3 +
+ shell/wayland/display.cc | 7 ++
+ shell/wayland/display.h | 8 +++
shell/wayland/window.h | 2 +
- 9 files changed, 148 insertions(+)
+ 9 files changed, 152 insertions(+)
create mode 100644 shell/static_plugins/agl_shell/agl_shell.cc
create mode 100644 shell/static_plugins/agl_shell/agl_shell.h
diff --git a/cmake/plugins.cmake b/cmake/plugins.cmake
-index 6bdc75b..a599f95 100644
+index b720dca..20a55d7 100644
--- a/cmake/plugins.cmake
+++ b/cmake/plugins.cmake
-@@ -101,4 +101,9 @@ if (BUILD_PLUGIN_SECURE_STORAGE)
- pkg_check_modules(PLUGIN_SECURE_STORAGE REQUIRED libsecret-1)
+@@ -123,4 +123,9 @@ if (BUILD_PLUGIN_SECURE_STORAGE)
endif ()
+
+option(BUILD_PLUGIN_AGL_SHELL "Includes AGL Shell Wayland Protocol Plugin" OFF)
+if (BUILD_PLUGIN_AGL_SHELL)
+ ENABLE_PLUGIN(agl_shell)
@@ -40,12 +43,12 @@ index 6bdc75b..a599f95 100644
+
message(STATUS "Plugin Config .......... ${PLUGINS}")
diff --git a/shell/engine.cc b/shell/engine.cc
-index ad0c83c..9ce346d 100644
+index d20b6ba..a0e38e9 100644
--- a/shell/engine.cc
+++ b/shell/engine.cc
-@@ -595,3 +595,9 @@ MAYBE_UNUSED TextInput* Engine::GetTextInput() const {
+@@ -614,3 +614,9 @@ MAYBE_UNUSED TextInput* Engine::GetTextInput() const {
+ return m_key_event;
}
-
#endif
+
+#if ENABLE_PLUGIN_AGL_SHELL
@@ -54,10 +57,10 @@ index ad0c83c..9ce346d 100644
+}
+#endif
diff --git a/shell/engine.h b/shell/engine.h
-index 501ba4b..4193e7e 100644
+index 94808dc..3a06f51 100644
--- a/shell/engine.h
+++ b/shell/engine.h
-@@ -50,6 +50,12 @@ class TextInput;
+@@ -60,6 +60,12 @@ class KeyEvent;
#endif
@@ -69,23 +72,23 @@ index 501ba4b..4193e7e 100644
+
class Engine {
public:
- Engine(FlutterView* view,
-@@ -146,6 +152,10 @@ class Engine {
-
+ /**
+@@ -445,6 +451,10 @@ class Engine {
+ MAYBE_UNUSED NODISCARD KeyEvent* GetKeyEvent() const;
#endif
+#if ENABLE_PLUGIN_AGL_SHELL
+ std::shared_ptr<Display> GetDisplay() const;
+#endif
+
- Backend* GetBackend() {
- return m_backend;
- }
+ /**
+ * @brief Get backend of view
+ * @return Backend*
diff --git a/shell/platform_channel.cc b/shell/platform_channel.cc
-index 10f4715..2c7ab8c 100644
+index b72156a..81d7cb5 100644
--- a/shell/platform_channel.cc
+++ b/shell/platform_channel.cc
-@@ -53,6 +53,9 @@
+@@ -62,6 +62,9 @@
#ifdef ENABLE_PLUGIN_SECURE_STORAGE
#include "static_plugins/secure_storage/secure_storage.h"
#endif
@@ -95,7 +98,7 @@ index 10f4715..2c7ab8c 100644
PlatformChannel* PlatformChannel::singleton = nullptr;
-@@ -101,4 +104,7 @@ PlatformChannel::PlatformChannel() {
+@@ -122,4 +125,7 @@ PlatformChannel::PlatformChannel() {
RegisterCallback(SecureStorage::kChannelName,
&SecureStorage::OnPlatformMessage);
#endif
@@ -105,7 +108,7 @@ index 10f4715..2c7ab8c 100644
}
diff --git a/shell/static_plugins/agl_shell/agl_shell.cc b/shell/static_plugins/agl_shell/agl_shell.cc
new file mode 100644
-index 0000000..81627b6
+index 0000000..e6160a5
--- /dev/null
+++ b/shell/static_plugins/agl_shell/agl_shell.cc
@@ -0,0 +1,77 @@
@@ -135,7 +138,7 @@ index 0000000..81627b6
+#include <iostream>
+
+void AglShell::OnPlatformMessage(const FlutterPlatformMessage* message,
-+ void* userdata) {
++ void* userdata) {
+ std::unique_ptr<std::vector<uint8_t>> result;
+ auto engine = reinterpret_cast<Engine*>(userdata);
+ auto& codec = flutter::StandardMethodCodec::GetInstance();
@@ -182,13 +185,13 @@ index 0000000..81627b6
+ result = codec.EncodeErrorEnvelope("unhandled_method", "Unhandled Method");
+ }
+
-+ done:
++done:
+ engine->SendPlatformMessageResponse(message->response_handle, result->data(),
+ result->size());
+}
diff --git a/shell/static_plugins/agl_shell/agl_shell.h b/shell/static_plugins/agl_shell/agl_shell.h
new file mode 100644
-index 0000000..747eb36
+index 0000000..698e44c
--- /dev/null
+++ b/shell/static_plugins/agl_shell/agl_shell.h
@@ -0,0 +1,31 @@
@@ -211,7 +214,7 @@ index 0000000..747eb36
+
+#pragma once
+
-+#include <flutter_embedder.h>
++#include <shell/platform/embedder/embedder.h>
+
+class AglShell {
+ public:
@@ -224,51 +227,55 @@ index 0000000..747eb36
+ static constexpr char kMethodActivateApp[] = "activate_app";
+};
diff --git a/shell/wayland/display.cc b/shell/wayland/display.cc
-index 5d78471..48262c3 100644
+index 9351fb9..583d8ba 100644
--- a/shell/wayland/display.cc
+++ b/shell/wayland/display.cc
-@@ -697,6 +697,14 @@ void Display::AglShellDoPanel(struct wl_surface* surface,
+@@ -845,6 +845,13 @@ void Display::AglShellDoReady() const {
}
}
-+void Display::AglShellDoActivate(const std::string& app_id,
-+ size_t index) {
-+ if (m_agl_shell) {
-+ agl_shell_activate_app(m_agl_shell, app_id.c_str(),
++void Display::AglShellDoActivate(const std::string& app_id, size_t index) {
++ if (m_agl.shell) {
++ agl_shell_activate_app(m_agl.shell, app_id.c_str(),
+ m_all_outputs[index]->output);
+ }
+}
+
- void Display::AglShellDoReady() {
- if (m_agl_shell) {
- agl_shell_ready(m_agl_shell);
+ void Display::SetEngine(wl_surface* surface, Engine* engine) {
+ m_active_engine = engine;
+ m_active_surface = surface;
diff --git a/shell/wayland/display.h b/shell/wayland/display.h
-index bf05b27..c628c8c 100644
+index daeefea..3efdc9c 100644
--- a/shell/wayland/display.h
+++ b/shell/wayland/display.h
-@@ -82,6 +82,9 @@ class Display {
- enum agl_shell_edge mode,
- size_t index);
+@@ -150,6 +150,14 @@ class Display {
+ */
+ void AglShellDoReady() const;
-+ void AglShellDoActivate(const std::string& app_id,
-+ size_t index);
++ /**
++ * @brief AglShellDoActivate:
++ * @return void
++ * @relation
++ * wayland, agl-shell
++ */
++ void AglShellDoActivate(const std::string& app_id, size_t index);
+
- void AglShellDoReady();
-
- void SetEngine(wl_surface* surface, Engine* engine);
+ /**
+ * @brief Set Engine
+ * @param[in] surface Image
diff --git a/shell/wayland/window.h b/shell/wayland/window.h
-index 4b5c726..b4d0be3 100644
+index c0f2abc..da9cf45 100644
--- a/shell/wayland/window.h
+++ b/shell/wayland/window.h
-@@ -81,6 +81,8 @@ class WaylandWindow {
- uint32_t m_fps_counter;
- static window_type get_window_type(const std::string& type);
+@@ -127,6 +127,8 @@ class WaylandWindow {
+ return std::pair<int32_t, int32_t>{m_geometry.width, m_geometry.height};
+ }
+ std::shared_ptr<Display> GetDisplay() { return m_display; }
+
private:
- struct shm_buffer {
- struct wl_buffer* buffer;
+ size_t m_index;
+ std::shared_ptr<Display> m_display;
--
-2.38.1
+2.40.1