Skip to content

Commit

Permalink
Merge pull request #6 from jdpurcell/pr-update673
Browse files Browse the repository at this point in the history
Qt 6.7.3 and other updates
  • Loading branch information
jurplel authored Oct 13, 2024
2 parents 3991581 + cac339e commit 6ec60d6
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 64 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/QtApng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,21 @@ jobs:
include:
- os: ubuntu-20.04
vers: '5.15.2'
- os: macos-12
- os: macos-13
vers: '5.15.2'
- os: windows-2022
vers: '5.15.2'
arch: 'win32_msvc2019'
buildArch: 'X86'
- os: windows-2022
vers: '6.2.2'
arch: 'win64_msvc2019_64'
- os: macos-12
vers: '6.2.2'
buildArch: 'Universal'
- os: windows-2022
vers: '6.5.3'
vers: '6.7.3'
arch: 'win64_msvc2019_64'
- os: windows-2022
vers: '6.5.3'
vers: '6.7.3'
arch: 'win64_msvc2019_arm64'
buildArch: 'Arm64'
- os: macos-12
vers: '6.5.3'
- os: macos-14
vers: '6.7.3'
buildArch: 'Universal'

steps:
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/kimageformats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,21 @@ jobs:
include:
- os: ubuntu-20.04
vers: '5.15.2'
- os: macos-12
- os: macos-13
vers: '5.15.2'
- os: windows-2022
vers: '5.15.2'
arch: 'win32_msvc2019'
buildArch: 'X86'
- os: windows-2022
vers: '6.2.2'
arch: 'win64_msvc2019_64'
- os: macos-12
vers: '6.2.2'
buildArch: 'Universal'
- os: windows-2022
vers: '6.5.3'
vers: '6.7.3'
arch: 'win64_msvc2019_64'
- os: windows-2022
vers: '6.5.3'
vers: '6.7.3'
arch: 'win64_msvc2019_arm64'
buildArch: 'Arm64'
- os: macos-12
vers: '6.5.3'
- os: macos-14
vers: '6.7.3'
buildArch: 'Universal'

steps:
Expand All @@ -51,7 +45,7 @@ jobs:
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: '7eb700c9688daed6d8bdcdc571ebe3eedea6a774'
vcpkgGitCommitId: '9558037875497b9db8cf38fcd7db68ec661bffe7'

- name: Build KImageFormats (just one big step for now)
run: pwsh pwsh/buildkimageformats.ps1
Expand Down
16 changes: 12 additions & 4 deletions pwsh/buildapng.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env pwsh

$qtVersion = ((qmake --version -split '\n')[1] -split ' ')[3]
$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3]
Write-Host "Detected Qt Version $qtVersion"

# Clone
git clone https://github.com/jurplel/QtApng.git
Expand All @@ -22,17 +23,24 @@ if ($IsWindows) {
} elseif ($IsMacOS) {
brew update
brew install ninja

if ($qtVersion -lt [version]'6.5.3') {
# Workaround for QTBUG-117484
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
}
} else {
sudo apt-get install ninja-build
}

$argQt6 = $qtVersion.Major -ne 6 ? '-DAPNG_QT6=OFF' : $null
$argDeviceArchs = $IsMacOS -and $env:buildArch -eq 'Universal' ? '-DCMAKE_OSX_ARCHITECTURES=x86_64' : $null

# Build
$argApngQt6 = $qtVersion -like '5.*' ? "-DAPNG_QT6=OFF" : $null
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release $argApngQt6
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release $argQt6 $argDeviceArchs
ninja -C build

if ($IsMacOS -and $env:buildArch -eq 'Universal') {
cmake -B build_arm64 -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64
cmake -B build_arm64 -G Ninja -DCMAKE_BUILD_TYPE=Release $argQt6 -DCMAKE_OSX_ARCHITECTURES=arm64
ninja -C build_arm64
}

Expand Down
8 changes: 3 additions & 5 deletions pwsh/buildecm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ if ($IsWindows) {
& "$env:GITHUB_WORKSPACE/pwsh/vcvars.ps1"
}

$argDeviceArchs = $IsMacOS -and $env:buildArch -eq 'Universal' ? '-DCMAKE_OSX_ARCHITECTURES=x86_64;arm64' : $null

