From 7515ceea5b9e7b7ebfab781ca9e0add2419db970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Petter=20Ska=CC=8Alerud?= Date: Fri, 24 Oct 2025 16:24:34 +0200 Subject: [PATCH] FFmpeg, iOS: Automatically grab FFmpeg version in Info.plist manifest Our iOS FFmpeg provisioning includes build info.plist manifest files for the FFMpeg framework files. This manifest includes the version of FFmpeg that we are deploying. This version string is currently hardcoded and does not match the version we are actually building. This patch changes the 'install-ffmpeg-ios.sh' script to programmatically grab the FFmpeg version from our related scripts, and inserts it in the info.plist manifest. Task-number: QTBUG-136480 Change-Id: Iafeaade2ff6f2a933a0ba48749af459eef37ab51 Reviewed-by: Artem Dyomin (cherry picked from commit c3b80178ee06434dcef1cb37fbb6e8a79aa950a9) Reviewed-by: Qt Cherry-pick Bot --- .../common/unix/ffmpeg-installation-utils.sh | 6 ++++- .../common/unix/install-ffmpeg-ios.sh | 23 +++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/coin/provisioning/common/unix/ffmpeg-installation-utils.sh b/coin/provisioning/common/unix/ffmpeg-installation-utils.sh index fdff15ee..1a68e252 100755 --- a/coin/provisioning/common/unix/ffmpeg-installation-utils.sh +++ b/coin/provisioning/common/unix/ffmpeg-installation-utils.sh @@ -2,8 +2,12 @@ # 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 +ffmpeg_version_default() { + echo "n7.1.2" +} + download_ffmpeg() { - local version="${1:-n7.1.2}" + local version="${1:-$(ffmpeg_version_default)}" local sha1="${2:-1e4e937facdbde15943dd093121836bf69f27c7c}" local ffmpeg_name="FFmpeg-$version" diff --git a/coin/provisioning/common/unix/install-ffmpeg-ios.sh b/coin/provisioning/common/unix/install-ffmpeg-ios.sh index 9eea5143..f1360942 100755 --- a/coin/provisioning/common/unix/install-ffmpeg-ios.sh +++ b/coin/provisioning/common/unix/install-ffmpeg-ios.sh @@ -12,6 +12,7 @@ readonly MINIMUM_IOS_VERSION="16.0" source "${BASH_SOURCE%/*}/../unix/ffmpeg-installation-utils.sh" +ffmpeg_version=$(ffmpeg_version_default) ffmpeg_source_dir=$(download_ffmpeg) ffmpeg_config_options=$(get_ffmpeg_config_options "shared") default_prefix="/usr/local/ios/ffmpeg" @@ -67,11 +68,23 @@ build_info_plist() { local framework_name="$2" local framework_id="$3" + # Apple plist format has a strict requirement that the version string + # contains up to 3 numerics separated by a dot. Meanwhile, FFmpeg versioning + # tends to use an 'n' prefix in their versioning. We use a regex to convert + # and verify the version string. + # + # https://developer.apple.com/documentation/bundleresources/information-property-list/cfbundleversion + local formatted_ffmpeg_version + if [[ $ffmpeg_version =~ ([0-9]+(\.[0-9]+){0,2}) ]]; then + formatted_ffmpeg_version="${BASH_REMATCH[1]}" + else + echo "Unable to format FFmpeg version string '$ffmpeg_version' into corresponding Apple Info.plist format" + exit 1 + fi + local minimum_version_key="MinimumOSVersion" local supported_platforms="iPhoneOS" - # TODO: This should be filled out with the actual version of FFmpeg that we are - # deploying. info_plist=" @@ -89,9 +102,9 @@ build_info_plist() { CFBundlePackageType FMWK CFBundleShortVersionString - 7.0.2 + ${formatted_ffmpeg_version} CFBundleVersion - 7.0.2 + ${formatted_ffmpeg_version} CFBundleSignature ???? ${minimum_version_key} @@ -111,7 +124,7 @@ build_info_plist() { create_framework() { # Create a 'traditional' framework from the corresponding dylib. local framework_name="$1" - local platform="$2" # For now it's either arm64 or arm64-simulator, see below. + local platform="$2" # For now it's either arm64, x86_64-simulator, see below. local ffmpeg_library_path="$ffmpeg_source_dir/build_ios/${platform}/installed$prefix" local framework_complete_path="${ffmpeg_library_path}/framework/${framework_name}.framework/${framework_name}"