Files
qt5/coin/provisioning/common/unix/ffmpeg-installation-utils.sh
Nils Petter Skålerud d2bc5fdeae FFmpeg, iOS: Automatically grab version string from source code
This patch allows us to automatically grab the FFmpeg version string
from the source code directly, rather than having to explicitly specify
a version string inside ffmpeg-installation-utils.

Pick-to: 6.11
Change-Id: I657302ab8566592390a51c6f5c3ee989d66efaaa
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2026-04-01 13:45:59 +01:00

76 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# 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
download_ffmpeg() {
local version="${1:-"n7.1.3"}"
local sha1="${2:-27051817deec88bed3b9652d49f9127d22268d83}"
local ffmpeg_name="FFmpeg-$version"
local target_dir="$HOME"
local ffmpeg_source_dir="$target_dir/$ffmpeg_name"
if [ ! -d "$ffmpeg_source_dir" ]; then
local url_public="https://github.com/FFmpeg/FFmpeg/archive/refs/tags/$version.tar.gz"
local url_cached="http://ci-files01-hki.ci.qt.io/input/ffmpeg/$version.tar.gz"
local app_prefix=""
source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh"
InstallFromCompressedFileFromURL "$url_cached" "$url_public" "$sha1" "$target_dir" "$app_prefix" > /dev/null
fi
echo "$ffmpeg_source_dir"
}
get_ffmpeg_config_options() {
local build_type="$1"
local result
result=$(cat "${BASH_SOURCE%/*}/../shared/ffmpeg_config_options.txt")
if [ "$build_type" != "static" ]; then
result+=" --enable-shared --disable-static"
fi
echo "$result"
}
get_ffmpeg_build_type() {
local result="${1:-shared}"
if [ "$result" != "static" ] && [ "$result" != "shared" ]; then
>&2 echo "Invalid build_type: $result. The shared build type will be used."
result="shared"
fi
echo "$result"
}
set_ffmpeg_dir_env_var() {
local envvar="$1"
local dir="$2"
if [ ! -d "$dir" ]; then
>&2 echo "the FFmpeg dir $dir doesn't exist"
exit 1
fi
# minimal validity check, more checks can be added
if [ ! -d "$dir/include" ] || [ ! -d "$dir/lib" ]; then
>&2 echo "The FFmpeg dir $dir is not valid"
exit 1
fi
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
SetEnvVar "$envvar" "$dir"
}
set_ffmpeg_env_var() {
local envvar="$1"
local value="$2"
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
SetEnvVar "$envvar" "$value"
}