Trouble compiling newm: wayland-server not found

I am on NixOS with flakes activated and I want to try out a new wayland compositor: GitHub - jbuchermn/newm: Wayland compositor

Their readme says I should do two steps:

pip3 install --user git+https://github.com/jbuchermn/pywm
pip3 install --user git+https://github.com/jbuchermn/newm

I looked at the python article in the wiki and decided to use a virtual environment. With some trial and error I also found several dependecies that are missing from my system so currently I am doing something like this in a terminal:

nix shell nixpkgs#meson nixpkgs#pkg-config nixpkgs#wayland nixpkgs#cmake nixpkgs#binutils
python3 -m venv foo
source foo/bin/activate
pip3 install git+https://github.com/jbuchermn/pywm

but that fails with the following error from meason (run by pip):

The Meson build system
Version: 0.57.1
Source dir: /tmp/pip-req-build-lw5mvmys
Build dir: /tmp/pip-req-build-lw5mvmys/build
Build type: native build
Project name: pywm
Project version: 0.1.0
C compiler for the host machine: cc (gcc 10.3.0 "gcc (GCC) 10.3.0")
C linker for the host machine: cc ld.bfd 2.35.2
Host machine cpu family: x86_64
Host machine cpu: x86_64

|Executing subproject wlroots method meson
|
|Project name: wlroots
|Project version: 0.15.0
|C compiler for the host machine: cc (gcc 10.3.0 "gcc (GCC) 10.3.0")
|C linker for the host machine: cc ld.bfd 2.35.2
|Compiler for C supports arguments -Wundef: YES
|Compiler for C supports arguments -Wlogical-op: YES
|Compiler for C supports arguments -Wmissing-include-dirs: YES
|Compiler for C supports arguments -Wold-style-definition: YES
|Compiler for C supports arguments -Wpointer-arith: YES
|Compiler for C supports arguments -Winit-self: YES
|Compiler for C supports arguments -Wstrict-prototypes: YES
|Compiler for C supports arguments -Wimplicit-fallthrough=2: YES
|Compiler for C supports arguments -Wendif-labels: YES
|Compiler for C supports arguments -Wstrict-aliasing=2: YES
|Compiler for C supports arguments -Woverflow: YES
|Compiler for C supports arguments -Wmissing-prototypes: YES
|Compiler for C supports arguments -Walloca: YES
|Compiler for C supports arguments -Wno-missing-braces: YES
|Compiler for C supports arguments -Wno-missing-field-initializers: YES
|Compiler for C supports arguments -Wno-unused-parameter: YES
|WARNING: Project targeting '>=0.56.0' but tried to use feature deprecated since '0.56.0': meson.build_root. use meson.current_build_dir instead.
|Compiler for C supports arguments -fmacro-prefix-map=/prefix/to/hide=: YES
|Found pkg-config: /nix/store/0hdlrnn0n1k82bd4vz2gkz9j4b5iygcw-pkg-config-0.29.2/bin/pkg-config (0.29.2)
|Found CMake: /nix/store/mnq9fvg9yqan4g1pgis01l0mqfkihpqs-cmake-3.21.2/bin/cmake (3.21.2)
|Run-time dependency wayland-server found: NO (tried pkgconfig and cmake)

subprojects/wlroots/meson.build:97:0: ERROR: Dependency "wayland-server" not found, tried pkgconfig and cmake

A full log can be found at /tmp/pip-req-build-lw5mvmys/build/meson-logs/meson-log.txt

If I add --no-clean to the pip command I can read the log file but it does not have much more info.

I did only find a derivation libsForQt5.kwayland-server but adding that to the shell
does not help. I also found lib/libwayland-server.so in the wayland
derivation but that should already be part of my shell, pkg-config can not
find it though.

I assume I need to tell pkg-config where libwayland-server is. How do I do
that? (Or how do I compile the pywm thing in general?)

1 Like

I found out that nix-shell might work better than nix shell:

Now I am this far:

nix-shell -p meson pkg-config wayland cmake \
  binutils libdrm mesa \
  libinput libxkbcommon pixman wayland-protocols \
  libseat ninja xwayland xorg.xcbproto xorg.xcbutil libglvnd
  --run 'source foo/bin/activate && pip3 install git+https://github.com/jbuchermn/pywm'

leads to the following error when linking pywm:

...
[385/412] Compiling C object pywm.p/src_wm_wm_idle_inhibit.c.o
[386/412] Compiling C object pywm.p/src_wm_wm_view_xwayland.c.o
../src/wm/wm_view_xwayland.c: In function ‘wm_view_xwayland_set_resizing’:
../src/wm/wm_view_xwayland.c:341:30: warning: unused variable ‘view’ [-Wunused-variable]
  341 |     struct wm_view_xwayland* view = wm_cast(wm_view_xwayland, super);
      |                              ^~~~
../src/wm/wm_view_xwayland.c: In function ‘wm_view_xwayland_structure_printf’:
../src/wm/wm_view_xwayland.c:431:30: warning: unused variable ‘view’ [-Wunused-variable]
  431 |     struct wm_view_xwayland* view = wm_cast(wm_view_xwayland, super);
      |                              ^~~~
