Coin, FFmpeg: Fool-proof fix_ffmpeg_dependencies.sh

This script has previously failed under some configurations, while
also failing to stop provisioning.

This patch enables fast-fail behavior, catches potential issues with
missing executables early with a descriptive error message. This
should allow us to detect if the required packages are missing
in the future, and stop provisioning accordingly.

This patch also installs the necessary packages on the relevant
CI build targets.

Task-number: QTBUG-136930
Pick-to: 6.10 6.9 6.8
Change-Id: I7c781264ad67508d19fd44556a9caf0f201638d4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Nils Petter Skålerud 2025-05-20 11:03:53 +02:00
parent f8b56bf072
commit 0706273c76
5 changed files with 53 additions and 2 deletions

View File

@ -2,16 +2,33 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -x
set -euox pipefail
lib_dir="$1/lib"
additional_suffix="${2:-}"
set_rpath="${3:-yes}"
# readelf and patchelf are prerequisite tools for this script. Check
# that they are available.
if [ "$(uname -s)" = "Darwin" ]; then
# Under Homebrew, binutils package is not symlinked into PATH.
# This lets us use readelf provided by Homebrew.
readelf() { "$(brew --prefix binutils)/bin/readelf" "$@"; }
readelf_homebrew_path="$(brew --prefix binutils)/bin/readelf"
if [[ ! -x "$readelf_homebrew_path" ]]; then
echo "Found no valid readelf executable. It is possible it was not correctly installed through Homebrew."
exit 1
fi
readelf() { "$readelf_homebrew_path" "$@"; }
fi
if ! command -v readelf; then
echo "Found no valid readelf command. It is possible it was not correctly installed."
exit 1
fi
if ! command -v patchelf; then
echo "Found no valid patchelf command. It is possible it was not correctly installed."
exit 1
fi
ffmpeg_libs=("avcodec" "avdevice" "avfilter" "avformat" "avutil" "swresample" "swscale")

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
# binutils is installed with an error: The formula built, but is not symlinked into /usr/local
# To avoid stopping the configuration due to this problem, "|| true" is added.
brew install binutils || true

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
brew install patchelf

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
# binutils is installed with an error: The formula built, but is not symlinked into /usr/local
# To avoid stopping the configuration due to this problem, "|| true" is added.
brew install binutils || true

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -ex
# binutils is installed with an error: The formula built, but is not symlinked into /usr/local
# To avoid stopping the configuration due to this problem, "|| true" is added.
brew install binutils || true