* [Buildroot] [PATCH v4] package/python-httplib2: add host variant
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/depot-tools: new package Adam Duskett
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
This is needed for the host-depot-tools package.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
package/python-httplib2/python-httplib2.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/python-httplib2/python-httplib2.mk b/package/python-httplib2/python-httplib2.mk
index 1093ecab39..2f4eb98356 100644
--- a/package/python-httplib2/python-httplib2.mk
+++ b/package/python-httplib2/python-httplib2.mk
@@ -14,3 +14,4 @@ PYTHON_HTTPLIB2_CPE_ID_VENDOR = httplib2_project
PYTHON_HTTPLIB2_CPE_ID_PRODUCT = httplib2
$(eval $(python-package))
+$(eval $(host-python-package))
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] package/depot-tools: new package
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/python-httplib2: add host variant Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-sdk-bin: " Adam Duskett
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
Chromium and Chromium OS use a package of scripts called
depot_tools to manage checkouts and code reviews. This package
also includes the gclient utility.
gclient is a Python script to manage a workspace of modular dependencies that
are each checked out independently from different subversion or git
repositories. Features include:
- Dependencies can be specified on a per-OS basis.
- Dependencies can be specified relative to their parent dependency.
- Variables can be used to abstract concepts.
- Hooks can be specified to be run after a checkout.
- .gclient and DEPS are Python scripts. You can hack in easily or add
additional configuration data.
.gclient file: It's the primary file. It is, in fact, a Python script. It
specifies the following variables:
- solutions: an array of dictionaries specifying the projects that will be
fetched.
- hooks: additional hooks to be run when this meta checkout is synced.
- target_os: an optional array of (target) operating systems to fetch
OS-specific dependencies for.
- cache_dir: Primarily for bots, multiple working sets use a single git
cache.
gclient is necessary for checking out the flutter-engine source code, as the
release tarballs provided on the flutter-engine github are in no state to
compile. Google expects the use of gclient to download a source directory
structure suitable to build the Flutter engine.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
V2 -> V3:
- Re-added Config.in.host. It needs to select host-python3, host-python3-six,
and host-python3-ssl
V1 -> V2:
- Remove Config.in.host
- Remove DEPOT_TOOLS_GCLIENT helper wrapper as it is unused.
DEVELOPERS | 3 +++
package/Config.in.host | 1 +
package/depot-tools/Config.in.host | 10 ++++++++++
package/depot-tools/depot-tools.hash | 3 +++
package/depot-tools/depot-tools.mk | 25 +++++++++++++++++++++++++
5 files changed, 42 insertions(+)
create mode 100644 package/depot-tools/Config.in.host
create mode 100644 package/depot-tools/depot-tools.hash
create mode 100644 package/depot-tools/depot-tools.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 69ab723c0c..fde00567fd 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -26,6 +26,9 @@
# infrastructure, and will be CC'ed on all patches that add or
# modify packages that use this infrastructure.
+N: Adam Duskett <adam.duskett@amarulasolutions.com>
+F: package/depot-tools/
+
N: Adam Duskett <aduskett@gmail.com>
F: package/firewalld/
diff --git a/package/Config.in.host b/package/Config.in.host
index 22e0dc64d4..377dbed7d3 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -19,6 +19,7 @@ menu "Host utilities"
source "package/cryptsetup/Config.in.host"
source "package/dbus-python/Config.in.host"
source "package/delve/Config.in.host"
+ source "package/depot-tools/Config.in.host"
source "package/dfu-util/Config.in.host"
source "package/dos2unix/Config.in.host"
source "package/dosfstools/Config.in.host"
diff --git a/package/depot-tools/Config.in.host b/package/depot-tools/Config.in.host
new file mode 100644
index 0000000000..935331dedb
--- /dev/null
+++ b/package/depot-tools/Config.in.host
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_DEPOT_TOOLS
+ bool "host depot-tools"
+ select BR2_PACKAGE_HOST_PYTHON3
+ select BR2_PACKAGE_HOST_PYTHON3_SSL
+ select BR2_PACKAGE_HOST_PYTHON_SIX
+ help
+ Chromium and Chromium OS use a package of scripts called
+ depot_tools to manage checkouts and code reviews.
+
+ https://www.chromium.org/developers/how-tos/install-depot-tools/
diff --git a/package/depot-tools/depot-tools.hash b/package/depot-tools/depot-tools.hash
new file mode 100644
index 0000000000..2109096901
--- /dev/null
+++ b/package/depot-tools/depot-tools.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 8e0bccdd6b1231f58d5453dc14a5e1d195295ac8d466dec34961e951e946b50b depot-tools-4e87f5bfe244e903f712408ea68dc3c3a6fe2d00-br1.tar.gz
+sha256 984523ee987f4e8b72d61df37d8f1189a7077cd4b77e41a397e35593b297a29d LICENSE
diff --git a/package/depot-tools/depot-tools.mk b/package/depot-tools/depot-tools.mk
new file mode 100644
index 0000000000..e3b840f29a
--- /dev/null
+++ b/package/depot-tools/depot-tools.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# depot-tools
+#
+################################################################################
+
+DEPOT_TOOLS_VERSION = 4e87f5bfe244e903f712408ea68dc3c3a6fe2d00
+DEPOT_TOOLS_SITE = https://chromium.googlesource.com/chromium/tools/depot_tools
+DEPOT_TOOLS_SITE_METHOD = git
+DEPOT_TOOLS_LICENSE = BSD-3-Clause
+DEPOT_TOOLS_LICENSE_FILES = LICENSE
+DEPOT_TOOLS_CPE_ID_VENDOR = google
+
+HOST_DEPOT_TOOLS_DEPENDENCIES = \
+ host-python3 \
+ host-python-httplib2 \
+ host-python-pyparsing \
+ host-python-six
+
+define HOST_DEPOT_TOOLS_INSTALL_CMDS
+ mkdir -p $(HOST_DIR)/share/depot_tools
+ cp -dprf $(@D)/* $(HOST_DIR)/share/depot_tools/
+endef
+
+$(eval $(host-generic-package))
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] package/flutter-sdk-bin: new package
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/python-httplib2: add host variant Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/depot-tools: new package Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-engine: " Adam Duskett
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
flutter-sdk-bin is a collection of host tools and plugins used to compile
flutter applications.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
DEVELOPERS | 1 +
package/flutter-sdk-bin/flutter-sdk-bin.hash | 3 +
package/flutter-sdk-bin/flutter-sdk-bin.mk | 87 ++++++++++++++++++++
3 files changed, 91 insertions(+)
create mode 100644 package/flutter-sdk-bin/flutter-sdk-bin.hash
create mode 100644 package/flutter-sdk-bin/flutter-sdk-bin.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index fde00567fd..25eb374fae 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -28,6 +28,7 @@
N: Adam Duskett <adam.duskett@amarulasolutions.com>
F: package/depot-tools/
+F: package/flutter-sdk-bin/
N: Adam Duskett <aduskett@gmail.com>
F: package/firewalld/
diff --git a/package/flutter-sdk-bin/flutter-sdk-bin.hash b/package/flutter-sdk-bin/flutter-sdk-bin.hash
new file mode 100644
index 0000000000..13e588cd83
--- /dev/null
+++ b/package/flutter-sdk-bin/flutter-sdk-bin.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 7048e51a89c99a5b6cac6d8ae416121264effa76da34dba5c0e7cf85519c8e98 flutter_linux_3.10.6-stable.tar.xz
+sha256 a598db94b6290ffbe10b5ecf911057b6a943351c727fdda9e5f2891d68700a20 LICENSE
diff --git a/package/flutter-sdk-bin/flutter-sdk-bin.mk b/package/flutter-sdk-bin/flutter-sdk-bin.mk
new file mode 100644
index 0000000000..87dd035faf
--- /dev/null
+++ b/package/flutter-sdk-bin/flutter-sdk-bin.mk
@@ -0,0 +1,87 @@
+################################################################################
+#
+# host-flutter-sdk-bin
+#
+################################################################################
+
+FLUTTER_SDK_BIN_VERSION = 3.10.6
+FLUTTER_SDK_BIN_SITE = https://storage.googleapis.com/flutter_infra_release/releases/stable/linux
+FLUTTER_SDK_BIN_SOURCE = flutter_linux_$(FLUTTER_SDK_BIN_VERSION)-stable.tar.xz
+FLUTTER_SDK_BIN_LICENSE = BSD-3-Clause
+FLUTTER_SDK_BIN_LICENSE_FILES = LICENSE
+
+HOST_FLUTTER_SDK_BIN_SDK = $(HOST_DIR)/share/flutter/sdk
+HOST_FLUTTER_SDK_BIN_SDK_ENGINE = $(HOST_FLUTTER_SDK_BIN_SDK)/bin/cache/artifacts/engine
+HOST_FLUTTER_SDK_BIN_DART_SDK = $(HOST_FLUTTER_SDK_BIN_SDK)/bin/cache/dart-sdk
+
+HOST_FLUTTER_SDK_BIN_ENV = \
+ PATH=$(BR_PATH):$(HOST_FLUTTER_SDK_BIN_SDK):$(HOST_FLUTTER_SDK_BIN_SDK)/bin \
+ PUB_CACHE=$(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
+
+# The following config options must be ran one at a time.
+define HOST_FLUTTER_SDK_BIN_CONFIGURE_CMDS
+ cd $(@D) && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config --clear-features && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config --enable-linux-desktop && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config --enable-custom-devices && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config --no-analytics && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/dart --disable-analytics
+endef
+
+# Remove the cache, as we will run precache after setting up flutter and dart
+# with the new config options.
+define HOST_FLUTTER_SDK_BIN_BUILD_CMDS
+ mkdir -p $(HOST_FLUTTER_SDK_BIN_SDK)
+ rm -rf $(HOST_FLUTTER_SDK_BIN_SDK)/.pub-cache
+ rm -rf $(@D)/bin/cache
+ cd $(@D) && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter precache && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(@D)/bin/flutter config && \
+ rm -rf $(@D)/bin/cache/pkg/sky_engine
+ rm -rf $(@D)/bin/cache/artifacts/*
+endef
+
+define HOST_FLUTTER_SDK_BIN_INSTALL_CMDS
+ mkdir -p $(HOST_FLUTTER_SDK_BIN_SDK)
+ cp -rT $(@D)/. $(HOST_FLUTTER_SDK_BIN_SDK)/
+endef
+
+ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
+HOST_FLUTTER_SDK_BIN_SDK_ROOT = \
+ $(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/common/flutter_patched_sdk
+HOST_FLUTTER_SDK_BIN_SDK_PRODUCT = false
+else
+HOST_FLUTTER_SDK_BIN_SDK_ROOT = \
+ $(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/common/flutter_patched_sdk_product
+HOST_FLUTTER_SDK_BIN_SDK_PRODUCT = true
+endif
+
+# The Order matters.Taken from:
+# https://github.com/meta-flutter/meta-flutter/blob/kirkstone/classes/flutter-app.inc
+HOST_FLUTTER_SDK_BIN_DART_ARGS = \
+ --verbose \
+ --disable-analytics \
+ --disable-dart-dev $(HOST_FLUTTER_SDK_BIN_SDK_ENGINE)/linux-x64/frontend_server.dart.snapshot \
+ --sdk-root $(HOST_FLUTTER_SDK_BIN_SDK_ROOT) \
+ --target=flutter \
+ --no-print-incremental-dependencies \
+ -Ddart.vm.profile=false \
+ -Ddart.vm.product=$(HOST_FLUTTER_SDK_BIN_SDK_PRODUCT) \
+ --aot \
+ --tfa \
+ --packages .dart_tool/package_config.json \
+ --output-dill .dart_tool/flutter_build/*/app.dill \
+ --depfile .dart_tool/flutter_build/*/kernel_snapshot.d
+
+# Helper wrapper to run flutter when building flutter applications.
+HOST_FLUTTER_SDK_BIN_FLUTTER = \
+ $(HOST_FLUTTER_SDK_BIN_ENV) \
+ $(HOST_FLUTTER_SDK_BIN_SDK)/bin/flutter
+
+# Helper wrapper to run dart when building flutter applications.
+HOST_FLUTTER_SDK_BIN_DART_BIN = \
+ $(HOST_FLUTTER_SDK_BIN_ENV) \
+ $(HOST_FLUTTER_SDK_BIN_DART_SDK)/bin/dart \
+ $(HOST_FLUTTER_SDK_BIN_DART_ARGS)
+
+$(eval $(host-generic-package))
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] package/flutter-engine: new package
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
` (2 preceding siblings ...)
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-sdk-bin: " Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-pi: " Adam Duskett
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
There are many issues with this package:
- The release tarballs from https://github.com/flutter/engine are in no state
to compile. They are only for the use of gclient to download a source
directory structure suitable to build the Flutter engine! If you download,
extract and attempt to run `./tools/gn --no-goma --no-prebuilt-dart-sdk`, you
receive the error message:
`No such file or directory: 'flutter/flutter/third_party/gn/gn.'
But wait! Wasn't the gn binary just called? No, that's a wrapper in the
Flutter source tree that formats arguments to call the real gn binary.
The real gn is not provided in the tarball but is downloaded via gclient
(among many other supporting repositories.)
Even worse, the flutter buildsystem depends on the .git dirs being present.
(https://github.com/meta-flutter/meta-flutter/issues/271) This dependency
means it is not possible to create a reproducible tarball from the downloaded
sources, which is why there is no .hash file provided.
I have asked the flutter project to release full tarballs suitable for
compiling here: https://github.com/flutter/flutter/issues/130734
- Flutter engine includes a patched copy of clang that must be used to compile.
Using a Buildroot-build clang results in linking warning and errors.
As such, we depend on LLVM_ARCH_SUPPORTS but use the included clang for
building. On the plus side, this saves time having to compile clang.
Tested with:
- Debian 11 and 12
- Ubuntu 18.04, 20.04, and 22.04
- Fedora 38
- Per package directory enabled and disabled
- x86_64, arm64
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
Changes v3 -> v4:
- Add $(HOST_DIR)/usr/share/depot_tools/ when calling ninja. There are some
tools that require depot_tools during the compile process.
Changes v2 -> v3:
- Remove host-flutter-sdk-bin as a dependency.
- Reorder FLUTTER_ENGINE_TARGET_ARCH and FLUTTER_ENGINE_TARGET_TRIPPLE to be
alphabetical
- FLUTTER_ENGINE_INSTALL_SDK -> FLUTTER_ENGINE_INSTALL_GEN_SNAPSHOT and
only install the gen_snapshot tool.
Changes v1 -> v2:
- Clean up .mk header
- Set proper FLUTTER_ENGINE_TARGET_TRIPPLE strings and add a comment as to
where the names came from.
- Change --tarball to --tarball-dl-path for clarity
- Remove uneeded :$(HOST_DIR)/share/depot_tools when calling ninja.
- Install the flutter-engine-sdk tools to the host directory. These tools are
used to turn a flutter application into a useable .so file.
- Install icudtl.dat to both the staging directory and the target. Used by
flutter-pi when running an application.
- Swap from using mk_tar_gz to calling tar -C directly. For unknown reasons,
calling mk_tar_gz breaks the gen_snapshot tool in half. Even though no
warnings or errors are reported when compiling, calling gen_snapshot from
a tarball created iwwth mk_tar_gz results in the cryptic error:
"Can't load kernel binary: Invalid SDK hash." However, using the exact same
utility from a tarball created with tar -C works properly. No, I do not know
what voodoo magic is happening, please don't ask. :)
- Add a check for TARBALL_DL_PATH in gen-tarball. [Yann]
Changes rfc v2 -> v1:
- DEVELOPERS file format cleanup [Thomas]
- Add upstream issue for 0004-pkg-config.py-do-not-prepend-sysroot-path.patch
(https://github.com/flutter/flutter/issues/132152) [Thomas]
- Changed BR2_PACKAGE_LLVM_ARCH_SUPPORTS to BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
[Thomas]
- Fixed alphabetic ordering of selects in Config.in [Thomas]
- Removed BR2_PACKAGE_FLUTTER_ENGINE_ARTIFACTS option from Config.in. That
option builds binaries used for compiling on the device, which Buildroot
doesn't need nor want.
- Added BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS to the
"flutter-engine needs an OpenGL backend" line. [Thomas]
- Added --no-stripped unconditionally [Thomas]
- Removed check for mesa3d, as libgl and libgles take care of that. [Thomas]
- Moved libflutter_linux_gtk.so into the ifeq ($(BR2_PACKAGE_LIBGTK3),y)
conditional check, which removes the need to check if the
FLUTTER_ENGINE_INSTALL_FILES exist in the INSTALL_STAGING and
INSTALL_TARGET commands. [Thomas]
- Install .so files from the so.unstripped/ directory. [Thomas]
- Remove the check in gen-tarball that checks if the tarball already exists.
Always re-create the tarball when running the gen-tarball script. [Thomas]
Changes rfc v1 -> rfc v2:
- Use the flutter-engine provided clang.
- Remove 0003-disable-undefined-version.patch
- Add 0003-fix-toolchain-paths.patch
- Fix signed-off-by lines in the patches [Yann]
- Remove "Runtime mode" option in favor of checking BR2_ENABLE_RUNTIME_DEBUG [Yann]
- Use positive logic in flutter-engine.mk [Yann]
- Add comments when --disable-${option} doesn't exist. [Yann]
- Remove unecessary subshells in flutter-engine.mk [Yann]
- Rename flutter-engine/gclient to flutter-engine/dot-gclient [Yann]
- Create flutter-engine/gen-tarball to generate the flutter-engine tarball. [Yann]
- Remove finding and copying crtbeginS.o crtendS.o libgcc.a as it's
unecessary when using the flutter-engine provided clang.
- FLUTTER_ENGINE_INSTALL_STAGING_FILES -> FLUTTER_ENGINE_INSTALL_FILES [Yann]
- Reword comments at the top of flutter-engine.mk for clarity.
DEVELOPERS | 1 +
package/Config.in | 1 +
.../0001-disable-pre-canned-sysroot.patch | 32 +++
.../0002-remove-explicit-x11-dependency.patch | 33 +++
.../0003-fix-toolchain-paths.patch | 40 +++
...onfig.py-do-not-prepend-sysroot-path.patch | 37 +++
package/flutter-engine/Config.in | 56 +++++
package/flutter-engine/dot-gclient | 16 ++
package/flutter-engine/flutter-engine.mk | 237 ++++++++++++++++++
package/flutter-engine/gen-tarball | 111 ++++++++
10 files changed, 564 insertions(+)
create mode 100644 package/flutter-engine/0001-disable-pre-canned-sysroot.patch
create mode 100644 package/flutter-engine/0002-remove-explicit-x11-dependency.patch
create mode 100644 package/flutter-engine/0003-fix-toolchain-paths.patch
create mode 100644 package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch
create mode 100644 package/flutter-engine/Config.in
create mode 100644 package/flutter-engine/dot-gclient
create mode 100644 package/flutter-engine/flutter-engine.mk
create mode 100755 package/flutter-engine/gen-tarball
diff --git a/DEVELOPERS b/DEVELOPERS
index 25eb374fae..3b3b0be145 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -28,6 +28,7 @@
N: Adam Duskett <adam.duskett@amarulasolutions.com>
F: package/depot-tools/
+F: package/flutter-engine/
F: package/flutter-sdk-bin/
N: Adam Duskett <aduskett@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index 15b1866630..6f385ff697 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1580,6 +1580,7 @@ menu "Graphics"
source "package/exempi/Config.in"
source "package/exiv2/Config.in"
source "package/fltk/Config.in"
+ source "package/flutter-engine/Config.in"
source "package/fontconfig/Config.in"
source "package/freetype/Config.in"
source "package/gd/Config.in"
diff --git a/package/flutter-engine/0001-disable-pre-canned-sysroot.patch b/package/flutter-engine/0001-disable-pre-canned-sysroot.patch
new file mode 100644
index 0000000000..953705e33b
--- /dev/null
+++ b/package/flutter-engine/0001-disable-pre-canned-sysroot.patch
@@ -0,0 +1,32 @@
+From 49a14e693124dc34f2cccbfb755d01a1198aa6bf Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarsk@gmail.com>
+Date: Wed, 19 Jul 2023 15:24:22 -0700
+Subject: [PATCH] disable pre-canned sysroot
+
+Override should be enabled if a custom sysroot using --target-sysroot is
+specified. If --target-sysroot is not set, then it should default to the
+pre-canned sysroot.
+
+Upstream: https://github.com/flutter/flutter/issues/123073
+Signed-off-by: Joel Winarske <joel.winarsk@gmail.com>
+Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
+---
+ 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 7987e519d..1de694263 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
+ }
+
+ if (current_toolchain == default_toolchain && target_sysroot != "") {
+--
+2.41.0
+
diff --git a/package/flutter-engine/0002-remove-explicit-x11-dependency.patch b/package/flutter-engine/0002-remove-explicit-x11-dependency.patch
new file mode 100644
index 0000000000..23d7ec9b06
--- /dev/null
+++ b/package/flutter-engine/0002-remove-explicit-x11-dependency.patch
@@ -0,0 +1,33 @@
+From b1a5db9318ca33a03f2700758d5debad907d21b6 Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarsk@gmail.com>
+Date: Wed, 19 Jul 2023 15:26:40 -0700
+Subject: [PATCH] remove explicit x11 dependency
+
+This is superfluous and may conflict with the actual rendering system used in
+gtk3 (e.g. wayland.)
+
+Upstream: https://github.com/flutter/flutter/issues/123073
+Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
+Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.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 da0ac056b..70c7a0ea1 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.41.0
+
diff --git a/package/flutter-engine/0003-fix-toolchain-paths.patch b/package/flutter-engine/0003-fix-toolchain-paths.patch
new file mode 100644
index 0000000000..ba5d5f8023
--- /dev/null
+++ b/package/flutter-engine/0003-fix-toolchain-paths.patch
@@ -0,0 +1,40 @@
+From ca175ef5bf7f96db57fb5aa562602dc424fab81c Mon Sep 17 00:00:00 2001
+From: Joel Winarske <joel.winarsk@gmail.com>
+Date: Sun, 5 Mar 2023 10:43:02 -0800
+Subject: [PATCH] fix toolchain paths
+
+Flutter includes a copy of clang which is required to build. However, by
+default, build/toolchain/custom/BUILD.gn attempts to use several gcc utilities
+such as ar, readelf, nm, and strip. Change these to the proper llvm provided
+utility.
+
+Upstream: https://github.com/flutter/flutter/issues/123073
+
+Signed-off-by: Joel Winarske <joel.winarsk@gmail.com>
+Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
+---
+ build/toolchain/custom/BUILD.gn | 4 +++++------
+ 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}"
+--
+2.39.2
diff --git a/package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch b/package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch
new file mode 100644
index 0000000000..a31be7d77f
--- /dev/null
+++ b/package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch
@@ -0,0 +1,37 @@
+From 51e8fed854fd9d373bb9b20d7ed8e7cf6ef12312 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <adam.duskett@amarulasolutions.com>
+Date: Wed, 19 Jul 2023 11:48:59 -0700
+Subject: [PATCH] pkg-config.py: do not prepend sysroot path
+
+Buildroot uses the standard PKG_CONFIG_SYSROOT_DIR variable, so what the
+pkg-config.py script is doing doesn't make sense. There is no need to prepend
+the sysroot, and flutter should let pkg-config use the PKG_CONFIG_SYSROOT_DIR
+variable.
+
+Without this patch, the pkg-config.py script double prepends the sysroot path.
+IE: output/host/.../sysroot/output/host/.../sysroot
+
+Upstream: https://github.com/flutter/flutter/issues/132152
+Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
+---
+ build/config/linux/pkg-config.py | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py
+index b4a6aff17..44ffdcaea 100644
+--- a/build/config/linux/pkg-config.py
++++ b/build/config/linux/pkg-config.py
+@@ -207,9 +207,7 @@ def main():
+ all_flags = flag_string.strip().split(' ')
+
+
+- sysroot = options.sysroot
+- if not sysroot:
+- sysroot = ''
++ sysroot = ''
+
+ includes = []
+ cflags = []
+--
+2.41.0
+
diff --git a/package/flutter-engine/Config.in b/package/flutter-engine/Config.in
new file mode 100644
index 0000000000..aad0fc6108
--- /dev/null
+++ b/package/flutter-engine/Config.in
@@ -0,0 +1,56 @@
+# Flutter includes a vender copy of clang which is mandatory to use for
+# compiling. These are the supported architectures.
+config BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
+ bool
+ default y if BR2_aarch64
+ default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
+ default y if BR2_i386
+ default y if BR2_x86_64
+
+config BR2_PACKAGE_FLUTTER_ENGINE
+ bool "flutter-engine"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
+ depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # pthreads
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
+ depends on !BR2_STATIC_LIBS
+ depends on BR2_USE_WCHAR # std::wstring
+ depends on BR2_HOST_GCC_AT_LEAST_5
+ depends on BR2_PACKAGE_HAS_LIBGL || BR2_PACKAGE_HAS_LIBGLES
+ select BR2_PACKAGE_FREETYPE
+ select BR2_PACKAGE_HOST_DEPOT_TOOLS
+ select BR2_PACKAGE_ZLIB
+ help
+ Flutter is Google's SDK for crafting beautiful, fast user
+ experience for mobile, web, and desktop from a single
+ codebase. Flutter works with existing code, is used by
+ developers and organizations around the world, and is
+ free and open source.
+
+ The Flutter Engine is a portable runtime for hosting
+ Flutter applications. It implements Flutter's core
+ libraries, including animation and graphics, file and
+ network I/O, accessibility support, plugin architecture,
+ and a Dart runtime and compile toolchain. Most developers
+ will interact with Flutter via the Flutter Framework,
+ which provides a modern, reactive framework, and a rich
+ set of platform, layout and foundation widgets.
+
+ https://github.com/flutter/engine
+
+comment "flutter-engine needs an OpenGL or OpenGLES backend"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
+ depends on !BR2_PACKAGE_HAS_LIBGL && !BR2_PACKAGE_HAS_LIBGLES
+
+comment "flutter-engine needs a glibc toolchain w/ wchar, C++, gcc >= 5, dynamic library, host gcc >= 5, NPTL"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_TOOLCHAIN_HAS_THREADS_NPTL \
+ || !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_5 \
+ || BR2_STATIC_LIBS || !BR2_USE_WCHAR \
+ || !BR2_HOST_GCC_AT_LEAST_5
+
+comment "flutter-engine needs a toolchain not affected by GCC bug 64735"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
+ depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
diff --git a/package/flutter-engine/dot-gclient b/package/flutter-engine/dot-gclient
new file mode 100644
index 0000000000..168e9a368d
--- /dev/null
+++ b/package/flutter-engine/dot-gclient
@@ -0,0 +1,16 @@
+# This file is taken from the output of meta-flutter/lib/gn.py
+
+solutions = [{
+ "managed": False,
+ "name": "src/flutter",
+ "url": "https://github.com/flutter/engine.git@!FLUTTER_VERSION!",
+ "custom_vars": {
+ "download_android_deps": False,
+ "download_windows_deps": False,
+ "download_linux_deps": False
+ },
+ "custom_deps": {
+ "src/third_party/dart/third_party/pkg/tools":
+ "https://dart.googlesource.com/tools.git@unified_analytics-v1.1.0"
+ }
+}]
diff --git a/package/flutter-engine/flutter-engine.mk b/package/flutter-engine/flutter-engine.mk
new file mode 100644
index 0000000000..2a26da8e4f
--- /dev/null
+++ b/package/flutter-engine/flutter-engine.mk
@@ -0,0 +1,237 @@
+################################################################################
+#
+# flutter-engine
+#
+################################################################################
+
+# Flutter-engine has a release on the GitHub page. However, that release is
+# only for Google. Its intended purpose is for the gclient tool provided by
+# Google in their depot-tools package. To use the source code, we must use
+# gclient to download the flutter-engine source code along with several other
+# projects. Unfortunately, the Buildroot download system does not have the
+# capability of using gclient, and considering this package is the only
+# package that uses gclient, we side-step the entire download process and
+# perform the following steps if a tarball does not exist already:
+#
+# - Copy the pre-made gclient config file to a temporary scratch directory.
+# - Run gclient sync to generate a source directory with the proper
+# flutter-engine source code in the correct places.
+# - Create a source tarball.
+# - Copy the source tarball to the $(FLUTTER_ENGINE_DL_DIR) directory.
+#
+# There is no hash provided, as the gn binary (used for configuration) relies
+# on the .git directories. As such, a reproducible tarball is not possible.
+FLUTTER_ENGINE_VERSION = 3.10.6
+
+# There is nothing for Buildroot to download. This is handled by gclient.
+FLUTTER_ENGINE_SITE =
+FLUTTER_ENGINE_SOURCE =
+FLUTTER_ENGINE_LICENSE = BSD-3-Clause
+FLUTTER_ENGINE_LICENSE_FILES = LICENSE
+FLUTTER_ENGINE_TARBALL_PATH = $(FLUTTER_ENGINE_DL_DIR)/flutter-$(FLUTTER_ENGINE_VERSION).tar.gz
+FLUTTER_ENGINE_INSTALL_STAGING = YES
+FLUTTER_ENGINE_DOWNLOAD_DEPENDENCIES = host-depot-tools
+FLUTTER_ENGINE_DEPENDENCIES = \
+ host-ninja \
+ host-pkgconf \
+ freetype \
+ zlib
+
+# Dispatch all architectures of flutter
+# FLUTTER_ENGINE_TARGET_TRIPPLE must match the directory name found in
+# buildtools/linux-x64/clang/lib/clang/*/lib
+ifeq ($(BR2_aarch64),y)
+FLUTTER_ENGINE_TARGET_ARCH = arm64
+FLUTTER_ENGINE_TARGET_TRIPPLE = aarch64-unknown-linux-gnu
+else ifeq ($(BR2_arm)$(BR2_armeb),y)
+FLUTTER_ENGINE_TARGET_ARCH = arm
+FLUTTER_ENGINE_TARGET_TRIPPLE = armv7-unknown-linux-gnueabihf
+else ifeq ($(BR2_i386),y)
+FLUTTER_ENGINE_TARGET_ARCH = x86
+FLUTTER_ENGINE_TARGET_TRIPPLE = i386-unknown-linux-gnu
+else ifeq ($(BR2_x86_64),y)
+FLUTTER_ENGINE_TARGET_ARCH = x64
+FLUTTER_ENGINE_TARGET_TRIPPLE = x86_64-unknown-linux-gnu
+endif
+
+ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
+FLUTTER_ENGINE_RUNTIME_MODE=debug
+else
+FLUTTER_ENGINE_RUNTIME_MODE=release
+endif
+
+FLUTTER_ENGINE_BUILD_DIR = \
+ $(@D)/out/linux_$(FLUTTER_ENGINE_RUNTIME_MODE)_$(FLUTTER_ENGINE_TARGET_ARCH)
+
+FLUTTER_ENGINE_INSTALL_FILES = libflutter_engine.so
+
+# Flutter engine includes a bundled patched clang that must be used for
+# compiling or else there are linking errors.
+FLUTTER_ENGINE_CLANG_PATH = $(@D)/buildtools/linux-x64/clang
+
+FLUTTER_ENGINE_CONF_OPTS = \
+ --clang \
+ --embedder-for-target \
+ --linux-cpu $(FLUTTER_ENGINE_TARGET_ARCH) \
+ --no-build-embedder-examples \
+ --no-clang-static-analyzer \
+ --no-enable-unittests \
+ --no-goma \
+ --no-prebuilt-dart-sdk \
+ --no-stripped \
+ --runtime-mode $(FLUTTER_ENGINE_RUNTIME_MODE) \
+ --target-os linux \
+ --target-sysroot $(STAGING_DIR) \
+ --target-toolchain $(FLUTTER_ENGINE_CLANG_PATH) \
+ --target-triple $(FLUTTER_ENGINE_TARGET_TRIPPLE)
+
+ifeq ($(BR2_arm)$(BR2_armeb),y)
+FLUTTER_ENGINE_CONF_OPTS += \
+ --arm-float-abi $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
+endif
+
+# We must specify a full path to ccache and a full path to the flutter-engine
+# provided clang in order to use ccache, or else flutter-engine will error out
+# attempting to find ccache in the target-toolchain provided path.
+ifeq ($(BR2_CCACHE),y)
+define FLUTTER_ENGINE_COMPILER_PATH_FIXUP
+ $(SED) "s%cc =.*%cc = \"$(HOST_DIR)/bin/ccache $(FLUTTER_ENGINE_CLANG_PATH)/bin/clang\""%g \
+ $(@D)/build/toolchain/custom/BUILD.gn
+
+ $(SED) "s%cxx =.*%cxx = \"$(HOST_DIR)/bin/ccache $(FLUTTER_ENGINE_CLANG_PATH)/bin/clang++\""%g \
+ $(@D)/build/toolchain/custom/BUILD.gn
+endef
+FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_COMPILER_PATH_FIXUP
+endif
+
+ifeq ($(BR2_ENABLE_LTO),y)
+FLUTTER_ENGINE_CONF_OPTS += --lto
+else
+FLUTTER_ENGINE_CONF_OPTS += --no-lto
+endif
+
+ifeq ($(BR2_OPTIMIZE_0),y)
+FLUTTER_ENGINE_CONF_OPTS += --unoptimized
+endif
+
+# There is no --disable-fontconfig option.
+ifeq ($(BR2_PACKAGE_FONTCONFIG),y)
+FLUTTER_ENGINE_DEPENDENCIES += fontconfig
+FLUTTER_ENGINE_CONF_OPTS += --enable-fontconfig
+endif
+
+ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
+FLUTTER_ENGINE_DEPENDENCIES += libgl
+endif
+
+ifeq ($(BR2_PACKAGE_HAS_LIBGLES),y)
+FLUTTER_ENGINE_DEPENDENCIES += libgles
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGLFW),y)
+FLUTTER_ENGINE_DEPENDENCIES += libglfw
+FLUTTER_ENGINE_CONF_OPTS += --build-glfw-shell
+else
+FLUTTER_ENGINE_CONF_OPTS += --no-build-glfw-shell
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGTK3),y)
+FLUTTER_ENGINE_DEPENDENCIES += libgtk3
+FLUTTER_ENGINE_INSTALL_FILES += libflutter_linux_gtk.so
+else
+FLUTTER_ENGINE_CONF_OPTS += --disable-desktop-embeddings
+endif
+
+# There is no --disable-vulkan option
+ifeq ($(BR2_PACKAGE_MESA3D_VULKAN_DRIVER),y)
+FLUTTER_ENGINE_CONF_OPTS += --enable-vulkan
+endif
+
+ifeq ($(BR2_PACKAGE_XORG7)$(BR2_PACKAGE_LIBXCB),yy)
+FLUTTER_ENGINE_DEPENDENCIES += libxcb
+else
+define FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP
+ $(SED) "s%vulkan_use_x11.*%vulkan_use_x11 = false%g" -i \
+ $(@D)/build_overrides/vulkan_headers.gni
+endef
+FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP
+endif
+
+ifeq ($(BR2_PACKAGE_WAYLAND),y)
+FLUTTER_ENGINE_DEPENDENCIES += wayland
+else
+define FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP
+ $(SED) "s%vulkan_use_wayland.*%vulkan_use_wayland = false%g" \
+ $(@D)/build_overrides/vulkan_headers.gni
+endef
+FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP
+endif
+
+# Generate a tarball if one does not already exist.
+define FLUTTER_ENGINE_GENERATE_TARBALL
+ PATH=$(BR_PATH):$(HOST_DIR)/share/depot_tools \
+ PYTHONPATH=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR) \
+ $(FLUTTER_ENGINE_PKGDIR)/gen-tarball \
+ --dot-gclient $(FLUTTER_ENGINE_PKGDIR)/dot-gclient \
+ --jobs $(PARALLEL_JOBS) \
+ --scratch-dir $(@D)/dl-tmp \
+ --tarball-dl-path $(FLUTTER_ENGINE_TARBALL_PATH) \
+ --version $(FLUTTER_ENGINE_VERSION)
+endef
+FLUTTER_ENGINE_POST_DOWNLOAD_HOOKS += FLUTTER_ENGINE_GENERATE_TARBALL
+
+define FLUTTER_ENGINE_EXTRACT_CMDS
+ gzip -d -c $(FLUTTER_ENGINE_TARBALL_PATH) | tar --strip-components 1 -C $(@D) -xf -
+endef
+
+define FLUTTER_ENGINE_CONFIGURE_CMDS
+ cd $(@D) && \
+ rm -rf $(FLUTTER_ENGINE_BUILD_DIR) && \
+ PATH=$(BR_PATH):$(HOST_DIR)/share/depot_tools \
+ ./flutter/tools/gn \
+ $(FLUTTER_ENGINE_CONF_OPTS)
+endef
+
+define FLUTTER_ENGINE_BUILD_CMDS
+ cd $(@D) && \
+ PATH=$(BR_PATH):$(HOST_DIR)/usr/share/depot_tools/ \
+ $(HOST_DIR)/bin/ninja \
+ -j $(PARALLEL_JOBS) \
+ -C $(FLUTTER_ENGINE_BUILD_DIR)
+endef
+
+# Flutter-engine builds several host applications use for flutter development.
+# One of those applications is gen_snapshot, which turns applications into
+# usable .so files for the target architecture. Compiling a host version of
+# flutter-engine would result in binaries producing host-architecture
+# flutter applications .so files. As such, copy gen_snapshot to the host
+# directory here and name it flutter_gen_snapshot for clarity.
+FLUTTER_ENGINE_GEN_SNAPSHOT = $(HOST_DIR)/bin/flutter_gen_snapshot
+define FLUTTER_ENGINE_INSTALL_GEN_SNAPSHOT
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/clang_x64/gen_snapshot \
+ $(HOST_DIR)/bin/flutter_gen_snapshot
+endef
+FLUTTER_ENGINE_POST_INSTALL_STAGING_HOOKS += FLUTTER_ENGINE_INSTALL_GEN_SNAPSHOT
+
+define FLUTTER_ENGINE_INSTALL_STAGING_CMDS
+ $(foreach i,$(FLUTTER_ENGINE_INSTALL_FILES),
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/so.unstripped/$(i) \
+ $(STAGING_DIR)/usr/lib/$(i); \
+ )
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/flutter_embedder.h \
+ $(STAGING_DIR)/usr/include/flutter_embedder.h
+
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/icudtl.dat \
+ $(STAGING_DIR)/usr/share/flutter/$(FLUTTER_ENGINE_VERSION)/$(FLUTTER_ENGINE_RUNTIME_MODE)/data/icudtl.dat
+endef
+
+define FLUTTER_ENGINE_INSTALL_TARGET_CMDS
+ $(foreach i,$(FLUTTER_ENGINE_INSTALL_FILES),
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/so.unstripped/$(i) \
+ $(TARGET_DIR)/usr/lib/$(i); \
+ )
+ $(INSTALL) -D -m 0755 $(FLUTTER_ENGINE_BUILD_DIR)/icudtl.dat \
+ $(TARGET_DIR)/usr/share/flutter/$(FLUTTER_ENGINE_VERSION)/$(FLUTTER_ENGINE_RUNTIME_MODE)/data/icudtl.dat
+endef
+
+$(eval $(generic-package))
diff --git a/package/flutter-engine/gen-tarball b/package/flutter-engine/gen-tarball
new file mode 100755
index 0000000000..e040beac75
--- /dev/null
+++ b/package/flutter-engine/gen-tarball
@@ -0,0 +1,111 @@
+#!/usr/bin/env bash
+# Call gclient and generate a flutter-engine source tarball if one does not
+# already exist.
+set -eu
+
+DL_DIR=
+DOT_GCLIENT=
+JOBS=
+SCRATCH_DIR=
+TARBALL_DL_PATH=
+VERSION=
+TARBALL_NAME=
+
+# Print status messages in the same style Buildroot prints.
+message() {
+ term_bold="$(tput smso 2>/dev/null)"
+ term_reset="$(tput rmso 2>/dev/null)"
+ echo "${term_bold}>>> flutter-engine ${VERSION} ${1}${term_reset}"
+}
+
+parse_opts() {
+ local o O opts
+
+ o='d:j:s:t:v:'
+ O='dot-gclient:,jobs:,scratch-dir:,tarball-dl-path:,version:'
+ opts="$(getopt -o "${o}" -l "${O}" -- "${@}")"
+ eval set -- "${opts}"
+
+ while [ ${#} -gt 0 ]; do
+ case "${1}" in
+ (-d|--dot-gclient)
+ DOT_GCLIENT="${2}"
+ shift 2
+ ;;
+ (-j|--jobs)
+ JOBS="${2}"
+ shift 2
+ ;;
+ (-s|--scratch-dir)
+ SCRATCH_DIR="${2}"
+ shift 2
+ ;;
+ (-t|--tarball-dl-path)
+ DL_DIR=$(dirname "${2}")
+ TARBALL_DL_PATH="${2}"
+ shift 2
+ ;;
+ (-v|--version)
+ VERSION="${2}"
+ TARBALL_NAME=flutter-"${VERSION}".tar.gz
+ shift 2
+ ;;
+ (--)
+ shift
+ break
+ ;;
+ esac
+ done
+}
+
+copy_dot_gclient() {
+ rm -rf "${SCRATCH_DIR}"
+ mkdir -p "${SCRATCH_DIR}"
+ install -D -m 0755 "${DOT_GCLIENT}" "${SCRATCH_DIR}"/.gclient
+ sed "s%!FLUTTER_VERSION!%${VERSION}%g" -i "${SCRATCH_DIR}"/.gclient
+ cd "${SCRATCH_DIR}"
+}
+
+run_gclient() {
+ local gclient="${HOST_DIR}"/share/depot_tools/gclient.py
+ if [[ ! -e "${gclient}" ]]; then
+ message "${gclient} does not exist. Is host-depot-tools built and installed?"
+ exit 1
+ fi
+ message "Downloading"
+ "${gclient}" \
+ sync \
+ --delete_unversioned_trees \
+ --no-history \
+ --reset \
+ --shallow \
+ -j"${JOBS}"
+}
+
+gen_tarball() {
+ message "Generating tarball"
+ mkdir -p "${DL_DIR}"
+ # We would use the mk_tar_gz helper method from the support/download/helpers
+ # script here. However, due to unknown reasons other than what I can
+ # articulate as "Google," this is not possible. Even though creating a
+ # tarball using the mk_tar_gz command results in a tarball that extracts and
+ # builds flutter-engine without warnings or errors, the gen_snapshot host
+ # utility, which turns dart applications into usable .so files for the
+ # flutter engine, results in the error:
+ # "Can't load kernel binary: Invalid SDK hash." As we are not interested in
+ # creating a reproducible tarball, we need to use tar -C instead.
+ tar -C "${SCRATCH_DIR}"/src -czf "${TARBALL_NAME}" .
+ mv "${TARBALL_NAME}" "${TARBALL_DL_PATH}"
+ rm -rf "${SCRATCH_DIR}"
+}
+
+main() {
+ parse_opts "${@}"
+ if [[ ! -e "${TARBALL_DL_PATH}" ]]; then
+ copy_dot_gclient
+ run_gclient
+ gen_tarball
+ fi
+}
+
+main "${@}"
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] package/flutter-pi: new package
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
` (3 preceding siblings ...)
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-engine: " Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-gallery: " Adam Duskett
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
flutter-pi is one of many flutter-embedders. However, flutter-pi is unique
because it doesn't require X or Wayland to run. So long as there is support for
KMS and DRI flutter-pi should run on any platform that flutter-engine supports.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
v2 -> v3:
- Add -DFILESYSTEM_LAYOUT=meta-flutter to conf_opts. This is used to check
where the icudtl.dat file is located. Without this change, flutter apps
fail to start.
DEVELOPERS | 1 +
package/Config.in | 1 +
package/flutter-pi/Config.in | 41 +++++++++++++++++++++++
package/flutter-pi/flutter-pi.hash | 3 ++
package/flutter-pi/flutter-pi.mk | 53 ++++++++++++++++++++++++++++++
5 files changed, 99 insertions(+)
create mode 100644 package/flutter-pi/Config.in
create mode 100644 package/flutter-pi/flutter-pi.hash
create mode 100644 package/flutter-pi/flutter-pi.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 3b3b0be145..5292315bcb 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -29,6 +29,7 @@
N: Adam Duskett <adam.duskett@amarulasolutions.com>
F: package/depot-tools/
F: package/flutter-engine/
+F: package/flutter-pi/
F: package/flutter-sdk-bin/
N: Adam Duskett <aduskett@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index 6f385ff697..bf29825752 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -343,6 +343,7 @@ comment "Graphic libraries"
source "package/fbset/Config.in"
source "package/fbterm/Config.in"
source "package/fbv/Config.in"
+ source "package/flutter-pi/Config.in"
source "package/freerdp/Config.in"
source "package/graphicsmagick/Config.in"
source "package/imagemagick/Config.in"
diff --git a/package/flutter-pi/Config.in b/package/flutter-pi/Config.in
new file mode 100644
index 0000000000..e816af46c3
--- /dev/null
+++ b/package/flutter-pi/Config.in
@@ -0,0 +1,41 @@
+config BR2_PACKAGE_FLUTTER_PI
+ bool "flutter-pi"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE
+ depends on BR2_PACKAGE_SYSTEMD # Event loop and dbus support
+ select BR2_PACKAGE_LIBINPUT
+ select BR2_PACKAGE_LIBXKBCOMMON
+ help
+ A light-weight Flutter Engine Embedder. Flutter-pi also
+ runs without X11, so you don't need to boot into a
+ Desktop & have X11 or Wayland load up; just boot into the
+ command-line.
+
+ Although flutter-pi is only tested on a Rasberry Pi 4
+ 2GB, it should work fine on other linux platforms supported
+ by Flutter so long as there is support for KMS and DRI.
+
+ https://github.com/ardera/flutter-pi
+
+if BR2_PACKAGE_FLUTTER_PI
+
+config BR2_PACKAGE_FLUTTER_PI_TEXT_INPUT_PLUGIN
+ bool "text input plugin"
+ help
+ Include the text input plugin in the finished binary.
+ Enables text input (to flutter text fields, for example)
+ via attached keyboards.
+
+config BR2_PACKAGE_FLUTTER_PI_KEYBOARD_PLUGIN
+ bool "keyboard plugin"
+ help
+ Include the raw keyboard plugin in the finished binary.
+ Enables raw keycode listening in flutter via the flutter
+ RawKeyboard interface.
+
+endif
+
+comment "flutter-pi needs flutter-engine"
+ depends on !BR2_PACKAGE_FLUTTER_ENGINE
+
+comment "flutter-pi needs systemd"
+ depends on !BR2_PACKAGE_SYSTEMD
diff --git a/package/flutter-pi/flutter-pi.hash b/package/flutter-pi/flutter-pi.hash
new file mode 100644
index 0000000000..8491a727df
--- /dev/null
+++ b/package/flutter-pi/flutter-pi.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 06b5544c8538bb4a56cb49aa91e97bc0e319ca95a53414c8cfcc78aad2fda616 flutter-pi-004efdaa31bb9ca97938a6b05695496163fe1179-br1.tar.gz
+sha256 b34df9d3e1b4e5d1ba70b1740ec74b69f1189b44efd0c96b898b074ef8db1c70 LICENSE
diff --git a/package/flutter-pi/flutter-pi.mk b/package/flutter-pi/flutter-pi.mk
new file mode 100644
index 0000000000..504d823265
--- /dev/null
+++ b/package/flutter-pi/flutter-pi.mk
@@ -0,0 +1,53 @@
+################################################################################
+#
+# flutter-pi
+#
+################################################################################
+
+FLUTTER_PI_VERSION = 004efdaa31bb9ca97938a6b05695496163fe1179
+FLUTTER_PI_SITE = https://github.com/ardera/flutter-pi.git
+FLUTTER_PI_SITE_METHOD = git
+FLUTTER_PI_LICENSE = MIT
+FLUTTER_PI_LICENSE_FILES = LICENSE
+FLUTTER_PI_DEPENDENCIES = \
+ flutter-engine \
+ libinput \
+ libxkbcommon \
+ systemd
+
+FLUTTER_PI_CONF_OPTS = \
+ -DFLUTTER_EMBEDDER_HEADER=$(STAGING_DIR)/usr/include/flutter_embedder.h \
+ -DFILESYSTEM_LAYOUT=meta-flutter
+
+ifeq ($(BR2_PACKAGE_GSTREAMER1)$(BR2_PACKAGE_GST1_PLUGINS_BASE),yy)
+FLUTTER_PI_DEPENDENCIES += gstreamer1 gst1-plugins-base
+FLUTTER_PI_CONF_OPTS += -DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=ON
+else
+FLUTTER_PI_CONF_OPTS += -DBUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_FLUTTER_PI_INPUT_PLUGIN),y)
+FLUTTER_PI_DEPENDENCIES += libinput libxkbcommon
+FLUTTER_PI_CONF_OPTS += -DBUILD_TEXT_INPUT_PLUGIN=ON
+else
+FLUTTER_PI_CONF_OPTS += -DBUILD_TEXT_INPUT_PLUGIN=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_FLUTTER_PI_KEYBOARD_PLUGIN),y)
+FLUTTER_PI_CONF_OPTS += -DBUILD_RAW_KEYBOARD_PLUGIN=ON
+else
+FLUTTER_PI_CONF_OPTS += -DBUILD_RAW_KEYBOARD_PLUGIN=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OMXPLAYER),y)
+FLUTTER_PI_DEPENDENCIES += omxplayer
+FLUTTER_PI_CONF_OPTS += \
+ -DBUILD_OMXPLAYER_VIDEO_PLAYER_PLUGIN=ON \
+ -DOMXPLAYER_SUPPORTS_RUNTIME_ROTATION=ON
+else
+FLUTTER_PI_CONF_OPTS += \
+ -DBUILD_OMXPLAYER_VIDEO_PLAYER_PLUGIN=OFF \
+ -DOMXPLAYER_SUPPORTS_RUNTIME_ROTATION=OFF
+endif
+
+$(eval $(cmake-package))
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] package/flutter-gallery: new package
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
` (4 preceding siblings ...)
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-pi: " Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-17 20:58 ` [Buildroot] [PATCH v4] configs/flutter_x86_64_efi_demo_defconfig: new flutter demo config Adam Duskett
2023-08-18 7:43 ` [Buildroot] [PATCH v4] flutter: new packages Thomas Petazzoni via buildroot
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
Flutter Gallery is a resource to help developers evaluate and use Flutter.
It is a collection of Material Design & Cupertino widgets, behaviors, and
vignettes implemented with Flutter.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
.../0001-remove-GetStorage.patch | 84 +++++++++++++++++++
package/flutter-gallery/Config.in | 13 +++
package/flutter-gallery/flutter-gallery.hash | 3 +
package/flutter-gallery/flutter-gallery.mk | 44 ++++++++++
6 files changed, 146 insertions(+)
create mode 100644 package/flutter-gallery/0001-remove-GetStorage.patch
create mode 100644 package/flutter-gallery/Config.in
create mode 100644 package/flutter-gallery/flutter-gallery.hash
create mode 100644 package/flutter-gallery/flutter-gallery.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 5292315bcb..1988c265fb 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -29,6 +29,7 @@
N: Adam Duskett <adam.duskett@amarulasolutions.com>
F: package/depot-tools/
F: package/flutter-engine/
+F: package/flutter-gallery/
F: package/flutter-pi/
F: package/flutter-sdk-bin/
diff --git a/package/Config.in b/package/Config.in
index bf29825752..e08fe7a9ff 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -343,6 +343,7 @@ comment "Graphic libraries"
source "package/fbset/Config.in"
source "package/fbterm/Config.in"
source "package/fbv/Config.in"
+ source "package/flutter-gallery/Config.in"
source "package/flutter-pi/Config.in"
source "package/freerdp/Config.in"
source "package/graphicsmagick/Config.in"
diff --git a/package/flutter-gallery/0001-remove-GetStorage.patch b/package/flutter-gallery/0001-remove-GetStorage.patch
new file mode 100644
index 0000000000..142cf853da
--- /dev/null
+++ b/package/flutter-gallery/0001-remove-GetStorage.patch
@@ -0,0 +1,84 @@
+From a1d38d78163d84d3506c188e195cd5fa363f4be6 Mon Sep 17 00:00:00 2001
+From: Adam Duskett <adam.duskett@amarulasolutions.com>
+Date: Thu, 17 Aug 2023 13:00:07 -0600
+Subject: [PATCH] remove GetStorage
+
+Commit 287b20a8bfc71196cd733625e622b98b2f84bef1 introduced the get_storage
+plugin which breaks with the following error when the application is ran:
+
+Unhandled Exception: MissingPluginException(No implementation found for method
+getApplicataionDocumentsDirectory on channel plugins.flutter.io/path_provider)
+
+Revert the change.
+
+Upstream: https://github.com/flutter/gallery/issues/994
+Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
+---
+ lib/feature_discovery/feature_discovery.dart | 10 ----------
+ lib/main.dart | 2 --
+ pubspec.yaml | 1 -
+ 3 files changed, 13 deletions(-)
+
+diff --git a/lib/feature_discovery/feature_discovery.dart b/lib/feature_discovery/feature_discovery.dart
+index 288c78b..965d83c 100644
+--- a/lib/feature_discovery/feature_discovery.dart
++++ b/lib/feature_discovery/feature_discovery.dart
+@@ -6,7 +6,6 @@ import 'package:flutter/material.dart';
+ import 'package:flutter/scheduler.dart';
+ import 'package:gallery/feature_discovery/animation.dart';
+ import 'package:gallery/feature_discovery/overlay.dart';
+-import 'package:get_storage/get_storage.dart';
+
+ const _featureHighlightShownKey = 'feature_highlight_shown';
+
+@@ -271,15 +270,6 @@ class _FeatureDiscoveryState extends State<FeatureDiscovery>
+
+ initAnimationControllers();
+ initAnimations();
+-
+- final localStorage = GetStorage();
+- final featureHiglightShown =
+- localStorage.read<bool>(_featureHighlightShownKey) ?? false;
+- localStorage.write(_featureHighlightShownKey, true);
+- showOverlay = widget.showOverlay && !featureHiglightShown;
+- if (showOverlay) {
+- localStorage.write(_featureHighlightShownKey, true);
+- }
+ }
+
+ void initAnimationControllers() {
+diff --git a/lib/main.dart b/lib/main.dart
+index e9f4ff9..8c7a4e3 100644
+--- a/lib/main.dart
++++ b/lib/main.dart
+@@ -16,7 +16,6 @@ import 'package:gallery/pages/backdrop.dart';
+ import 'package:gallery/pages/splash.dart';
+ import 'package:gallery/routes.dart';
+ import 'package:gallery/themes/gallery_theme_data.dart';
+-import 'package:get_storage/get_storage.dart';
+ import 'package:google_fonts/google_fonts.dart';
+
+ import 'firebase_options.dart';
+@@ -26,7 +25,6 @@ export 'package:gallery/data/demos.dart' show pumpDeferredLibraries;
+
+ void main() async {
+ GoogleFonts.config.allowRuntimeFetching = false;
+- await GetStorage.init();
+
+ if (defaultTargetPlatform != TargetPlatform.linux &&
+ defaultTargetPlatform != TargetPlatform.windows &&
+diff --git a/pubspec.yaml b/pubspec.yaml
+index 964edad..4b00e40 100644
+--- a/pubspec.yaml
++++ b/pubspec.yaml
+@@ -24,7 +24,6 @@ dependencies:
+ firebase_core: ^2.7.0
+ firebase_crashlytics: ^3.1.1
+ firebase_performance: ^0.9.0+14
+- get_storage: ^2.1.1
+ google_fonts: ^5.0.0
+ intl: any # An exact version pin will be provided by the Flutter SDK
+ meta: ^1.7.0
+--
+2.41.0
+
diff --git a/package/flutter-gallery/Config.in b/package/flutter-gallery/Config.in
new file mode 100644
index 0000000000..e6efe47282
--- /dev/null
+++ b/package/flutter-gallery/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_FLUTTER_GALLERY
+ bool "flutter-gallery"
+ depends on BR2_PACKAGE_FLUTTER_ENGINE
+ help
+ Flutter Gallery is a resource to help developers evaluate
+ and use Flutter. It is a collection of Material Design &
+ Cupertino widgets, behaviors, and vignettes implemented
+ with Flutter.
+
+ https://github.com/flutter/gallery
+
+comment "flutter-gallery needs flutter-engine"
+ depends on !BR2_PACKAGE_FLUTTER_ENGINE
diff --git a/package/flutter-gallery/flutter-gallery.hash b/package/flutter-gallery/flutter-gallery.hash
new file mode 100644
index 0000000000..aea1ed39be
--- /dev/null
+++ b/package/flutter-gallery/flutter-gallery.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 14272aba90b7d26db33bac7b4692f0e3ed1a008286a08eaf2ea79abd478f23e9 flutter-gallery-2.10.2.tar.gz
+sha256 c731cf5a33db0e12647e0680ef0bc7839f99749404ac1ba4626cf7192065b3b0 LICENSE
diff --git a/package/flutter-gallery/flutter-gallery.mk b/package/flutter-gallery/flutter-gallery.mk
new file mode 100644
index 0000000000..948cffa8db
--- /dev/null
+++ b/package/flutter-gallery/flutter-gallery.mk
@@ -0,0 +1,44 @@
+################################################################################
+#
+# flutter-gallery
+#
+################################################################################
+
+FLUTTER_GALLERY_VERSION = 2.10.2
+FLUTTER_GALLERY_SITE = $(call github,flutter,gallery,v$(FLUTTER_GALLERY_VERSION))
+FLUTTER_GALLERY_LICENSE = BSD-3-Clause
+FLUTTER_GALLERY_LICENSE_FILES = LICENSE
+FLUTTER_GALLERY_DEPENDENCIES = \
+ host-flutter-sdk-bin \
+ flutter-engine
+
+FLUTTER_GALLERY_INSTALL_DIR = $(TARGET_DIR)/usr/share/flutter/gallery/$(FLUTTER_ENGINE_VERSION)/$(FLUTTER_ENGINE_RUNTIME_MODE)
+
+define FLUTTER_GALLERY_BUILD_CMDS
+ cd $(@D) && \
+ FLUTTER_RUNTIME_MODES=$(FLUTTER_ENGINE_RUNTIME_MODE) \
+ $(HOST_FLUTTER_SDK_BIN_FLUTTER) clean && \
+ $(HOST_FLUTTER_SDK_BIN_FLUTTER) packages get && \
+ $(HOST_FLUTTER_SDK_BIN_FLUTTER) build bundle && \
+ $(HOST_FLUTTER_SDK_BIN_DART_BIN) package:gallery/main.dart && \
+ $(HOST_FLUTTER_SDK_BIN_ENV) $(FLUTTER_ENGINE_GEN_SNAPSHOT) \
+ --deterministic \
+ --snapshot_kind=app-aot-elf \
+ --elf=libapp.so \
+ .dart_tool/flutter_build/*/app.dill
+endef
+
+define FLUTTER_GALLERY_INSTALL_TARGET_CMDS
+ mkdir -p $(FLUTTER_GALLERY_INSTALL_DIR)/{data,lib}
+ cp -dprf $(@D)/build/flutter_assets $(FLUTTER_GALLERY_INSTALL_DIR)/data/
+
+ $(INSTALL) -D -m 0755 $(@D)/libapp.so \
+ $(FLUTTER_GALLERY_INSTALL_DIR)/lib/libapp.so
+
+ ln -sf ../../../../$(FLUTTER_ENGINE_VERSION)/$(FLUTTER_ENGINE_RUNTIME_MODE)/data/icudtl.dat \
+ $(FLUTTER_GALLERY_INSTALL_DIR)/data/
+
+ ln -sf ../../../../../../lib/libflutter_engine.so $(FLUTTER_GALLERY_INSTALL_DIR)/lib/
+endef
+
+$(eval $(generic-package))
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* [Buildroot] [PATCH v4] configs/flutter_x86_64_efi_demo_defconfig: new flutter demo config
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
` (5 preceding siblings ...)
2023-08-17 20:58 ` [Buildroot] [PATCH v4] package/flutter-gallery: " Adam Duskett
@ 2023-08-17 20:58 ` Adam Duskett
2023-08-18 7:43 ` [Buildroot] [PATCH v4] flutter: new packages Thomas Petazzoni via buildroot
7 siblings, 0 replies; 9+ messages in thread
From: Adam Duskett @ 2023-08-17 20:58 UTC (permalink / raw)
To: buildroot; +Cc: Yann E . MORIN, Adam Duskett, Thomas Petazzoni, Asaf Kahlon
This config uses board/flutter_x86_64 to demonstrate Buildroots new flutter
capabilities. When ran, flutter-gallery automatically starts on boot.
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
Changes v3 -> v4:
- Add BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y to flutter_x86_64_efi_demo_defconfig
DEVELOPERS | 2 +
board/flutter_x86_64/linux-vkms.fragment | 2 +
.../flutter-gallery.service | 1 +
.../systemd/system/flutter-gallery.service | 10 +++
board/flutter_x86_64/readme.txt | 18 ++++++
configs/flutter_x86_64_efi_demo_defconfig | 63 +++++++++++++++++++
6 files changed, 96 insertions(+)
create mode 100644 board/flutter_x86_64/linux-vkms.fragment
create mode 120000 board/flutter_x86_64/overlay/etc/systemd/system/multi-user.target.wants/flutter-gallery.service
create mode 100644 board/flutter_x86_64/overlay/usr/lib/systemd/system/flutter-gallery.service
create mode 100644 board/flutter_x86_64/readme.txt
create mode 100644 configs/flutter_x86_64_efi_demo_defconfig
diff --git a/DEVELOPERS b/DEVELOPERS
index 1988c265fb..73ea022044 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -27,6 +27,8 @@
# modify packages that use this infrastructure.
N: Adam Duskett <adam.duskett@amarulasolutions.com>
+F: board/flutter_x86_64/
+F: configs/flutter_x86_64_efi_demo_defconfig
F: package/depot-tools/
F: package/flutter-engine/
F: package/flutter-gallery/
diff --git a/board/flutter_x86_64/linux-vkms.fragment b/board/flutter_x86_64/linux-vkms.fragment
new file mode 100644
index 0000000000..3fc7a5dded
--- /dev/null
+++ b/board/flutter_x86_64/linux-vkms.fragment
@@ -0,0 +1,2 @@
+CONFIG_DEBUG_FS=y
+CONFIG_DRM_VKMS=y
diff --git a/board/flutter_x86_64/overlay/etc/systemd/system/multi-user.target.wants/flutter-gallery.service b/board/flutter_x86_64/overlay/etc/systemd/system/multi-user.target.wants/flutter-gallery.service
new file mode 120000
index 0000000000..40993fb16c
--- /dev/null
+++ b/board/flutter_x86_64/overlay/etc/systemd/system/multi-user.target.wants/flutter-gallery.service
@@ -0,0 +1 @@
+../../../../usr/lib/systemd/system/flutter-gallery.service
\ No newline at end of file
diff --git a/board/flutter_x86_64/overlay/usr/lib/systemd/system/flutter-gallery.service b/board/flutter_x86_64/overlay/usr/lib/systemd/system/flutter-gallery.service
new file mode 100644
index 0000000000..0cf66d9ce4
--- /dev/null
+++ b/board/flutter_x86_64/overlay/usr/lib/systemd/system/flutter-gallery.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=flutter-gallery daemon
+After=dbus.service systemd-udevd.service
+
+[Service]
+ExecStart=/usr/bin/flutter-pi --release /usr/share/flutter/gallery/3.10.6/release/
+Type=notify
+
+[Install]
+WantedBy=multi-user.target
diff --git a/board/flutter_x86_64/readme.txt b/board/flutter_x86_64/readme.txt
new file mode 100644
index 0000000000..ec4e527b1c
--- /dev/null
+++ b/board/flutter_x86_64/readme.txt
@@ -0,0 +1,18 @@
+Run the emulation with:
+
+qemu-system-x86_64 -enable-kvm -M pc \
+-m 512 \
+-cpu IvyBridge \
+-kernel output/images/bzImage \
+-append "rootwait root=/dev/vda console=tty1 console=ttyS0" \
+-drive file=output/images/rootfs.ext2,if=virtio,format=raw \
+-usb -device usb-tablet \
+-net nic,model=virtio \
+-serial stdio \
+-vga virtio \
+-display sdl,show-cursor=on
+
+
+Optionally add -smp N to emulate a SMP system with N CPUs.
+
+The flutter-gallery app will automatically run.
diff --git a/configs/flutter_x86_64_efi_demo_defconfig b/configs/flutter_x86_64_efi_demo_defconfig
new file mode 100644
index 0000000000..426eb98e73
--- /dev/null
+++ b/configs/flutter_x86_64_efi_demo_defconfig
@@ -0,0 +1,63 @@
+BR2_x86_64=y
+BR2_x86_corei7_avx=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_CCACHE=y
+BR2_CCACHE_DIR="$(HOME)/Downloads/ccache/flutter-x86_64"
+BR2_CCACHE_INITIAL_SETUP="--max-size=5G"
+BR2_PER_PACKAGE_DIRECTORIES=y
+BR2_INIT_SYSTEMD=y
+BR2_TARGET_GENERIC_GETTY_PORT="tty1"
+BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+BR2_ROOTFS_OVERLAY="$(TOPDIR)/board/flutter_x86_64/overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/pc/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/pc/post-image-efi.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1.45"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/pc/linux.config"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(TOPDIR)/board/flutter_x86_64/linux-vkms.fragment"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_LINUX_KERNEL_NEEDS_HOST_LIBELF=y
+BR2_PACKAGE_FLUTTER_PI=y
+BR2_PACKAGE_FLUTTER_PI_KEYBOARD_PLUGIN=y
+BR2_PACKAGE_FLUTTER_PI_TEXT_INPUT_PLUGIN=y
+BR2_PACKAGE_FLUTTER_GALLERY=y
+BR2_PACKAGE_MESA3D=y
+BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST=y
+BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VIRGL=y
+BR2_PACKAGE_MESA3D_OPENGL_ES=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_ATHEROS_9170=y
+BR2_PACKAGE_LINUX_FIRMWARE_ATHEROS_9271=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3160=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3168=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_5000=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_6000G2A=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_6000G2B=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_7260=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_7265D=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8000C=y
+BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_8265=y
+BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT73=y
+BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y
+BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
+BR2_PACKAGE_ACPID=y
+BR2_PACKAGE_FLUTTER_ENGINE=y
+BR2_PACKAGE_CONNMAN=y
+BR2_PACKAGE_CONNMAN_WIFI=y
+BR2_PACKAGE_CONNMAN_CLIENT=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O 64bit"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_GRUB2=y
+BR2_TARGET_GRUB2_X86_64_EFI=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [Buildroot] [PATCH v4] flutter: new packages
2023-08-17 20:58 [Buildroot] [PATCH v4] flutter: new packages Adam Duskett
` (6 preceding siblings ...)
2023-08-17 20:58 ` [Buildroot] [PATCH v4] configs/flutter_x86_64_efi_demo_defconfig: new flutter demo config Adam Duskett
@ 2023-08-18 7:43 ` Thomas Petazzoni via buildroot
7 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-08-18 7:43 UTC (permalink / raw)
To: Adam Duskett; +Cc: Yann E . MORIN, Asaf Kahlon, buildroot
Hello Adam,
On Thu, 17 Aug 2023 14:58:48 -0600
Adam Duskett <adam.duskett@amarulasolutions.com> wrote:
> This patch series should provide Buildroot with everything necessary to build
> and run flutter applications. I even included a demo config and board file for
> new users to quickly get started.
Thanks for continuing the effort on this. Please note that your patch
series lacks numbering on patches (aka PATCH 1/6, PATCH 2/6, etc.).
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread