#!/usr/bin/env bash set -uex section_start perfetto "Building perfetto" BASE_PWD=$PWD PERFETTO_REVISION=$(grep 'revision =' subprojects/perfetto.wrap | cut -d ' ' -f3) patch_files=( "build-perfetto-Fix-C-standard-library-build-errors-with-Debian-13.patch" ) # Set PERFETTO_ARCH based on DEBIAN_ARCH if [[ -z "${PERFETTO_ARCH:-}" ]]; then case "$DEBIAN_ARCH" in amd64) PERFETTO_ARCH=x64;; arm64) PERFETTO_ARCH=arm64;; esac fi git clone --branch "$PERFETTO_REVISION" --depth 1 https://github.com/google/perfetto /perfetto pushd /perfetto for patch in "${patch_files[@]}"; do echo "Applying patch: $patch" git am "$BASE_PWD/.gitlab-ci/container/patches/$patch" done # Base GN args mkdir -p _build cat >_build/args.gn < arm64 cross-compiler. cat >>_build/args.gn <