Repository navigation
build: Support using system Wayland protocol XML files (wayland, wayland-protocols, plasma-wayland-protocols)
#15227
Unanswered
jmr
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Issue Description
When building Ghostty for Linux distribution packaging (e.g. Debian) with
--system,src/build/SharedDeps.zigunconditionally resolves thewayland,wayland_protocols, andplasma_wayland_protocolsdependencies frombuild.zig.zonviab.lazyDependency:Because these
b.lazyDependencycalls are not gated byb.systemIntegrationOption(...), packagers using--systemstill have to vendor all three upstream source tarballs (wayland,wayland-protocols, andplasma-wayland-protocols) in the offline Zig cache solely for 6 protocol XML files (wayland.xml,xdg-activation-v1.xml,ext-background-effect-v1.xml,server-decoration.xml,slide.xml, andkde-output-order-v1.xml), even when the system packages providing those XML files are already installed.Supporting
b.systemIntegrationOptionfor these (similar tofreetype,harfbuzz,fontconfig,libpng,zlib,oniguruma, etc.) would allow--systembuilds to use the system-installed protocol XML files and omit those three tarballs from the offline cache:waylandandwayland-protocols:zig-wayland'sScanner.createalready supports.wayland_xml = null(which queriespkg-config --variable=pkgdatadir wayland-scanner) and.wayland_protocols = null(which queriespkg-config --variable=pkgdatadir wayland-protocols). Whenb.systemIntegrationOption("wayland", .{})/b.systemIntegrationOption("wayland-protocols", .{})are enabled,SharedDeps.zigcan skipb.lazyDependencyand passnulltoScanner.create.plasma-wayland-protocols: Upstream KDEplasma-wayland-protocolsinstalls the XML files directly into<datadir>/plasma-wayland-protocols/{server-decoration,slide,kde-output-order-v1}.xml(without the git repository'ssrc/protocols/subdirectory prefix) and only ships a CMake config (PlasmaWaylandProtocolsConfig.cmake), not a.pcfile. Whenb.systemIntegrationOption("plasma-wayland-protocols", .{})is enabled,SharedDeps.zigcould skipb.lazyDependency("plasma_wayland_protocols", .{})and read the XML files from<datarootdir>/plasma-wayland-protocols/(e.g. viapkg-config --variable=datarootdir wayland-protocolsor/usr/share/plasma-wayland-protocols).I'm happy to send a PR if this approach sounds reasonable.
Expected Behavior
When building with
--system(or-fsys=wayland,-fsys=wayland-protocols,-fsys=plasma-wayland-protocols),zig builduses the system-installed Wayland protocol XML files and does not require thewayland,wayland_protocols, andplasma_wayland_protocolspackages to be present in the offline Zig package cache.Actual Behavior
src/build/SharedDeps.zigunconditionally callsb.lazyDependencyforwayland,wayland_protocols, andplasma_wayland_protocols, sozig build --system <cache-dir>fails witherror: package not foundif those three packages are omitted from the offline Zig package cache, even when the system Wayland protocol packages are installed.Reproduction Steps
zig build -hand inspectAvailable System Integrations::wayland,wayland-protocols, andplasma-wayland-protocolsare not listed.zig build -fsys=wayland(or-fsys=wayland-protocols,-fsys=plasma-wayland-protocols): fails witherror: system integration name not recognized by configure script: wayland.Ghostty Logs
No response
Ghostty Version
OS Version Information
Debian testing
(Linux only) Display Server
Wayland
(Linux only) Desktop Environment/Window Manager
n/a
Minimal Ghostty Configuration
# NoneAdditional Relevant Configuration
No response
I acknowledge that:
```) on separate lines.All reactions