l-Shane-l / tiny-wlhs

This project aims to create a total Haskell implementation of TinyWL (Tiny Wayland Compositor) using Haskell bindings for wlroots. The ultimate goal is to provide a way to test and validate Haskell bindings for the wlroots library.
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

`nix-shell` pkg-config error: No package 'wlroots' found #1

Open dylan-hachmann opened 2 days ago

dylan-hachmann commented 2 days ago

I'm not great with Nix, so I don't really know if this is a configuration error on my part, or something that's missing from shell.nix. It seems pkg-config is working for wayland-server and xkbcommon.

Anyways, please start by letting me know if it works for you with the --pure flag. If so, there's probably something that I need to fix locally. Thanks.

❯ nix-shell --pure
Building tinywl...
make: *** No rule to make target 'clean'.  Stop.
Package wlroots was not found in the pkg-config search path.
Perhaps you should add the directory containing `wlroots.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wlroots' found
gcc -fPIC -shared \
    -g -Werror -I. \
    -DWLR_USE_UNSTABLE \
    -o libtinywl.so tinywl.c \
     -I/nix/store/vnkj4a52dss86fm7fgqp97d9180dswxv-wayland-1.23.1-dev/include -L/nix/store/cdnwvy5zyh6la8x1cal00xmvsj8x3dai-wayland-1.23.1/lib -lwayland-server -I/nix/store/hysfim3nfixdgwsazsfw9qk2ym75bxvg-libxkbcommon-1.7.0-dev/include -L/nix/store/4iyki6wsawj3qyisw3yqqam6x7w50had-libxkbcommon-1.7.0/lib -lxkbcommon
tinywl.c:10:10: fatal error: wlr/backend.h: No such file or directory
   10 | #include <wlr/backend.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile.shared:24: libtinywl.so] Error 1
Wayland development environment
wayland-scanner 1.23.1
wayland-scanner version:
Wayland protocols path: /nix/store/ik6k42z9bhk1k8sijb39hcla32w9dkcl-wayland-protocols-1.36/share/wayland-protocols
LD_LIBRARY_PATH includes: :/home/dylan/Development/tiny-wlhs/tinywl
l-Shane-l commented 2 days ago

I will take a better look tomorrow.

But If you need a fix tonight I think this is my fault for not updating the Readme.

You need to git clone with submodules if you cloned without the submodules then install them with git (I'm not sure if the exact command).

Basically you need to do this because my fork of wlhs is embedded in the project as a git submodule.

Let me know how you get on.

dylan-hachmann commented 2 days ago

Hmm, I don't think that's the issue. I've got the submodule cloned.

Earlier I didn't see anything in PKG_CONFIG_PATH, so I thought Nix did something weird. Looks like I must have just been typoing, lol, since I just checked again and found the wlroots include path. It seems that to pkg-config the name is "wlroots-0.18". The existing bindings are to 0.17, so I guess we'd have to pin it in the shell.nix somehow.

I can try to do this with Niv, unless you've got a way that you want to go about it.

l-Shane-l commented 2 days ago

Oh interesting, last I checked wlroots was at 17.3, wlhs is 17.1 so 0.18 is a big jump.

There are ways to manually set the versions with shell.nix files. However I think the best thing to do Is for me to create a flake.nix file instead and pin it to 17.1 like wlhs.

Ill try to do that today or tomorrow.