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}"