mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-19 11:36:12 +08:00
Compare commits
3 Commits
a1e154912b
...
ffc15eb35f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffc15eb35f | ||
|
|
61046109cf | ||
|
|
7f416abf32 |
@@ -31,6 +31,12 @@ if ! command -v patchelf; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get patchelf version
|
||||
patchelf_version=$(patchelf --version 2>/dev/null | awk '{print $2}')
|
||||
if [[ "$patchelf_version" == "0.18.0" ]]; then
|
||||
echo "WARNING: patchelf version 0.18.0 is known to have issues with Android." >&2
|
||||
fi
|
||||
|
||||
ffmpeg_libs=("avcodec" "avdevice" "avfilter" "avformat" "avutil" "swresample" "swscale")
|
||||
stub_prefix="Qt6FFmpegStub-"
|
||||
|
||||
|
||||
@@ -146,19 +146,19 @@ fi
|
||||
|
||||
assert_envvar_is_populated_dir "ANDROID_NDK_ROOT_LATEST"
|
||||
assert_envvar_is_populated_dir "OPENSSL_ANDROID_HOME_LATEST"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir" "$ANDROID_NDK_ROOT_LATEST" "$OPENSSL_ANDROID_HOME_LATEST"
|
||||
set_ffmpeg_dir_env_var "$envvar_latest" "$target_dir"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir/latest" "$ANDROID_NDK_ROOT_LATEST" "$OPENSSL_ANDROID_HOME_LATEST"
|
||||
set_ffmpeg_dir_env_var "$envvar_latest" "$target_dir/latest"
|
||||
|
||||
if [ "${ANDROID_NDK_ROOT_NIGHTLY1}" ]; then
|
||||
assert_envvar_is_populated_dir "ANDROID_NDK_ROOT_NIGHTLY1"
|
||||
assert_envvar_is_populated_dir "OPENSSL_ANDROID_HOME_NIGHTLY1"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir" "$ANDROID_NDK_ROOT_NIGHTLY1" "$OPENSSL_ANDROID_HOME_NIGHTLY1"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir/nightly1" "$ANDROID_NDK_ROOT_NIGHTLY1" "$OPENSSL_ANDROID_HOME_NIGHTLY1"
|
||||
set_ffmpeg_dir_env_var "$envvar_nightly1" "$target_dir/nightly1"
|
||||
fi
|
||||
|
||||
if [ "${ANDROID_NDK_ROOT_NIGHTLY2}" ]; then
|
||||
assert_envvar_is_populated_dir "ANDROID_NDK_ROOT_NIGHTLY2"
|
||||
assert_envvar_is_populated_dir "OPENSSL_ANDROID_HOME_NIGHTLY2"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir" "$ANDROID_NDK_ROOT_NIGHTLY2" "$OPENSSL_ANDROID_HOME_NIGHTLY2"
|
||||
build_ffmpeg_android "$target_arch" "$target_dir/nightly2" "$ANDROID_NDK_ROOT_NIGHTLY2" "$OPENSSL_ANDROID_HOME_NIGHTLY2"
|
||||
set_ffmpeg_dir_env_var "$envvar_nightly2" "$target_dir/nightly2"
|
||||
fi
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh"
|
||||
# version 0.18.0 doesn't work correctly for Android binaries, so we use 0.17.2
|
||||
# See patchelf bugreport: https://github.com/NixOS/patchelf/issues/576.
|
||||
patchelf_version="0.17.2"
|
||||
|
||||
url_cached="https://ci-files01-hki.ci.qt.io/input/android/patchelf/$patchelf_version.tar.gz"
|
||||
|
||||
@@ -30,6 +30,52 @@ function GetFfmpegDefaultConfiguration {
|
||||
return $defaultConfiguration
|
||||
}
|
||||
|
||||
# Returns the absolute installation path of FFmpeg for this build
|
||||
# variant.
|
||||
function ResolveFFmpegInstallDir {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$buildSystem,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ndkVer
|
||||
)
|
||||
|
||||
if ($ndkVer) {
|
||||
$prefix = "installed-ndk-$ndkVer"
|
||||
} else {
|
||||
$prefix = "installed"
|
||||
}
|
||||
|
||||
return "C:\$ffmpeg_name\build\$buildSystem\$prefix"
|
||||
}
|
||||
|
||||
# Returns the absolute installation path of FFmpeg for this build
|
||||
# variant. Returns a path that is compatible with MSYS.
|
||||
#
|
||||
# TODO: There is some code duplications here. Make a helper function
|
||||
# that translates native Windows paths into MSYS compatible paths.
|
||||
function ResolveFFmpegInstallDirMsys {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$buildSystem,
|
||||
|
||||
[Parameter(Mandatory = $false)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ndkVer
|
||||
)
|
||||
if ($ndkVer) {
|
||||
$prefix = "installed-ndk-$ndkVer"
|
||||
} else {
|
||||
$prefix = "installed"
|
||||
}
|
||||
|
||||
return "/c/$ffmpeg_name/build/$buildSystem/$prefix"
|
||||
}
|
||||
|
||||
function InstallFfmpeg {
|
||||
Param (
|
||||
[string]$config,
|
||||
@@ -53,15 +99,16 @@ function InstallFfmpeg {
|
||||
$env:MSYSTEM = $msystem
|
||||
|
||||
if ($ndk_ver) {
|
||||
$prefix = "installed-ndk-$ndk_ver"
|
||||
$installDir = ResolveFFmpegInstallDir -buildSystem $buildSystem -ndkVer $ndk_ver
|
||||
$installDirForMsys = ResolveFFmpegInstallDirMsys -buildSystem $buildSystem -ndkVer $ndk_ver
|
||||
} else {
|
||||
$prefix = "installed"
|
||||
$installDir = ResolveFFmpegInstallDir -buildSystem $buildSystem
|
||||
$installDirForMsys = ResolveFFmpegInstallDirMsys -buildSystem $buildSystem
|
||||
}
|
||||
$installDir = "C:\$ffmpeg_name\build\$buildSystem\$prefix"
|
||||
|
||||
$cmd = "cd /c/$ffmpeg_name"
|
||||
$cmd += " && mkdir -p build/$buildSystem && cd build/$buildSystem"
|
||||
$cmd += " && ../../configure --prefix=$prefix $config"
|
||||
$cmd += " && ../../configure --prefix=$installDirForMsys $config"
|
||||
if ($toolchain) {
|
||||
$cmd += " --toolchain=$toolchain"
|
||||
}
|
||||
@@ -191,8 +238,8 @@ function InstallAndroidArmv7 {
|
||||
$config += " --extra-cflags=-I${openssl_path}/include --extra-ldflags=-L${openssl_path}/armeabi-v7a"
|
||||
$config += " --strip=$strip"
|
||||
|
||||
|
||||
$result= InstallFfmpeg -config $config -buildSystem "android-arm" -msystem "ANDROID_CLANG" -ffmpegDirEnvVar $ffmpeg_dir_android_envvar_name -shared $shared -ndk_ver $ndk_version
|
||||
$buildSystem = "android-arm"
|
||||
$result= InstallFfmpeg -config $config -buildSystem $buildSystem -msystem "ANDROID_CLANG" -ffmpegDirEnvVar $ffmpeg_dir_android_envvar_name -shared $shared -ndk_ver $ndk_version
|
||||
|
||||
Remove-Item -Path ${openssl_path}/armeabi-v7a/libcrypto.so
|
||||
Remove-Item -Path ${openssl_path}/armeabi-v7a/libssl.so
|
||||
@@ -218,9 +265,14 @@ function InstallAndroidArmv7 {
|
||||
|
||||
Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath $msys -ArgumentList ("-lc", "`"cd C:/patchelf-0.17.2 && ./bootstrap.sh && ./configure && make install`"")
|
||||
|
||||
$command = "${PSScriptRoot}/../shared/fix_ffmpeg_dependencies.sh C:/${ffmpeg_name}/build/android-arm/installed/ _armeabi-v7a no"
|
||||
$installDirForMsys = ResolveFFmpegInstallDirMsys -buildSystem $buildSystem -ndkVer $ndk_version
|
||||
$command = "${PSScriptRoot}/../shared/fix_ffmpeg_dependencies.sh ${installDirForMsys} _armeabi-v7a no"
|
||||
$command = $command.Replace("\", "/")
|
||||
Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath $msys -ArgumentList ("-lc", "`"$command`"")
|
||||
$patchResult = Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath $msys -ArgumentList ("-lc", "`"$command`"")
|
||||
if ($patchResult.ExitCode) {
|
||||
Write-Host "fix_ffmpeg_dependencies.sh did not finish successfully"
|
||||
return $false
|
||||
}
|
||||
|
||||
return $result
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
set -ex
|
||||
|
||||
brew install patchelf
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-patchelf.sh"
|
||||
|
||||
Reference in New Issue
Block a user