Files
faumarayandClaude Sonnet 5.5 97d51fb226 CI and docs: libxkbcommon-x11-dev and libxcb1-dev, which the GPUI front end links
The release binary of voelin-gpui links libxcb.so.1 and libxkbcommon-x11.so.0
(`readelf -d`: libxcb, libxkbcommon, libxkbcommon-x11, libasound, libm, libc)
and opens libwayland-client.so.0, libvulkan.so.1 and libEGL.so.1 by name
(`strings`). The development packages of the first two were in no package
list, so a workspace build on the Ubuntu runner (CI builds every member)
would have failed to link: .github/actions/system-deps, the CI example in
docs/ci.md, docker/linux.Dockerfile ("the same libraries as CI") and the apt
line of docs/building.md name libxkbcommon-x11-dev and libxcb1-dev now, and
building.md and docs/ui.md say what the GPUI front end links and what it
opens by name (an earlier sentence of mine had all of them opened by name).
Not run: no Ubuntu runner or image here; this machine builds with Nix's
libraries, where the headers come from the same projects.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:10:37 +03:00

106 lines
4.7 KiB
YAML

name: System dependencies
description: >
Native libraries and tools the workspace builds against: apt packages on
Linux; NASM, libvpx and dav1d (vcpkg, cached) on Windows, exporting
VPX_LIB_DIR, VPX_INCLUDE_DIR, VPX_VERSION and VPX_STATIC for
libvpx-native-sys and SYSTEM_DEPS_DAV1D_* for dav1d-sys.
inputs:
vpx-triplet:
description: vcpkg triplet for libvpx and dav1d on Windows (static libraries, dynamic CRT like Rust's default)
default: x64-windows-static-md
runs:
using: composite
steps:
- name: apt packages
if: runner.os == 'Linux'
shell: bash
# ALSA (audio devices), fontconfig + xkbcommon (UI), xkbcommon-x11 + xcb (linked
# by the GPUI front end), libvpx + dav1d
# (video codecs), PipeWire + SPA (screen and audio capture), libclang
# (bindgen), Xvfb (X11 tests).
run: |
# Gitea container runners may run as root and need the base build
# tools that GitHub's hosted images already provide.
sudo=()
if [ "$(id -u)" -ne 0 ]; then sudo=(sudo); fi
"${sudo[@]}" apt-get update
"${sudo[@]}" apt-get install -y --no-install-recommends \
build-essential ca-certificates cmake curl git jq pkg-config python3 \
libasound2-dev libfontconfig1-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb1-dev \
libvpx-dev libdav1d-dev libpipewire-0.3-dev libspa-0.2-dev libclang-dev \
xvfb xauth
# aws-lc-sys (WebRTC DTLS through str0m) assembles with NASM on Windows.
- name: NASM
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: vcpkg revision
if: runner.os == 'Windows'
id: vcpkg
shell: pwsh
run: |
"commit=$(git -C "$env:VCPKG_INSTALLATION_ROOT" rev-parse HEAD)" >> $env:GITHUB_OUTPUT
- name: Cache vcpkg packages
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: ${{ runner.temp }}\vcpkg-archives
key: vcpkg-libvpx-dav1d-${{ inputs.vpx-triplet }}-${{ steps.vcpkg.outputs.commit }}
restore-keys: vcpkg-libvpx-dav1d-${{ inputs.vpx-triplet }}-
- name: libvpx
if: runner.os == 'Windows'
shell: pwsh
env:
TRIPLET: ${{ inputs.vpx-triplet }}
VCPKG_BINARY_SOURCES: clear;files,${{ runner.temp }}\vcpkg-archives,readwrite
run: |
$ErrorActionPreference = 'Stop'
$vcpkg = Join-Path $env:VCPKG_INSTALLATION_ROOT 'vcpkg.exe'
New-Item -ItemType Directory -Force (Join-Path $env:RUNNER_TEMP 'vcpkg-archives') | Out-Null
& $vcpkg install "libvpx:$env:TRIPLET" "dav1d:$env:TRIPLET"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# "libvpx:x64-windows-static-md 1.15.2#1 The reference ..."
$line = (& $vcpkg list libvpx | Select-String -Pattern "^libvpx:$env:TRIPLET\s").Line
if (-not $line) { throw "vcpkg list does not show libvpx:$env:TRIPLET" }
$version = (($line -split '\s+')[1] -split '#')[0]
$root = Join-Path $env:VCPKG_INSTALLATION_ROOT "installed\$env:TRIPLET"
$libdir = Join-Path $root 'lib'
# libvpx-native-sys links "vpx"; libvpx's own MSVC build names the
# library vpxmd.lib / vpxmt.lib, so provide vpx.lib if needed.
if (-not (Test-Path (Join-Path $libdir 'vpx.lib'))) {
$lib = Get-ChildItem $libdir -Filter 'vpx*.lib' | Select-Object -First 1
if (-not $lib) { Get-ChildItem $libdir; throw "no vpx library in $libdir" }
$libdir = Join-Path $env:RUNNER_TEMP 'vpx-lib'
New-Item -ItemType Directory -Force $libdir | Out-Null
Copy-Item $lib.FullName (Join-Path $libdir 'vpx.lib')
}
"VPX_LIB_DIR=$libdir" >> $env:GITHUB_ENV
"VPX_INCLUDE_DIR=$(Join-Path $root 'include')" >> $env:GITHUB_ENV
"VPX_VERSION=$version" >> $env:GITHUB_ENV
"VPX_STATIC=1" >> $env:GITHUB_ENV
Write-Host "libvpx $version from $libdir"
# dav1d-sys (AV1 decoding) through system-deps, without pkg-config:
# the static library, linked as dav1d.lib.
$davdir = Join-Path $root 'lib'
if (-not (Test-Path (Join-Path $davdir 'dav1d.lib'))) {
$lib = Get-ChildItem $davdir -Filter '*dav1d*.lib' | Select-Object -First 1
if (-not $lib) { Get-ChildItem $davdir; throw "no dav1d library in $davdir" }
$davdir = Join-Path $env:RUNNER_TEMP 'dav1d-lib'
New-Item -ItemType Directory -Force $davdir | Out-Null
Copy-Item $lib.FullName (Join-Path $davdir 'dav1d.lib')
}
"SYSTEM_DEPS_DAV1D_NO_PKG_CONFIG=1" >> $env:GITHUB_ENV
"SYSTEM_DEPS_DAV1D_SEARCH_NATIVE=$davdir" >> $env:GITHUB_ENV
"SYSTEM_DEPS_DAV1D_LIB=dav1d" >> $env:GITHUB_ENV
"SYSTEM_DEPS_DAV1D_LINK=static" >> $env:GITHUB_ENV
Write-Host "dav1d from $davdir"