buildroot/package/flutter-engine/0004-pkg-config.py-do-not-prepend-sysroot-path.patch
Adam Duskett 827da2242c package/flutter-engine: new package
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.

- flutter-engine relies on the "PUB_CACHE", that is provided by flutter-sdk,
  so we need a build dependency, even if no tool from host-flutter-sdk-bin
  is used to build flutter-engine

Tested with:
  - Debian 11 and 12
  - Ubuntu 18.04, 20.04, and 22.04
  - Fedora 38
  - Per-package directories

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
[yann.morin.1998@free.fr:
  - search gclient.py from PATH
  - indent shell script with 4 spaces
  - reorganise schell script with prepare/cleanup
  - tweak comment about weirdness of flutter buildsystem
  - use suitable-extactor and TAR_OPTIONS
  - use FLUTTER_SDK_BIN_PUB_CACHE
  - add dependency to host-futter-sdk-bin (Adam)
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2023-09-30 00:11:58 +02:00

38 lines
1.2 KiB
Diff

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