Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/actions/setup-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ runs:
vcpkg_platform=linux
;;
"macOS")
vcpkg_arch=universal
vcpkg_platform=osx
;;
"Windows")
Expand Down Expand Up @@ -132,9 +131,27 @@ runs:
with:
aqtsource: "git+https://github.com/miurahr/aqtinstall.git@076e1659807d0b362a3ed684d54c2e9c775eb9c7"
version: ${{ inputs.qt-version }}
modules: qtimageformats qtnetworkauth
modules: qtimageformats qtnetworkauth qtshadertools qtspeech qtmultimedia qttasktree
cache: ${{ inputs.build-type == 'Debug' }}

- name: Setup KDE Frameworks 6
if: ${{ inputs.msystem == '' && inputs.qt-major == '6' }}
uses: ./.github/actions/setup-kf6
env:
# The frameworks are cached by the action itself; keep them out of sccache.
CMAKE_C_COMPILER_LAUNCHER: ""
CMAKE_CXX_COMPILER_LAUNCHER: ""
with:
version: 6.31.0
# Always Release: like the old vcpkg triplets, dependencies don't need a debug half.
build-type: Release
linkage: shared
# Windows (MSVC) only: where the DocBook DTD/stylesheets were unpacked, see setup-dependencies/windows.
framework-cmake-args: "${{ env.KF6_KDOCTOOLS_ARGS && format('kdoctools: {0}', env.KF6_KDOCTOOLS_ARGS) || '' }}"
# TODO: set to false once KF6 builds cleanly everywhere. While bringing up a platform,
# this reports every failing framework in one run instead of only the first.
keep-going: true

- name: Setup bundled OpenSSL
uses: ./.github/actions/setup-openssl
with:
Expand Down
14 changes: 11 additions & 3 deletions .github/actions/setup-dependencies/linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ runs:
run: |
sudo apt-get -y update
sudo apt-get -y install \
dpkg-dev \
dpkg-dev build-essential \
ninja-build pkg-config scdoc gamemode-dev \
libxcb-cursor-dev libtomlplusplus-dev libvulkan-dev \
libxcb-cursor-dev libxcb-randr0-dev libxcb-shape0-dev \
libxcb-xfixes0-dev libxcb-xkb-dev libxcb-icccm4-dev \
libxcb-keysyms1-dev libxcb-image0-dev libxcb-render-util0-dev \
libxcb-xinerama0-dev libxcb-sync-dev libtomlplusplus-dev libvulkan-dev \
libgpg-error-dev libassuan-dev libksba-dev \
libnpth0-dev libbotan-3-dev autoconf automake libtool gettext \
autoconf-archive
autoconf-archive cmake gperf zlib1g-dev libbz2-dev liblzma-dev \
libxml2-dev libx11-dev libxcb1-dev libxkbcommon-dev \
libxkbcommon-x11-dev plasma-wayland-protocols libxcb-res0-dev \
libwayland-dev wayland-protocols libwayland-egl1 libx11-dev \
libxfixes-dev docbook docbook-xml docbook-xsl docbook-utils \
xsltproc libxml2-utils libaspell-dev libxslt1-dev

- name: Setup Java
uses: actions/setup-java@v6
Expand Down
10 changes: 8 additions & 2 deletions .github/actions/setup-dependencies/macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ runs:
shell: bash
run: |
brew update
brew install ninja extra-cmake-modules temurin@17 autoconf pkg-config \
autoconf-archive automake libtool
brew install cmake ninja temurin@17 autoconf pkg-config \
autoconf-archive automake libtool gettext libxml2 zlib \
bzip2 xz gperf cmark docbook docbook-xsl cpanminus bison \
libical qrencode libdmtx zxing-cpp zstd

cpanm URI

echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH"

