diff --git a/coin/provisioning/common/shared/fix_ffmpeg_dependencies.sh b/coin/provisioning/common/shared/fix_ffmpeg_dependencies.sh index bfc04a91..5e492d2e 100755 --- a/coin/provisioning/common/shared/fix_ffmpeg_dependencies.sh +++ b/coin/provisioning/common/shared/fix_ffmpeg_dependencies.sh @@ -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") diff --git a/coin/provisioning/qtci-macos-14-arm/27-binutils.sh b/coin/provisioning/qtci-macos-14-arm/27-binutils.sh new file mode 100755 index 00000000..c4c74e7b --- /dev/null +++ b/coin/provisioning/qtci-macos-14-arm/27-binutils.sh @@ -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 diff --git a/coin/provisioning/qtci-macos-14-arm/28-patchelf.sh b/coin/provisioning/qtci-macos-14-arm/28-patchelf.sh new file mode 100755 index 00000000..414ed936 --- /dev/null +++ b/coin/provisioning/qtci-macos-14-arm/28-patchelf.sh @@ -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 diff --git a/coin/provisioning/qtci-macos-14-x86_64/27-binutils.sh b/coin/provisioning/qtci-macos-14-x86_64/27-binutils.sh new file mode 100755 index 00000000..c4c74e7b --- /dev/null +++ b/coin/provisioning/qtci-macos-14-x86_64/27-binutils.sh @@ -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 diff --git a/coin/provisioning/qtci-macos-15-x86_64/27-binutils.sh b/coin/provisioning/qtci-macos-15-x86_64/27-binutils.sh new file mode 100755 index 00000000..c4c74e7b --- /dev/null +++ b/coin/provisioning/qtci-macos-15-x86_64/27-binutils.sh @@ -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