# Build
if ($IsMacOS -and $env:buildArch -eq 'Universal') {
cmake -G Ninja . -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
} else {
cmake -G Ninja .
}
cmake -G Ninja . $argDeviceArchs

if ($IsWindows) {
ninja install
Expand Down
15 changes: 8 additions & 7 deletions pwsh/buildkarchive.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env pwsh

$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3]

# Clone
git clone https://invent.kde.org/frameworks/karchive.git
cd karchive
Expand All @@ -12,18 +14,17 @@ if ($IsWindows) {
& "$env:GITHUB_WORKSPACE\pwsh\vcvars.ps1"
}

# don't use homebrew zlib/zstd
if ($IsMacOS) {
brew uninstall --ignore-dependencies zlib
# Uninstall this because there's only one architecture installed, which
# prevents the other architecture of the universal binary from building
brew uninstall --ignore-dependencies zstd
}

if ((qmake --version -split '\n')[1][17] -eq '6') {
$qt6flag = "-DBUILD_WITH_QT6=ON"
}
$argQt6 = $qtVersion.Major -eq 6 ? '-DBUILD_WITH_QT6=ON' : $null
$argDeviceArchs = $IsMacOS -and $env:buildArch -eq 'Universal' ? '-DCMAKE_OSX_ARCHITECTURES=x86_64' : $null

# Build
cmake -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD/installed/" -DCMAKE_BUILD_TYPE=Release $qt6flag -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" .
cmake -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD/installed/" -DCMAKE_BUILD_TYPE=Release $argQt6 $argDeviceArchs -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" .

