| 1 | name: Set up the Linux build |
| 2 | description: >- |
| 3 | Build dependencies plus clang 21. webrtc-sys compiles its C++ against the |
| 4 | hermetic libc++ inside the libwebrtc artifact, which needs a clang as new as |
| 5 | that libc++ (clang 21 today, see check_clang_version in |
| 6 | vendor/webrtc-sys/build.rs); the distro clang is older (18 on ubuntu-24.04). |
| 7 | The caller must point CC, CXX and the rustc linker at clang-21 (see the linux |
| 8 | jobs in .github/workflows). |
| 9 | runs: |
| 10 | using: composite |
| 11 | steps: |
| 12 | - name: Install build dependencies |
| 13 | shell: bash |
| 14 | run: | |
| 15 | # README: "Linux build needs clang + mold (set in .cargo/config.toml)". |
| 16 | # The rest are headers the calling stack probes at build time: glib for webrtc-sys, |
| 17 | # alsa for cpal, v4l2 for nokhwa (bindgen wants libclang), xkbcommon and fontconfig |
| 18 | # for GPUI (font lookup via yeslogic-fontconfig-sys), |
| 19 | # libva enables the hardware video codecs of webrtc-sys. |
| 20 | sudo apt-get update |
| 21 | sudo apt-get install --no-install-recommends -y \ |
| 22 | clang mold pkg-config libclang-dev \ |
| 23 | libglib2.0-dev libfontconfig-dev libasound2-dev libva-dev \ |
| 24 | libxkbcommon-dev libxkbcommon-x11-dev \ |
| 25 | libx11-dev libxcb1-dev libxext-dev libxfixes-dev libxdamage-dev \ |
| 26 | libxrandr-dev libxcomposite-dev libwayland-dev libpipewire-0.3-dev |
| 27 | |
| 28 | # apt.llvm.org's llvm.sh adds their apt repo and installs clang-21 (lld-21 |
| 29 | # and friends alongside). The distro clang above stays: it carries |
| 30 | # libclang-dev, which bindgen loads for nokhwa, and mold is the linker. |
| 31 | curl -fsSL https://apt.llvm.org/llvm.sh -o "$RUNNER_TEMP/llvm.sh" |
| 32 | sudo bash "$RUNNER_TEMP/llvm.sh" 21 |
| 33 | sudo apt-get install --no-install-recommends -y clang-21 |