[387/412] Compiling C object pywm.p/src_wm_wm_drag.c.o
[388/412] Compiling C object pywm.p/src_main.c.o
[389/412] Compiling C object pywm.p/src_wm_wm_view_xdg.c.o
[390/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_pointer.c.o
[391/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm.c.o
[392/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_seat.c.o
[393/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_server.c.o
[394/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_renderer.c.o
[395/412] Linking target pywm
FAILED: pywm
gcc  -o pywm pywm.p/src_wm_wm.c.o pywm.p/src_wm_wm_server.c.o pywm.p/src_wm_wm_renderer.c.o pywm.p/src_wm_wm_seat.c.o pywm.p/src_wm_wm_keyboard.c.o pywm.p/src_wm_wm_pointer.c.o pywm.p/src_wm_wm_cursor.c.o pywm.p/src_wm_wm_layout.c.o pywm.p/src_wm_wm_output.c.o pywm.p/src_wm_wm_content.c.o pywm.p/src_wm_wm_view.c.o pywm.p/src_wm_wm_view_xdg.c.o pywm.p/src_wm_wm_view_xwayland.c.o pywm.p/src_wm_wm_widget.c.o pywm.p/src_wm_wm_config.c.o pywm.p/src_wm_wm_idle_inhibit.c.o pywm.p/src_wm_wm_drag.c.o pywm.p/src_main.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group subprojects/wlroots/libwlroots.a protocols/libserver_protos.a /nix/store/kw2y4gc6cmpf7riivgbw20zk4dj3sakr-wayland-1.19.0/lib/libwayland-server.so /nix/store/kw2y4gc6cmpf7riivgbw20zk4dj3sakr-wayland-1.19.0/lib/libwayland-client.so /nix/store/kgzhnlza09sw2kzzvmp3jp0bypsglqkp-libdrm-2.4.108/lib/libdrm.so /nix/store/ws9s478q7w6c1fyh09ip1191ih7mq30c-mesa-21.2.5/lib/libgbm.so /nix/store/xn0sxi1zp7i1q3p44z00inn7fi1d37bz-libinput-1.19.1/lib/libinput.so /nix/store/kkil66hbhaf83pv9p3h2agckkyrlfbxa-libxkbcommon-1.3.1/lib/libxkbcommon.so /nix/store/q0881awy50g4srnnwasci37y2jk5sf99-systemd-249.5/lib/libudev.so /nix/store/8vj9db5pi3wxmmaggksd2adjdq1ngz35-pixman-0.38.4/lib/libpixman-1.so -lm -lrt /nix/store/ar18dm5xdnn9khdmi4g5s4sgmp563zg1-libglvnd-1.3.4/lib/libEGL.so /nix/store/ar18dm5xdnn9khdmi4g5s4sgmp563zg1-libglvnd-1.3.4/lib/libGLESv2.so /nix/store/q44id8j4jsl6h8mjwc7dmp3ir6x2lnx1-seatd-0.6.3/lib/libseat.so -lpthread -Wl,--end-group
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `handle_new_xwayland_surface':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_server.c:99: undefined reference to `wlr_xwayland_surface_ping'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `wm_server_init':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_server.c:248: undefined reference to `wlr_xwayland_set_seat'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: /run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_server.c:217: undefined reference to `wlr_xwayland_create'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: /run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_server.c:231: undefined reference to `wlr_xwayland_set_cursor'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_server.c.o: in function `wm_server_destroy':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_server.c:303: undefined reference to `wlr_xwayland_destroy'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_request_close':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:294: undefined reference to `wlr_xwayland_surface_close'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_maximized':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:351: undefined reference to `wlr_xwayland_surface_set_maximized'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_fullscreen':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:347: undefined reference to `wlr_xwayland_surface_set_fullscreen'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_request_size':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:288: undefined reference to `wlr_xwayland_surface_configure'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `child_handle_request_configure':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:102: undefined reference to `wlr_xwayland_surface_configure'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `handle_request_configure':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:130: undefined reference to `wlr_xwayland_surface_configure'
/nix/store/js66s0xwjnzg0ggi2lq9bcvlk6x2za13-binutils-2.35.2/bin/ld: pywm.p/src_wm_wm_view_xwayland.c.o: in function `wm_view_xwayland_set_activated':
/run/user/1000/pip-req-build-g312bqsv/build/../src/wm/wm_view_xwayland.c:355: undefined reference to `wlr_xwayland_surface_activate'
collect2: error: ld returned 1 exit status
[396/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_layout.c.o
[397/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_cursor.c.o
[398/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_keyboard.c.o
[399/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_output.c.o
[400/412] Compiling C object _pywm.cpython-39-x86_64-linux-gnu.so.p/src_wm_wm_content.c.o
ninja: build stopped: subcommand failed.

I just stumbled upon this thread now, a bit late - I’m the creator of newm.

In the meantime I switched my machines to NixOS; so newm now comes with a flake.nix, which should make installing (or running it) a lot easier on NixOS:

nix build "github:jbuchermn/newm/v0.3#newm"
./result/bin/start-newm
3 Likes

Thanks, I had stopped trying but now I was able to run newm. I will try it out some more when I find the time :slight_smile: