Message ID | 20240325223424.108702-12-adam.duskett@amarulasolutions.com |
---|---|
State | Accepted |
Headers | show |
Series | [v2,01/13] package/flutter-packages/flutter-markdown-example: new package | expand |
On 25/03/2024 23:34, Adam Duskett wrote: > Add 0005-skip-configuration-dependency-if-unit-tests-are-disa.patch, which > fixes gtk+-3.0 being an unconditional requirement. > > Other changes: > Flutter 3.19.x made Wayland and X11 an unconditional requirement, resulting in > the following errors when compiling: > > """ > ../../flutter/third_party/swiftshader/src/WSI/libWaylandClient.hpp:18:10: fatal error: 'wayland-client.h' file not found > 18 | #include <wayland-client.h> > | ^~~~~~~~~~~~~~~~~~ > > ../../flutter/third_party/swiftshader/src/WSI/WaylandSurfaceKHR.cpp:15: > ../../flutter/third_party/swiftshader/src/WSI/WaylandSurfaceKHR.hpp:22:10: fatal error: 'wayland-client.h' file not found > 22 | #include <wayland-client.h> > | ^~~~~~~~~~~~~~~~~~ > 1 error generated. > [1369/11229] CC obj/flutter/third_party/sqlite/sqlite.sqlite3.o > """ > > After raising an issue found here: > https://github.com/flutter/flutter/issues/144635 and after several hours of > searching, the problem is https://github.com/flutter/buildroot/commit/d01da2716 > which hardcodes the following values if building for a Linux platform: > - ozone_platform_x11 = true > - ozone_platform_wayland = true > > As upstream maintainers listed the above as low priority (P3), a simple fix is > to add two additional sed calls in FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP and > FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP which set ozone_platform_x11 and > ozone_platform_wayland to the appropriate values. > > Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > --- > ...on-dependency-if-unit-tests-are-disa.patch | 32 +++++++++++++++++++ > package/flutter-engine/flutter-engine.mk | 8 ++++- This version bump is fine, but it looks like flutter-engine doesn't have a hash file. The commit log that adds the package explains why - but that's not a reason not to have a hash file. THe hash file should still be there, just with "none" as hash. In particular, the license file should still be in the hash file. Regards, Arnout > 2 files changed, 39 insertions(+), 1 deletion(-) > create mode 100644 package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch > > diff --git a/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch b/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch > new file mode 100644 > index 0000000000..125bfc6910 > --- /dev/null > +++ b/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch > @@ -0,0 +1,32 @@ > +From 2252a85e59669b5826019f60a98b7a69939dacfd Mon Sep 17 00:00:00 2001 > +From: Greg Spencer <gspencer@google.com> > +Date: Mon, 4 Mar 2024 12:30:41 -0800 > +Subject: [PATCH] Skip configuration dependency if unit tests are disabled. > + > +Commit 88baf62f made gtk+-3.0 an unconditional requirement, see: > + > +Issue: https://github.com/flutter/flutter/issues/144421 > +Upstream: Merged. https://github.com/flutter/engine/pull/51179 > + > +Signed-off-by: Greg Spencer <gspencer@google.com> > +Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> > +--- > + flutter/testing/BUILD.gn | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/flutter/testing/BUILD.gn b/flutter/testing/BUILD.gn > +index 9eac29452..a7d094695 100644 > +--- a/flutter/testing/BUILD.gn > ++++ b/flutter/testing/BUILD.gn > +@@ -51,7 +51,7 @@ source_set("testing") { > + > + sources = [ "run_all_unittests.cc" ] > + > +- if (is_linux) { > ++ if (enable_unittests && is_linux) { > + # So that we can call gtk_init in main(). > + configs += [ "//flutter/shell/platform/linux/config:gtk" ] > + } > +-- > +2.44.0 > + > diff --git a/package/flutter-engine/flutter-engine.mk b/package/flutter-engine/flutter-engine.mk > index d08274f546..ff21e0949d 100644 > --- a/package/flutter-engine/flutter-engine.mk > +++ b/package/flutter-engine/flutter-engine.mk > @@ -21,7 +21,7 @@ > # > # 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.16.8 > +FLUTTER_ENGINE_VERSION = 3.19.4 > > # There is nothing for Buildroot to download. This is handled by gclient. > FLUTTER_ENGINE_SITE = > @@ -154,6 +154,9 @@ 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 > + > + $(SED) "s%ozone_platform_x11.*%ozone_platform_x11 = false%g" \ > + $(@D)/build/config/BUILDCONFIG.gn > endef > FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP > endif > @@ -164,6 +167,9 @@ else > define FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP > $(SED) "s%vulkan_use_wayland.*%vulkan_use_wayland = false%g" \ > $(@D)/build_overrides/vulkan_headers.gni > + > + $(SED) "s%ozone_platform_wayland.*%ozone_platform_wayland = false%g" \ > + $(@D)/build/config/BUILDCONFIG.gn > endef > FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP > endif
diff --git a/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch b/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch new file mode 100644 index 0000000000..125bfc6910 --- /dev/null +++ b/package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch @@ -0,0 +1,32 @@ +From 2252a85e59669b5826019f60a98b7a69939dacfd Mon Sep 17 00:00:00 2001 +From: Greg Spencer <gspencer@google.com> +Date: Mon, 4 Mar 2024 12:30:41 -0800 +Subject: [PATCH] Skip configuration dependency if unit tests are disabled. + +Commit 88baf62f made gtk+-3.0 an unconditional requirement, see: + +Issue: https://github.com/flutter/flutter/issues/144421 +Upstream: Merged. https://github.com/flutter/engine/pull/51179 + +Signed-off-by: Greg Spencer <gspencer@google.com> +Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> +--- + flutter/testing/BUILD.gn | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flutter/testing/BUILD.gn b/flutter/testing/BUILD.gn +index 9eac29452..a7d094695 100644 +--- a/flutter/testing/BUILD.gn ++++ b/flutter/testing/BUILD.gn +@@ -51,7 +51,7 @@ source_set("testing") { + + sources = [ "run_all_unittests.cc" ] + +- if (is_linux) { ++ if (enable_unittests && is_linux) { + # So that we can call gtk_init in main(). + configs += [ "//flutter/shell/platform/linux/config:gtk" ] + } +-- +2.44.0 + diff --git a/package/flutter-engine/flutter-engine.mk b/package/flutter-engine/flutter-engine.mk index d08274f546..ff21e0949d 100644 --- a/package/flutter-engine/flutter-engine.mk +++ b/package/flutter-engine/flutter-engine.mk @@ -21,7 +21,7 @@ # # 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.16.8 +FLUTTER_ENGINE_VERSION = 3.19.4 # There is nothing for Buildroot to download. This is handled by gclient. FLUTTER_ENGINE_SITE = @@ -154,6 +154,9 @@ 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 + + $(SED) "s%ozone_platform_x11.*%ozone_platform_x11 = false%g" \ + $(@D)/build/config/BUILDCONFIG.gn endef FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP endif @@ -164,6 +167,9 @@ else define FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP $(SED) "s%vulkan_use_wayland.*%vulkan_use_wayland = false%g" \ $(@D)/build_overrides/vulkan_headers.gni + + $(SED) "s%ozone_platform_wayland.*%ozone_platform_wayland = false%g" \ + $(@D)/build/config/BUILDCONFIG.gn endef FLUTTER_ENGINE_PRE_CONFIGURE_HOOKS += FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP endif
Add 0005-skip-configuration-dependency-if-unit-tests-are-disa.patch, which fixes gtk+-3.0 being an unconditional requirement. Other changes: Flutter 3.19.x made Wayland and X11 an unconditional requirement, resulting in the following errors when compiling: """ ../../flutter/third_party/swiftshader/src/WSI/libWaylandClient.hpp:18:10: fatal error: 'wayland-client.h' file not found 18 | #include <wayland-client.h> | ^~~~~~~~~~~~~~~~~~ ../../flutter/third_party/swiftshader/src/WSI/WaylandSurfaceKHR.cpp:15: ../../flutter/third_party/swiftshader/src/WSI/WaylandSurfaceKHR.hpp:22:10: fatal error: 'wayland-client.h' file not found 22 | #include <wayland-client.h> | ^~~~~~~~~~~~~~~~~~ 1 error generated. [1369/11229] CC obj/flutter/third_party/sqlite/sqlite.sqlite3.o """ After raising an issue found here: https://github.com/flutter/flutter/issues/144635 and after several hours of searching, the problem is https://github.com/flutter/buildroot/commit/d01da2716 which hardcodes the following values if building for a Linux platform: - ozone_platform_x11 = true - ozone_platform_wayland = true As upstream maintainers listed the above as low priority (P3), a simple fix is to add two additional sed calls in FLUTTER_ENGINE_VULKAN_X11_SUPPORT_FIXUP and FLUTTER_ENGINE_VULKAN_WAYLAND_SUPPORT_FIXUP which set ozone_platform_x11 and ozone_platform_wayland to the appropriate values. Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> --- ...on-dependency-if-unit-tests-are-disa.patch | 32 +++++++++++++++++++ package/flutter-engine/flutter-engine.mk | 8 ++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 package/flutter-engine/0005-skip-configuration-dependency-if-unit-tests-are-disa.patch