Files
buildroot/package/flutter-engine/0003-fix-toolchain-paths.patch
Adam Duskett 1956e4e434 package/flutter-engine: bump to version 3.29.2
As of Flutter 3.27.4, the flutter-engine github repository is archived, and the
flutter-engine source code now resides at https://github.com/flutter/flutter/.

Because of the above, the following changes must occure:

- Paths are now prefixed with engine/src.

- The "name" field in the dot-gclient file is now "./", and the gen-tarball
  script:
   - Makes the dl-tmp/src dir
   - Copies the dot-gclient file to the dl-tmp/src dir
   - Runs gclient.py inside of the dl-tmp/src dir

Without these changes, gclient creates two directores:
dl-tmp/src/flutter and dl-tmp/src/engine, and cloning fails with the following
error:

```
python3: can't open file 'dl-tmp/src/engine/src/flutter/tools/pub_get_offline.py':
[Errno 2] No such file or directory
```

because the file resides at src/flutter/engine/src/flutter/tools.
Changing the name from src/flutter to ./ and running gclient.py directly in
the src directory creates a proper directory structure suitable for compiling.

Of course, this also means there is a new pushd in the gen_tarball method to
move to ${SCRATCH_DIR} to ensure the tarball is generated outside of the
source directory.

Tested with run-tests tests.package.test_flutter.TestFlutter.test_run.

The license file has changed, but it's still BSD-3-Clause.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-04-21 23:19:59 +02:00

41 lines
1.6 KiB
Diff

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, engine/src/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>
---
engine/src/build/toolchain/custom/BUILD.gn | 4 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/engine/src/build/toolchain/custom/BUILD.gn b/engine/src/build/toolchain/custom/BUILD.gn
index 65b1623..8b3f6f8 100644
--- a/engine/src/build/toolchain/custom/BUILD.gn
+++ b/engine/src/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