From 9769e27856689a7cda815d0e717772197e93dd7e Mon Sep 17 00:00:00 2001 From: "J.D. Purcell" Date: Sun, 2 Feb 2025 17:57:07 -0500 Subject: [PATCH] Update Qt (to 6.8.2) and other dependencies --- .github/workflows/build.yml | 10 ++++----- dist/scripts/download-plugins.ps1 | 27 ++++++++++++------------ dist/scripts/macdeploy.sh | 14 +++++++++---- dist/scripts/windeployqt.ps1 | 35 ++++++++++++++++++------------- 4 files changed, 49 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b75458a0..59cc53e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,20 +26,20 @@ jobs: osSuffix: '_qt5.9' skipPlugins: 'true' - runner: 'macos-14' - qtVersion: '6.7.3' + qtVersion: '6.8.2' qtModules: 'qtimageformats' buildArch: 'Universal' - runner: 'macos-13' qtVersion: '5.15.2' osSuffix: '_legacy' - runner: 'windows-2022' - qtVersion: '6.7.3' - qtArch: 'win64_msvc2019_64' + qtVersion: '6.8.2' + qtArch: 'win64_msvc2022_64' osSuffix: '_64' qtModules: 'qtimageformats' - runner: 'windows-2022' - qtVersion: '6.7.3' - qtArch: 'win64_msvc2019_arm64' + qtVersion: '6.8.2' + qtArch: 'win64_msvc2022_arm64_cross_compiled' osSuffix: '_arm64' qtModules: 'qtimageformats' buildArch: 'Arm64' diff --git a/dist/scripts/download-plugins.ps1 b/dist/scripts/download-plugins.ps1 index 5836dbd1..67ea8f27 100755 --- a/dist/scripts/download-plugins.ps1 +++ b/dist/scripts/download-plugins.ps1 @@ -4,7 +4,7 @@ $pluginNames = "qtapng", "kimageformats" -$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3] +$qtVersion = [version](qmake -query QT_VERSION) Write-Host "Detected Qt Version $qtVersion" # Qt version availability and runner names are assumed. @@ -60,12 +60,13 @@ if ($pluginNames -contains 'qtapng') { } if ($pluginNames -contains 'kimageformats') { + $kfMajorVer = $qtVersion -ge [version]'6.5.0' ? 6 : 5 if ($IsWindows) { mv kimageformats/kimageformats/output/kimg_*.dll "$out_imf/" # Copy karchive - if (Test-Path -Path kimageformats/kimageformats/output/KF5Archive.dll -PathType Leaf) { + if (Test-Path -Path kimageformats/kimageformats/output/KF${kfMajorVer}Archive.dll -PathType Leaf) { cp kimageformats/kimageformats/output/zlib1.dll "$out_frm/" - cp kimageformats/kimageformats/output/KF5Archive.dll "$out_frm/" + cp kimageformats/kimageformats/output/KF${kfMajorVer}Archive.dll "$out_frm/" } # copy avif stuff if (Test-Path -Path kimageformats/kimageformats/output/avif.dll -PathType Leaf) { @@ -85,33 +86,33 @@ if ($pluginNames -contains 'kimageformats') { if (Test-Path -Path kimageformats/kimageformats/output/raw.dll -PathType Leaf) { cp kimageformats/kimageformats/output/zlib1.dll "$out_frm/" cp kimageformats/kimageformats/output/raw.dll "$out_frm/" - cp kimageformats/kimageformats/output/lcms2.dll "$out_frm/" + cp kimageformats/kimageformats/output/lcms2-2.dll "$out_frm/" } # copy jxl stuff if (Test-Path -Path kimageformats/kimageformats/output/jxl.dll -PathType Leaf) { cp kimageformats/kimageformats/output/jxl.dll "$out_frm/" cp kimageformats/kimageformats/output/jxl_cms.dll "$out_frm/" cp kimageformats/kimageformats/output/jxl_threads.dll "$out_frm/" - cp kimageformats/kimageformats/output/lcms2.dll "$out_frm/" + cp kimageformats/kimageformats/output/lcms2-2.dll "$out_frm/" cp kimageformats/kimageformats/output/hwy.dll "$out_frm/" cp kimageformats/kimageformats/output/brotlicommon.dll "$out_frm/" cp kimageformats/kimageformats/output/brotlidec.dll "$out_frm/" cp kimageformats/kimageformats/output/brotlienc.dll "$out_frm/" } # copy openexr stuff - if (Test-Path -Path kimageformats/kimageformats/output/OpenEXR-3_2.dll -PathType Leaf) { + if (Test-Path -Path kimageformats/kimageformats/output/OpenEXR-3_3.dll -PathType Leaf) { cp kimageformats/kimageformats/output/deflate.dll "$out_frm/" - cp kimageformats/kimageformats/output/OpenEXR-3_2.dll "$out_frm/" - cp kimageformats/kimageformats/output/OpenEXRCore-3_2.dll "$out_frm/" + cp kimageformats/kimageformats/output/OpenEXR-3_3.dll "$out_frm/" + cp kimageformats/kimageformats/output/OpenEXRCore-3_3.dll "$out_frm/" cp kimageformats/kimageformats/output/Imath-3_1.dll "$out_frm/" - cp kimageformats/kimageformats/output/IlmThread-3_2.dll "$out_frm/" - cp kimageformats/kimageformats/output/Iex-3_2.dll "$out_frm/" + cp kimageformats/kimageformats/output/IlmThread-3_3.dll "$out_frm/" + cp kimageformats/kimageformats/output/Iex-3_3.dll "$out_frm/" } } elseif ($IsMacOS) { - cp kimageformats/kimageformats/output/*.so "$out_imf/" - cp kimageformats/kimageformats/output/libKF5Archive.5.dylib "$out_frm/" + cp kimageformats/kimageformats/output/kimg_*.* "$out_imf/" + cp kimageformats/kimageformats/output/libKF?Archive.?.dylib "$out_frm/" } else { cp kimageformats/kimageformats/output/kimg_*.so "$out_imf/" - cp kimageformats/kimageformats/output/libKF5Archive.so.5 "$out_frm/" + cp kimageformats/kimageformats/output/libKF?Archive.so.? "$out_frm/" } } diff --git a/dist/scripts/macdeploy.sh b/dist/scripts/macdeploy.sh index c349ac01..07589871 100755 --- a/dist/scripts/macdeploy.sh +++ b/dist/scripts/macdeploy.sh @@ -30,18 +30,24 @@ cd bin echo "Running macdeployqt" macdeployqt qView.app -if [[ -f "qView.app/Contents/PlugIns/imageformats/kimg_heif.so" && -f "qView.app/Contents/PlugIns/imageformats/libqmacheif.dylib" ]]; then +IMF_DIR=qView.app/Contents/PlugIns/imageformats +if [[ (-f "$IMF_DIR/kimg_heif.dylib" || -f "$IMF_DIR/kimg_heif.so") && -f "$IMF_DIR/libqmacheif.dylib" ]]; then # Prefer kimageformats HEIF plugin for proper color space handling echo "Removing duplicate HEIF plugin" - rm "qView.app/Contents/PlugIns/imageformats/libqmacheif.dylib" + rm "$IMF_DIR/libqmacheif.dylib" +fi +if [[ (-f "$IMF_DIR/kimg_tga.dylib" || -f "$IMF_DIR/kimg_tga.so") && -f "$IMF_DIR/libqtga.dylib" ]]; then + # Prefer kimageformats TGA plugin which supports more formats + echo "Removing duplicate TGA plugin" + rm "$IMF_DIR/libqtga.dylib" fi echo "Running codesign" if [[ "$APPLE_NOTARIZE_REQUESTED" == "true" ]]; then APP_IDENTIFIER=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "qView.app/Contents/Info.plist") - codesign --sign "$CODESIGN_CERT_NAME" --deep --options runtime --timestamp "qView.app" + codesign --sign "$CODESIGN_CERT_NAME" --deep --force --options runtime --timestamp "qView.app" else - codesign --sign "$CODESIGN_CERT_NAME" --deep "qView.app" + codesign --sign "$CODESIGN_CERT_NAME" --deep --force "qView.app" fi echo "Creating disk image" diff --git a/dist/scripts/windeployqt.ps1 b/dist/scripts/windeployqt.ps1 index 8f659b20..e7427cd9 100755 --- a/dist/scripts/windeployqt.ps1 +++ b/dist/scripts/windeployqt.ps1 @@ -3,17 +3,17 @@ param $NightlyVersion = "" ) -$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3] +$qtVersion = [version](qmake -query QT_VERSION) Write-Host "Detected Qt Version $qtVersion" if ($env:buildArch -ne 'Arm64') { # Download and extract openssl - if ($qtVersion.Major -le 5) { + if ($qtVersion -lt [version]'6.5') { $openSslDownloadUrl = "https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-1.1.1w.zip" $openSslSubfolder = "openssl-1.1\" $openSslFilenameVersion = "1_1" } else { - $openSslDownloadUrl = "https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.3.2.zip" + $openSslDownloadUrl = "https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.4.0.zip" $openSslSubfolder = "" $openSslFilenameVersion = "3" } @@ -22,23 +22,28 @@ if ($env:buildArch -ne 'Arm64') { Invoke-WebRequest -Uri $openSslDownloadUrl -OutFile openssl.zip 7z x -y openssl.zip -o"openssl" - # Install approprate binaries for architecture + # Install appropriate binaries for architecture if ($env:buildArch -eq 'X86') { - copy openssl\$openSslSubfolder\x86\bin\libssl-$openSslFilenameVersion.dll bin\ - copy openssl\$openSslSubfolder\x86\bin\libcrypto-$openSslFilenameVersion.dll bin\ + copy "openssl\${openSslSubfolder}x86\bin\libssl-$openSslFilenameVersion.dll" bin + copy "openssl\${openSslSubfolder}x86\bin\libcrypto-$openSslFilenameVersion.dll" bin } else { - copy openssl\$openSslSubfolder\x64\bin\libssl-$openSslFilenameVersion-x64.dll bin\ - copy openssl\$openSslSubfolder\x64\bin\libcrypto-$openSslFilenameVersion-x64.dll bin\ + copy "openssl\${openSslSubfolder}x64\bin\libssl-$openSslFilenameVersion-x64.dll" bin + copy "openssl\${openSslSubfolder}x64\bin\libcrypto-$openSslFilenameVersion-x64.dll" bin } } -if ($env:buildArch -eq 'Arm64') { - # Run windeployqt in cross-compilation mode - $qtHostPath = [System.IO.Path]::GetFullPath("$env:QT_ROOT_DIR\..\$((Split-Path -Path $env:QT_ROOT_DIR -Leaf) -replace '_arm64', '_64')") - & "$qtHostPath\bin\windeployqt" "--qmake=$env:QT_ROOT_DIR\bin\qmake.bat" --no-compiler-runtime bin\qView.exe -} else { - # Run windeployqt which should be in path - windeployqt --no-compiler-runtime bin/qView.exe +# Run windeployqt +$isCrossCompile = $env:buildArch -eq 'Arm64' +$winDeployQt = $isCrossCompile ? "$(qmake -query QT_HOST_PREFIX)\bin\windeployqt" : "windeployqt" +$argQtPaths = $isCrossCompile ? "--qtpaths=$env:QT_ROOT_DIR\bin\qtpaths.bat" : $null +$argForceOpenSsl = $qtVersion -ge [version]'6.8' ? "--force-openssl" : $null +& $winDeployQt $argQtPaths $argForceOpenSsl --no-compiler-runtime "bin\qView.exe" + +$imfDir = "bin\imageformats" +if ((Test-Path "$imfDir\kimg_tga.dll") -and (Test-Path "$imfDir\qtga.dll")) { + # Prefer kimageformats TGA plugin which supports more formats + Write-Output "Removing duplicate TGA plugin" + Remove-Item "$imfDir\qtga.dll" } if ($NightlyVersion -eq '') {