Coin, FFmpeg, iOS: Apply 'prefix' consistently

In the provisioning script 'install-ffmpeg-ios.sh', we have a variable
'prefix' controlling where to install the finalized library. The value
of this prefix is sometimes hardcoded into some of the temporary build
directories, making the script break if we actually modify the 'prefix'
variable. This means we currently cannot easily change the output
directory.

This patch modifies 'install-ffmpeg-ios.sh' so that the 'prefix' is
applied consistently throughout the script, allowing us to change
the output directory in the future.

Pick-to: 6.10 6.9 6.8
Change-Id: I3458984aa22f8c82ed4d0bfac8ac8e71356e8789
Reviewed-by: Simo Fält <simo.falt@qt.io>
This commit is contained in:
Nils Petter Skålerud 2025-05-13 14:07:33 +02:00 committed by Nils Petter Skålerud
parent 708548742b
commit d72ace1a0d

View File

@ -110,7 +110,7 @@ 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 ffmpeg_library_path="$ffmpeg_source_dir/build_ios/${platform}/installed/usr/local/ios/ffmpeg"
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}"
sudo mkdir -p "${ffmpeg_library_path}/framework/${framework_name}.framework"
@ -140,8 +140,8 @@ create_xcframework() {
local target_platform_a="$2"
local target_platform_b="$3"
local fw_a="$ffmpeg_source_dir/build_ios/${target_platform_a}/installed/usr/local/ios/ffmpeg/framework/${framework_name}.framework"
local fw_b="$ffmpeg_source_dir/build_ios/${target_platform_b}/installed/usr/local/ios/ffmpeg/framework/${framework_name}.framework"
local fw_a="$ffmpeg_source_dir/build_ios/${target_platform_a}/installed$prefix/framework/${framework_name}.framework"
local fw_b="$ffmpeg_source_dir/build_ios/${target_platform_b}/installed$prefix/framework/${framework_name}.framework"
sudo mkdir -p "$prefix/framework/"
sudo xcodebuild -create-xcframework -framework $fw_a -framework $fw_b -output "${prefix}/framework/${framework_name}.xcframework"
@ -164,7 +164,7 @@ done
# xcframeworks are already installed directly into the target output directory.
# We need to install headers
sudo cp -r "$ffmpeg_source_dir/build_ios/arm64-iphoneos/installed/usr/local/ios/ffmpeg/include" $prefix
sudo cp -r "$ffmpeg_source_dir/build_ios/arm64-iphoneos/installed$prefix/include" $prefix
# The set_ffmpeg_dir_env_var requires the presence of the "lib" subfolder in order to validate
# our FFmpeg install. On iOS we don't use this subfolder, we only rely on the "framework" subfolder.
# So we create a dummy "lib" folder to pass the check.