- name: Install Qt5
if: ${{ inputs.qt-major == '5' }}
Expand Down
172 changes: 172 additions & 0 deletions .github/actions/setup-dependencies/windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,135 @@ runs:
if: ${{ inputs.msystem == '' }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"

choco install pkgconfiglite -y --allow-empty-checksums

$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
if (-not $vcpkgRoot) {
$vcpkgRoot = $env:VCPKG_ROOT
}
if (-not $vcpkgRoot) {
throw "VCPKG_INSTALLATION_ROOT/VCPKG_ROOT is not set on this runner."
}

$triplet = if ($env:RUNNER_ARCH -eq "ARM64") {
"arm64-windows"
} else {
"x64-windows"
}

& "$vcpkgRoot\vcpkg.exe" install --classic `
gettext-libintl gperf zlib bzip2 liblzma libxml2 iso-codes cmark libarchive libqrencode libxslt zstd `
libical libdmtx nu-book-zxing-cpp `
"--triplet=$triplet"

if ($LASTEXITCODE -ne 0) {
throw "vcpkg dependency installation failed."
}

$tripletRoot = Join-Path $vcpkgRoot "installed\$triplet"
$toolsRoot = Join-Path $tripletRoot "tools"

$pathEntries = [System.Collections.Generic.HashSet[string]]::new(
[System.StringComparer]::OrdinalIgnoreCase
)

# Executables installed directly in the triplet's bin directory.
$binPath = Join-Path $tripletRoot "bin"
if (Test-Path $binPath) {
[void]$pathEntries.Add($binPath)
}

# vcpkg commonly installs build tools in tools\<port>\.
if (Test-Path $toolsRoot) {
Get-ChildItem -Path $toolsRoot -Directory -Recurse |
ForEach-Object {
$directory = $_.FullName

if (
Get-ChildItem -LiteralPath $directory -File `
-ErrorAction SilentlyContinue |
Where-Object {
$_.Extension -in @(".exe", ".cmd", ".bat", ".com")
} |
Select-Object -First 1
) {
[void]$pathEntries.Add($directory)
}
}

# Also include the tools root itself.
[void]$pathEntries.Add($toolsRoot)
}

foreach ($entry in $pathEntries) {
Add-Content -Path $env:GITHUB_PATH -Value $entry
Write-Host "Added to PATH: $entry"
}

# PATH is not enough: CMake does not look for libraries/headers next to the tools on
# PATH, so zlib, libintl, libical, ... in this tree were reported as "Could NOT find".
# CMAKE_PREFIX_PATH makes find_package/find_library/find_path look into it.
# (The SnoreToast step below extends it and exports the final value.)
Add-Content -Path $env:GITHUB_ENV -Value "VCPKG_TRIPLET_ROOT=$tripletRoot"
Add-Content -Path $env:GITHUB_ENV -Value "CMAKE_PREFIX_PATH=$tripletRoot"
# Some KDE Frameworks find libraries (zstd) only through pkg-config.
Add-Content -Path $env:GITHUB_ENV -Value "PKG_CONFIG_PATH=$(Join-Path $tripletRoot 'lib\pkgconfig')"

# Verify that the next GitHub Actions step can find gperf.
$gperfCandidates = @(
(Join-Path $toolsRoot "gperf\gperf.exe"),
(Join-Path $binPath "gperf.exe")
)

$gperf = Get-Command gperf -ErrorAction SilentlyContinue
if (-not $gperf) {
foreach ($candidate in $gperfCandidates) {
if (Test-Path $candidate) {
$gperf = Get-Item $candidate
break
}
}
}

