Skip to content

[PoC] qt, depends: Add wayland support without build-time nor fixed run-time deps

Built on PR #29923. Loosely based on PR #22708.

This is a proof-of-concept of using the same methodology as in #29923 to support both Wayland and X11 windowing backends, for the Linux release binary, without any extra build-time nor fixed run-time dependencies. It results in a bitcoin-qt binary that "just works" on systems that have only one of them installed, or both.

Everything (including libEGL) is loaded dynamically at run time if needed.

$ readelf -a src/qt/bitcoin-qt |grep '(NEEDED)'

 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]

(libdl.so.1 also when building with older GLIBC, as for guix)

When launching with WAYLAND_DISPLAY=... (takes priority):

2024-04-25T07:13:54Z Bitcoin Core version v27.99.0-4d5957ddc638-dirty (release build)
2024-04-25T07:13:54Z Qt 5.15.13 (static), plugin=wayland (static)
2024-04-25T07:16:43Z Static plugins:
2024-04-25T07:16:43Z  QXcbIntegrationPlugin, version 331520
2024-04-25T07:16:43Z  QWaylandIntegrationPlugin, version 331520
2024-04-25T07:16:43Z  QWaylandEglClientBufferPlugin, version 331520
2024-04-25T07:16:43Z  QWaylandBradientDecorationPlugin, version 331520
2024-04-25T07:16:43Z  QWaylandXdgShellIntegrationPlugin, version 3315202

When launching with DISPLAY=...:

2024-04-25T07:16:43Z Bitcoin Core version v27.99.0-4d5957ddc638-dirty (release build)
2024-04-25T07:16:43Z Qt 5.15.13 (static), plugin=xcb (static)

Will make this a draft. This is not ready for review: the Qt patch can potentially be cleaned up a lot with regard to generated wayland code. But it works. Please review #29923 instead, which needs to go in first anyway.

Closes #19950.

Co-authored-by: Hennadii Stepanov

Notes

  • If you get an error that a qtwayland-... is missing while running make in depends, remove the depends/sources/.download-stamps/.*qt* files to make sure it re-attempts to download missing files.

Merge request reports

Loading