ninja
ninja install
Expand All @@ -35,7 +36,7 @@ if ($IsMacOS -and $env:buildArch -eq 'Universal') {
rm -rf CMakeFiles/
rm -rf CMakeCache.txt

cmake -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD/installed_arm64/" -DCMAKE_BUILD_TYPE=Release $qt6flag -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="arm64-osx" .
cmake -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD/installed_arm64/" -DCMAKE_BUILD_TYPE=Release $argQt6 -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="arm64-osx" .

ninja
ninja install
Expand Down
19 changes: 13 additions & 6 deletions pwsh/buildkimageformats.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env pwsh

$qtVersion = [version]((qmake --version -split '\n')[1] -split ' ')[3]
Write-Host "Detected Qt Version $qtVersion"

$kde_vers = 'v5.116.0'

# Clone
Expand Down Expand Up @@ -28,6 +31,11 @@ if ($IsWindows) {
} elseif ($IsMacOS) {
brew update
brew install ninja

if ($qtVersion -lt [version]'6.5.3') {
# Workaround for QTBUG-117484
sudo xcode-select --switch /Applications/Xcode_14.3.1.app
}
} else {
sudo apt-get install ninja-build
}
Expand All @@ -37,17 +45,16 @@ if ($IsWindows) {
& "$env:GITHUB_WORKSPACE/pwsh/get-vcpkg-deps.ps1"
& "$env:GITHUB_WORKSPACE/pwsh/buildkarchive.ps1" $kde_vers

if ((qmake --version -split '\n')[1][17] -eq '6') {
$qt6flag = "-DBUILD_WITH_QT6=ON"
}

# Resolve pthread error on linux
if (-Not $IsWindows) {
$env:CXXFLAGS += ' -pthread'
}

$argQt6 = $qtVersion.Major -eq 6 ? '-DBUILD_WITH_QT6=ON' : $null
$argDeviceArchs = $IsMacOS -and $env:buildArch -eq 'Universal' ? '-DCMAKE_OSX_ARCHITECTURES=x86_64' : $null

# Build kimageformats
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/installed" -DKIMAGEFORMATS_JXL=ON -DKIMAGEFORMATS_HEIF=ON $qt6flag -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" .
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/installed" -DKIMAGEFORMATS_JXL=ON -DKIMAGEFORMATS_HEIF=ON $argQt6 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" $argDeviceArchs .

ninja
ninja install
Expand All @@ -67,7 +74,7 @@ if ($IsMacOS -and $env:buildArch -eq 'Universal') {

$env:KF5Archive_DIR = $env:KF5Archive_DIR_ARM

cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/installed_arm64" -DKIMAGEFORMATS_JXL=ON -DKIMAGEFORMATS_HEIF=ON $qt6flag -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="arm64-osx" -DCMAKE_OSX_ARCHITECTURES="arm64" .
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/installed_arm64" -DKIMAGEFORMATS_JXL=ON -DKIMAGEFORMATS_HEIF=ON $argQt6 -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="arm64-osx" -DCMAKE_OSX_ARCHITECTURES="arm64" .

ninja
ninja install
Expand Down
29 changes: 18 additions & 11 deletions pwsh/get-vcpkg-deps.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env pwsh

using namespace System.Runtime.InteropServices

# Install vcpkg if we don't already have it
if ($env:VCPKG_ROOT -eq $null) {
git clone https://github.com/microsoft/vcpkg
Expand All @@ -19,28 +21,36 @@ if ($IsWindows) {
choco install nasm
} elseif ($IsMacOS) {
brew install nasm
# Remove this package on macOS because it caues problems
brew uninstall --ignore-dependencies webp # Avoid linking to homebrew stuff later
} else {
# (and bonus dependencies)
sudo apt-get install nasm libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
}

# Set default triplet
$hostArch = [RuntimeInformation]::OSArchitecture
if ($IsWindows) {
# Use environment variable to detect target platform
$env:VCPKG_DEFAULT_TRIPLET =
$env:buildArch -eq 'X86' ? 'x86-windows' :
$env:buildArch -eq 'Arm64' ? 'arm64-windows' :
'x64-windows'
$hostArch -eq [Architecture]::X64 ? 'x64-windows' :
$null
} elseif ($IsMacOS) {
# Build x64 first; arm64 will come later for universal binaries
$env:VCPKG_DEFAULT_TRIPLET = "x64-osx"
# For universal binaries, build x64 first; arm64 will come later
$env:VCPKG_DEFAULT_TRIPLET =
$env:buildArch -eq 'Universal' ? 'x64-osx' :
$hostArch -eq [Architecture]::X64 ? 'x64-osx' :
$hostArch -eq [Architecture]::Arm64 ? 'arm64-osx' :
$null
} elseif ($IsLinux) {
$env:VCPKG_DEFAULT_TRIPLET = "x64-linux"
$env:VCPKG_DEFAULT_TRIPLET =
$hostArch -eq [Architecture]::X64 ? 'x64-linux' :
$null
} else {
throw 'Unsupported platform.'
}
if (-not $env:VCPKG_DEFAULT_TRIPLET) {
throw 'Unsupported architecture.'
}

# Get our dependencies using vcpkg!
if ($IsWindows) {
Expand Down Expand Up @@ -80,10 +90,7 @@ function WriteOverlayTriplet() {
function InstallPackages() {
WriteOverlayTriplet

# libheif: Skip x265 on arm64-windows as it doesn't build (only needed for encoding)
$libheif = $env:VCPKG_DEFAULT_TRIPLET -eq 'arm64-windows' ? 'libheif[core]' : 'libheif'

& "$env:VCPKG_ROOT/$vcpkgexec" install libjxl libavif[aom] $libheif openexr zlib libraw
& "$env:VCPKG_ROOT/$vcpkgexec" install libjxl libavif[aom] libheif openexr zlib libraw
}

# Build for main triplet
Expand Down
13 changes: 5 additions & 8 deletions util/kimageformats-find-libraw-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
--- kimageformats/CMakeLists.txt 2023-08-05 16:14:58
+++ CMakeLists.txt 2023-08-05 16:14:49
@@ -74,11 +74,15 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,11 +74,13 @@
add_feature_info(LibJXL LibJXL_FOUND "required for the QImage plugin for JPEG XL images")

# note: module FindLibRaw missing from https://invent.kde.org/frameworks/extra-cmake-modules
-find_package(LibRaw 0.20.2)
-set_package_properties(LibRaw PROPERTIES
+find_package(libraw CONFIG)
+get_property(importTargetsAfter DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
+set_package_properties(libraw PROPERTIES
+find_package(LibRaw 0.20.2 NAMES libraw)
set_package_properties(LibRaw PROPERTIES
TYPE OPTIONAL
PURPOSE "Required for the QImage plugin for RAW images"
)
+# Adapt naming so the rest of the cmake infra finds this new target
+add_library(LibRaw::LibRaw ALIAS libraw::raw)
+set(LibRaw_FOUND ${libraw_FOUND})

ecm_set_disabled_deprecation_versions(
QT 5.15.2

0 comments on commit 6ec60d6

Please sign in to comment.