Installing wayland on fedora 39

Dear Qubes community,

I need a wayland socket to run a specific app. There is a guide to install wayland on fedora:

But I dont understand the instructions. After installing the packages I have to build something:

cd /path/to/source && meson setup build && cd build && meson compile

But what is the path to source here?

Thanks,
Singer

I guess it’s the directory with qubes-wayland sources from the github e.g.:

git clone https://github.com/DemiMarie/qubes-wayland
cd qubes-wayland && meson setup build && cd build && meson compile

Thank you. I tried it and the output was:

cd qubes-wayland && meson setup build && cd build && meson compile
The Meson build system
Version: 1.3.2
Source dir: /home/user/qubes-wayland
Build dir: /home/user/qubes-wayland/build
Build type: native build
Project name: qubes-compositor
Project version: 0.0.1
C compiler for the host machine: ...
C linker for the host machine: cc ld.bfd 2.40-14
Host machine cpu family:
Host machine cpu:
Library dl found: YES
Library qubesdb found: YES
Found pkg-config: YES (/usr/bin/pkg-config) 1.9.5
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency wayland-protocols found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency wayland-protocols

meson.build:64:17: ERROR: Neither a subproject directory nor a wayland-protocols.wrap file was found.

A full log can be found at /home/user/qubes-wayland/build/meson-logs/meson-log.txt

Is there something wrong?

The log file says:

Called: `/usr/bin/pkg-config --modversion wayland-protocols` -> 1
stderr:
Package wayland-protocols was not found in the pkg-config search path.
Perhaps you should add the directory containing `wayland-protocols.pc'
to the PKG_CONFIG_PATH environment variable
Package 'wayland-protocols', required by 'virtual:world', not found
-----------
CMake binary for host machine is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Did not find CMake 'cmake'
Found CMake: NO
CMake binary for machine host machine not found. Giving up.
Run-time dependency wayland-protocols found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency wayland-protocols

meson.build:64:17: ERROR: Neither a subproject directory nor a wayland-protocols.wrap file was found.

You need to install cmake in your fedora template:

sudo dnf install cmake

Did you install the packages listed in Prerequisites?

Now the AppVM terminal says:

Found pkg-config: YES (/usr/bin/pkg-config) 1.9.5
Found CMake: /usr/bin/cmake (3.27.7)
Run-time dependency wayland-protocols found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency wayland-protocols

meson.build:64:17: ERROR: Neither a subproject directory nor a wayland-protocols.wrap file was found.

A full log can be found at /home/user/qubes-wayland/build/meson-logs/meson-log.txt

Is still something wrong?

There is no package wayland-protocols installable in fedora.

Install the required packages and then retry the build process:

sudo dnf install libxcb-devel libdrm-devel wayland-devel libxkbcommon-devel pixman-devel systemd-devel qubes-libvchan-xen-devel cargo

That was a spelling mistake, sorry. Should be “now”. The packages were already installed. There is still the wayland-protocols error. What could I do?

Try to install wayland-protocols-devel package.

Okay, now wayland-protocols work, but I had also to install wlroots and wlroots-devel. Now the problem is, that it needs an older version of wlroots, but it is not available in fedora 39:

Run-time dependency wayland-protocols found: YES 1.34
Build-time dependency wayland-scanner found: YES 1.22.0
Program /usr/bin/wayland-scanner found: YES (/usr/bin/wayland-scanner)
Dependency wlroots found: NO found 0.17.3 but need: '<0.17.0' ; matched: '>=0.16.0'
Found CMake: /usr/bin/cmake (3.27.7)
Run-time dependency wlroots found: NO (tried pkgconfig and cmake)
Submodule 'subprojects/wlroots' (git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git) registered for path './'
Cloning into '/home/user/.local/share/Trash/files/qubes-wayland.4/qubes-wayland/subprojects/wlroots'...
git@gitlab.freedesktop.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git' into submodule path '/home/user/.local/share/Trash/files/qubes-wayland.4/qubes-wayland/subprojects/wlroots' failed
Failed to clone 'subprojects/wlroots'. Retry scheduled
Cloning into '/home/user/.local/share/Trash/files/qubes-wayland.4/qubes-wayland/subprojects/wlroots'...
git@gitlab.freedesktop.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git' into submodule path '/home/user/.local/share/Trash/files/qubes-wayland.4/qubes-wayland/subprojects/wlroots' failed
Failed to clone 'subprojects/wlroots' a second time, aborting

meson.build:119:17: ERROR: git submodule failed to init

A full log can be found at /home/user/.local/share/Trash/files/qubes-wayland.4/qubes-wayland/build/meson-logs/meson-log.txt

What now?

I guess you’ll need to use an older Fedora template. The qubes-wayland was tested with Fedora 37 template.

1 Like

On fedora 38 the command also failed:

Configuring qubes-gui-agent-wayland.service using configuration
Build targets in project: 4

Found ninja-1.11.1 at /usr/bin/ninja
INFO: autodetecting backend as ninja                                            
INFO: calculating backend command to run: /usr/bin/ninja
[4/14] Compiling C object qubes-compositor.p/cbits_qubes_allocator.c.o
FAILED: qubes-compositor.p/cbits_qubes_allocator.c.o 
cc -Iqubes-compositor.p -I. -I.. -I../cbits -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/vchan-xen -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O2 -g -DWLR_USE_UNSTABLE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE=1 -Wno-unused-parameter -Wno-error=cpp -Wvla -pthread -MD -MQ qubes-compositor.p/cbits_qubes_allocator.c.o -MF qubes-compositor.p/cbits_qubes_allocator.c.o.d -o qubes-compositor.p/cbits_qubes_allocator.c.o -c ../cbits/qubes_allocator.c
../cbits/qubes_allocator.c:24:10: fatal error: qubes-gui-protocol.h: No such file or directory
   24 | #include <qubes-gui-protocol.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[5/14] Compiling C object qubes-compositor.p/cbits_qubes_backend.c.o
FAILED: qubes-compositor.p/cbits_qubes_backend.c.o 
cc -Iqubes-compositor.p -I. -I.. -I../cbits -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/vchan-xen -fvisibility=hidden -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O2 -g -DWLR_USE_UNSTABLE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE=1 -Wno-unused-parameter -Wno-error=cpp -Wvla -pthread -MD -MQ qubes-compositor.p/cbits_qubes_backend.c.o -MF qubes-compositor.p/cbits_qubes_backend.c.o.d -o qubes-compositor.p/cbits_qubes_backend.c.o -c ../cbits/qubes_backend.c
In file included from ../cbits/qubes_backend.c:3:
../cbits/qubes_backend.h:10:10: fatal error: qubes-gui-protocol.h: No such file or directory
   10 | #include <qubes-gui-protocol.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[6/14] Generating Build Rust code with a custom command
FAILED: libqubes_gui_rust.a 
/bin/sh -- /home/user/qubes-wayland/./build_rust.sh libqubes_gui_rust.d . libqubes_gui_rust.a.p .. release
error: failed to get `qubes-castable` as a dependency of package `qubes-gui-rust-parts v0.0.1 (/home/user/qubes-wayland)`

Caused by:
  failed to load source for dependency `qubes-castable`

Caused by:
  Unable to update /home/user/qubes-wayland/gui-rust/qubes-castable

Caused by:
  failed to read `/home/user/qubes-wayland/gui-rust/qubes-castable/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
ninja: build stopped: subcommand failed.

Install qubes-gui-common-devel package.

Now it shows like this:

INFO: calculating backend command to run: /usr/bin/ninja
[3/14] Generating Build Rust code with a custom command
FAILED: libqubes_gui_rust.a 
/bin/sh -- /home/user/qubes-wayland/./build_rust.sh libqubes_gui_rust.d . libqubes_gui_rust.a.p .. release
error: failed to get `qubes-castable` as a dependency of package `qubes-gui-rust-parts v0.0.1 (/home/user/qubes-wayland)`

Caused by:
  failed to load source for dependency `qubes-castable`

Caused by:
  Unable to update /home/user/qubes-wayland/gui-rust/qubes-castable

Caused by:
  failed to read `/home/user/qubes-wayland/gui-rust/qubes-castable/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
[5/14] Compiling C object qubes-compositor.p/cbits_qubes_allocator.c.o
ninja: build stopped: subcommand failed.

Clone the repository like this:

git clone  --recurse-submodules https://github.com/DemiMarie/qubes-wayland

And retry.

In this case there is an error with access rights to a gitlab.freedesktop.org repository:

Cloning into 'qubes-wayland'...
remote: Enumerating objects: 2455, done.
remote: Counting objects: 100% (580/580), done.
remote: Compressing objects: 100% (218/218), done.
remote: Total 2455 (delta 423), reused 498 (delta 353), pack-reused 1875
Receiving objects: 100% (2455/2455), 505.00 KiB | 5.61 MiB/s, done.
Resolving deltas: 100% (1773/1773), done.
Submodule 'gui-rust' (https://github.com/QubesOS/gui-rust.git) registered for path 'gui-rust'
Submodule 'subprojects/wlroots' (git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git) registered for path 'subprojects/wlroots'
Cloning into '/home/user/qubes-wayland/gui-rust'...
remote: Enumerating objects: 1604, done.        
remote: Counting objects: 100% (40/40), done.        
remote: Compressing objects: 100% (28/28), done.        
remote: Total 1604 (delta 11), reused 31 (delta 8), pack-reused 1564        
Receiving objects: 100% (1604/1604), 782.07 KiB | 5.75 MiB/s, done.
Resolving deltas: 100% (644/644), done.
Cloning into '/home/user/qubes-wayland/subprojects/wlroots'...
The authenticity of host 'gitlab.freedesktop.org (147.28.146.59)' can't be established.
ED25519 key fingerprint is SHA256:i4LwjlmsgSrc3aWq3aVaDa8VQs6Fqq4nRBuFdZ6A1tE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitlab.freedesktop.org' (ED25519) to the list of known hosts.
git@gitlab.freedesktop.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git' into submodule path '/home/user/qubes-wayland/subprojects/wlroots' failed
Failed to clone 'subprojects/wlroots'. Retry scheduled
Cloning into '/home/user/qubes-wayland/subprojects/wlroots'...
git@gitlab.freedesktop.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git+ssh://git@gitlab.freedesktop.org/wlroots/wlroots.git' into submodule path '/home/user/qubes-wayland/subprojects/wlroots' failed
Failed to clone 'subprojects/wlroots' a second time, aborting

Not sure how to fix the git clone using ssh, you can try to clone using https instead:

cd qubes-wayland
sed -i "s|git+ssh://git@gitlab|https://gitlab|" .gitmodules .git/config
git submodule update --init

Terminal says:

Cloning into '/home/user/qubes-wayland/subprojects/wlroots'...
Submodule path 'gui-rust': checked out 'a545f4c7a49c2cce70088bcec84e9a2c6174bc40'
Submodule path 'subprojects/wlroots': checked out '0a32b5a74db06a27bee55a47205951bb277a9657'

Means that worked successful?

Yes, try to build in the new cloned qubes-wayland directory.

You think, I should go to /home/user/qubes-wayland and run these commands again?

git clone https://github.com/DemiMarie/qubes-wayland
cd qubes-wayland && meson setup build && cd build && meson compile

You’ve already cloned the repository with submodules, cd to this directory and build it.

cd /home/user/qubes-wayland && meson setup build && cd build && meson compile