From e3966f2ffc5d1dcdcf73ca2ba2b14a353a96e0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Petter=20Ska=CC=8Alerud?= Date: Fri, 29 Aug 2025 09:30:52 +0200 Subject: [PATCH] Linux, FFmpeg: Make install-ffmpeg-linux.sh take an output parameter Currently, this script is hardcoded to output to the directory '/usr/local/'. This output is stored in the variable 'prefix'. However, this variable is used inconsistently in the script, meaning we cannot actually modify the variable to change the output directory. This patch does the following: - Applies the 'prefix' variable where necessary. - Allows an optional command-line parameter to be applied to 'prefix', allowing one to specify where the output directory. This is particularly useful for local builds. No changes to current CI behavior. Pick-to: 6.11 6.10 6.8 Change-Id: I51f83ce3844c2aa9db778b1c54091acb64a227e6 Reviewed-by: Dimitrios Apostolou Reviewed-by: Artem Dyomin --- coin/provisioning/common/linux/install-ffmpeg-linux.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/coin/provisioning/common/linux/install-ffmpeg-linux.sh b/coin/provisioning/common/linux/install-ffmpeg-linux.sh index 583c0b3a..ff70d29b 100755 --- a/coin/provisioning/common/linux/install-ffmpeg-linux.sh +++ b/coin/provisioning/common/linux/install-ffmpeg-linux.sh @@ -3,6 +3,10 @@ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only # This script builds and installs FFmpeg static or shared (default) libs +# It can take an optional output parameter for installation: +# +# install-ffmpeg-linx.sh shared ~/my/install/path + set -ex source "${BASH_SOURCE%/*}/../unix/ffmpeg-installation-utils.sh" @@ -12,7 +16,8 @@ build_type=$(get_ffmpeg_build_type "$1") ffmpeg_source_dir=$(download_ffmpeg) ffmpeg_name=$(basename "$ffmpeg_source_dir") ffmpeg_config_options=$(get_ffmpeg_config_options "$build_type") -prefix="/usr/local/$ffmpeg_name" +default_prefix="/usr/local/$ffmpeg_name" +prefix="${2:-$default_prefix}" pkgconfig_path="$PKG_CONFIG_PATH" install_ff_nvcodec_headers() { @@ -95,5 +100,6 @@ if [ "$build_type" == "shared" ]; then "$fix_dependencies" "$output_dir" fi -sudo mv "$output_dir" "/usr/local" +sudo mkdir -p "$prefix" +sudo mv "$output_dir"/* "$prefix" set_ffmpeg_dir_env_var "FFMPEG_DIR" "$prefix"