Libdecor on Clear Linux*, for Blender 3.4.1 and newer

I have been trying to get libdecor to compile on Clear Linux*, as Blender 3.4.1 requires it to be able to work under Wayland, otherwise it falls back to X11.

I used the following in the Terminal, as per their instructions:

cd /tmp
git clone https://gitlab.freedesktop.org/libdecor/libdecor
cd libdecor
meson build --buildtype release

However I get the following feedback with an error:

**The Meson build system**
Version: 1.0.0
Source dir: /tmp/libdecor
Build dir: /tmp/libdecor/build
Build type: native build
Project name: libdecor
Project version: 0.1.0
C compiler for the host machine: gcc (gcc 12.2.1 "gcc (Clear Linux OS for Intel Architecture) 12.2.1 20230105 releases/gcc-12.2.0-333-gebb1f6d14c")
C linker for the host machine: gcc ld.bfd 2.39.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-parameter: YES 
Compiler for C supports arguments -Wno-missing-field-initializers: YES 
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency wayland-client found: YES 1.21.0
Run-time dependency wayland-protocols found: YES 1.31
Library dl found: YES
Run-time dependency dbus-1 found: YES 1.14.4
Checking for function "asprintf" : YES 
Checking for function "mkostemp" : NO 
Checking for function "posix_fallocate" : YES 
Checking for function "memfd_create" : YES 
Configuring config.h using configuration
Program wayland-scanner found: YES (/usr/bin/wayland-scanner)
Run-time dependency gtk+-3.0 found: YES 3.24.34
Run-time dependency cairo found: YES 1.16.0
Library m found: YES
Run-time dependency pangocairo found: YES 1.50.12
Run-time dependency wayland-cursor found: YES 1.21.0
Dependency wayland-cursor found: YES 1.21.0 (cached)
C++ compiler for the host machine: g++ (gcc 12.2.1 "g++ (Clear Linux OS for Intel Architecture) 12.2.1 20230105 releases/gcc-12.2.0-333-gebb1f6d14c")
C++ linker for the host machine: g++ ld.bfd 2.39.0
Dependency wayland-cursor found: YES 1.21.0 (cached)
Library m found: YES
Run-time dependency egl found: YES 23.0.0-devel
Found CMake: /usr/bin/cmake (3.25.1)
Run-time dependency opengl found: NO (tried pkgconfig and cmake)

demo/meson.build:8:0: ERROR: Dependency "opengl" not found, tried pkgconfig and cmake

Which bundle / package (dependency “opengl”) should I get to fix this…? Many thanks for any usable reply!

Okay, so here goes nothing… With a few steps I got libdecor to compile and have Blender 3.4.1 or newer to recognise it, starting up with Wayland! The only question that may remain open, does Clear Linux* appreciate / allow that which I have done and am describing here:

cd /tmp
git clone https://gitlab.freedesktop.org/libdecor/libdecor
cd libdecor
sudo swupd bundle-add dev-utils os-core-update-dev devpkg-wayland-protocols
nano meson.build

Comment out (by adding a # at the beginning of these) lines 102 till 104 to disable demo building, save and quit with Ctrl - o and Ctrl - x. Then continue with:

meson build --buildtype release
ninja -C build
sudo ninja -C build install
sudo cp /usr/local/lib64/libdecor-0.so* /lib64

And then Blender 3.4.1 or newer does recognise Wayland, without even having to restart my machine!

Does this fit inside the Clear Linux* security guidelines…?

Did you have to move the library bits to /lib64 as they wouldn’t work in /usr/local? That seems odd. That’s the only thing likely to cause problems as I assume the rest was put into /usr/local via that install.

I spoke with one of the developers at Blender and his answer was:

Blender doesn’t control where libraries are searched for, that’s typically up to the system. Normally it just works, but in cases it doesn’t - set your LD_LIBRARY_PATH”,

which I did not yet know how to do, so I copied to /lib64 and that worked. I am still learning…