Page MenuHome

Deps: include libdecor in build deps for Wayland support
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Sep 28 2022, 1:15 PM.

Details

Summary

Bundle libdecor in build deps, so the build-bot can build with libdecor support enabled.

As this is dynamically linked to a system library at runtime, only the header is required at build time so the
compiled library doesn't have to be included.

The resulting official builds will use wayland if wayland and libdecor are found, otherwise X11 will be used.


This patch makes changes necessary to have Blender building with wayland on builder.blender.org.

NOTE: This can be split into 3 commits.
  • 1: include libdecor.
  • 2: include wayland headers (along with wayland-scanner), needed as the headers generated by wayland-scanner are not compatible with the headers from the older wayland. This requires building wayland with libraries, however the resulting libraries are not used (only the headers).
  • 3: change CMake defaults (changes in ./CMakeLists.txt).

Commit message.

Linux: enable WAYLAND by default

Enable the following CMake options:

  • WITH_GHOST_WAYLAND Enable Wayland which is now included as part the bundled dependencies. When the pre-compiled libraries aren't used, only X11 will be enabled.
  • WITH_GHOST_WAYLAND_DYNLOAD So systems without libwayland can fall back to X11.
  • WITH_GHOST_WAYLAND_LIBDECOR To draw window frames on WAYLAND compositors such as gnome-shell which expect client-side decorations (without this the Blender window is borderless).

Given the changes are related and the overall patch is fairly small, I though it would over complicate review to submit this as multiple diff's - but can split them up if that helps.



Related TODO's

  • Update T101403 to include libdecor.

Diff Detail

Repository
rB Blender
Branch
TEMP-WAYLAND-ENABLE (branched from master)
Build Status
Buildable 24020
Build 24020: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Sep 28 2022, 1:15 PM
Campbell Barton (campbellbarton) created this revision.
Campbell Barton (campbellbarton) retitled this revision from Enable wayland to CMake: enable wayland by default on Linux.Sep 28 2022, 1:16 PM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Test inclusion of headers for the buildbot
Campbell Barton (campbellbarton) retitled this revision from CMake: enable wayland by default on Linux to [WIP] CMake: enable wayland by default on Linux.Sep 28 2022, 1:53 PM
  • Enable dynamically linked libdecor
  • Enable libdecor by default
Campbell Barton (campbellbarton) retitled this revision from [WIP] CMake: enable wayland by default on Linux to Build: include libdecor in build deps.Sep 29 2022, 7:17 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) retitled this revision from Build: include libdecor in build deps to Build: include libdecor in build deps for Wayland support.Sep 29 2022, 7:23 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Correct download URL

Tested this in the release environment, and made some updates.

  • Enable wayland libraries, needed to bundle wayland headers.
  • Link to the locally compiled libffi.
Campbell Barton (campbellbarton) retitled this revision from Build: include libdecor in build deps for Wayland support to Deps: include libdecor in build deps for Wayland support.Oct 7 2022, 9:05 AM

As this is dynamically linked, only the header is required at build time so the compiled library doesn't have to be included.

You may want to include "... is dynamically linked to a system library at runtime". Without that insight, Otherwise it's kind of strange to not need the library.

Requires inclusion of libdecor [...] in https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/

make deps just downloads any missing package file automatically, so mentioning that this is a required step is kind of confusing.

As this is dynamically linked, only the header is required at build time so the compiled library doesn't have to be included.

You may want to include "... is dynamically linked to a system library at runtime". Without that insight, Otherwise it's kind of strange to not need the library.

Done.

Requires inclusion of libdecor [...] in https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/

make deps just downloads any missing package file automatically, so mentioning that this is a required step is kind of confusing.

Ah, not required - in the sense Blender will build without it, just mentioning it as something that needs to be done as I assumed the library should be added to: https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/

change CMake defaults

It would help if the commit message (and thus the patch description) would describe which defaults changed, and also why those are changed now.

build_files/build_environment/cmake/wayland.cmake
10–11 ↗(On Diff #56455)

I feel that this can be worded better. How's this?

# Note that passing link args "ffi/lib" should not be needed, but
# `pkgconfig` would incorrectly look in "ffi/lib/../lib64" otherwise.
build_files/build_environment/cmake/wayland_libdecor.cmake
4

I'd be explicit here and refer to it as "the header file".

5

"when found on the system" -- again just for explicitness.

  • Update based on feedback.
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

LGTM. I don't have a Wayland system, so I won't be able to test the result, but at least make deps works fine on my CentOS7 VM.

This revision is now accepted and ready to land.Oct 7 2022, 2:33 PM