if ($gperf) {
Write-Host "Found gperf: $($gperf.Source)"
} else {
Write-Warning "gperf.exe was not found in the expected vcpkg locations."
Get-ChildItem -Path $toolsRoot -Filter "gperf.exe" `
-File -Recurse -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host "Found candidate: $($_.FullName)" }
}

# KNotifications on Windows needs either SnoreToast (Windows toast notifications) or
# libcanberra, which does not exist here. KIO, KJobWidgets and KWallet need KNotifications.
- name: Build SnoreToast (MSVC)
if: ${{ inputs.msystem == '' }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"

$depsRoot = Join-Path $env:RUNNER_TEMP "deps"
$src = Join-Path $env:RUNNER_TEMP "snoretoast-src"
$bld = Join-Path $env:RUNNER_TEMP "snoretoast-build"

git clone --depth 1 --branch v0.9.1 https://github.com/KDE/snoretoast.git $src
if ($LASTEXITCODE -ne 0) { throw "cloning snoretoast failed" }

# BUILD_STATIC_RUNTIME=OFF: the frameworks use the dynamic CRT (/MD); a static (/MT)
# library linked into KNotifications would mix the two.
cmake -S $src -B $bld -G Ninja -DCMAKE_BUILD_TYPE=Release `
"-DCMAKE_INSTALL_PREFIX=$depsRoot" -DBUILD_STATIC_RUNTIME=OFF
if ($LASTEXITCODE -ne 0) { throw "configuring snoretoast failed" }
cmake --build $bld
if ($LASTEXITCODE -ne 0) { throw "building snoretoast failed" }
cmake --install $bld
if ($LASTEXITCODE -ne 0) { throw "installing snoretoast failed" }

# Final CMAKE_PREFIX_PATH for the following steps: vcpkg tree + these tools.
Add-Content -Path $env:GITHUB_ENV -Value "CMAKE_PREFIX_PATH=$env:VCPKG_TRIPLET_ROOT;$depsRoot"

- name: Setup MSYS2 (MinGW)
if: ${{ inputs.msystem != '' }}
uses: msys2/setup-msys2@v2
Expand All @@ -50,6 +177,7 @@ runs:
update: true
install: >-
git
gperf
pacboy: >-
toolchain:p
ccache:p
Expand All @@ -60,9 +188,53 @@ runs:
qt${{ inputs.qt-major }}-imageformats:p
qt${{ inputs.qt-major }}-networkauth:p
qt${{ inputs.qt-major }}-tools:p
qt${{ inputs.qt-major }}-declarative:p
gpgme:p
qgpgme:p
gpgmepp:p
gettext:p
zlib:p
bzip2:p
xz:p
libxml2:p
cmark:p
gpgme:p
qrencode:p
libarchive:p
libxslt:p
docbook-xml:p
docbook5-xml:p
docbook-xsl:p
kf6:p

# kdoctools needs the DocBook XML DTD and the DocBook XSL stylesheets. MSVC has no package
# for them, and KDE's CMake modules only search system prefixes, so the locations are handed
# to kdoctools explicitly (see framework-cmake-args in setup-dependencies/action.yml).
- name: Install DocBook (MSVC)
if: ${{ inputs.msystem == '' }}
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$tmp = $env:RUNNER_TEMP

Invoke-WebRequest -Uri "https://www.oasis-open.org/docbook/xml/4.5/docbook-xml-4.5.zip" -OutFile "$tmp\docbook-xml-4.5.zip"
Expand-Archive -Path "$tmp\docbook-xml-4.5.zip" -DestinationPath "C:\dbk45" -Force

Invoke-WebRequest -Uri "https://github.com/docbook/xslt10-stylesheets/releases/download/snapshot%2F2020-06-03/docbook-xsl-snapshot.zip" -OutFile "$tmp\docbook-xsl-snapshot.zip"
Expand-Archive -Path "$tmp\docbook-xsl-snapshot.zip" -DestinationPath "C:\dbksl" -Force

# The stylesheets' root is the directory that contains lib\lib.xsl.
$libXsl = Get-ChildItem -Path "C:\dbksl" -Recurse -Filter "lib.xsl" |
Where-Object { $_.Directory.Name -eq "lib" } | Select-Object -First 1
if (-not $libXsl) { throw "lib\lib.xsl not found in the DocBook XSL archive" }
$xslDir = $libXsl.Directory.Parent.FullName
if (-not (Test-Path "C:\dbk45\docbookx.dtd")) { throw "docbookx.dtd not found in C:\dbk45" }

Add-Content -Path $env:GITHUB_ENV -Value "XML_CATALOG_FILES=C:\dbk45\catalog.xml"
Add-Content -Path $env:GITHUB_ENV -Value "DocBookXML4_ROOT=C:\dbk45"
$kdocArgs = "-DDocBookXML4_DTD_DIR=C:/dbk45 -DDocBookXSL_DIR=$($xslDir -replace '\\','/')"
Add-Content -Path $env:GITHUB_ENV -Value "KF6_KDOCTOOLS_ARGS=$kdocArgs"
Write-Host "kdoctools arguments: $kdocArgs"

- name: List pacman packages (MinGW)
if: ${{ inputs.msystem != '' }}
Expand Down
Loading
Loading