Cmake cannot find "libdrm" package in Bazzite

Hello, I’m using the latest version of Bazzite available and I’m currently trying to install a special theme to my Bazzite installation called “vistathemeplasma”, but a huge chunk of the theme has to be manually compiled using cmake and so I went on doing that.

But everytime I try to compile Cmake complains it cannot find “libdrm” in the system

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find Libdrm (missing: Libdrm_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE) /usr/lib64/cmake/KWin/FindLibdrm.cmake:69 (find_package_handle_standard_args) /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package) /usr/lib64/cmake/KWin/KWinConfig.cmake:48 (find_dependency) CMakeLists.txt:70 (find_package)

But the odd thing is that libdrm is in the system, changing directory to /usr/lib64 and running ls -la | grep libdrm.so outputs this
eda@bazzite:/usr/lib64$ ls -la | grep libdrm.so

lrwxrwxrwx. 9 root root 17 Oct 18 12:28 libdrm.so -> libdrm.so.2.126.0

lrwxrwxrwx. 9 root root 17 Oct 18 12:28 libdrm.so.2 -> libdrm.so.2.126.0

-rwxr-xr-x. 3 root root 95272 Dec 31 1969 libdrm.so.2.126.0

Which clearly show that libdrm is actually in the system. I’ve tried reinstalling libdrm to no avail, and even installing libdrm-devel which should install necessary developer headers for libdrm but the system complains that “libdrm.so file already exists" with a system linked file.

Any way I could somehow tell cmake or the system itself that libdrm does exist? Or even a way to uninstall libdrm (I tried but wouldn’t let me) to then reinstall it?

Libdrm_INCLUDE_DIR makes me think that .h files are required for compile. So, I naively assume you need the package libdrm-devel

For reference, the error I get when I try to install libdrm-devel is this

error: Checkout libdrm-devel-2.4.125-1. fc42. x86_64: Hardlinking 24/42b44bb9cee8787b39c2f94359542f8c2cd23297025a
f46f525c2a9b2e21db.file to libdrm.so: File already exists

Trying to remove both libdrm and libdrm-devel also gets this error

eda@bazzite :~ $ sudo rpm-ostree remove libdrm-devel
error: Package/capability ‘libdrm-devel’ is not currently requested
eda@bazzite :~ $ sudo rpm-ostree remove libdrm
error: Package/capability ‘libdrm’ is not currently requested

I don’t recommend installing something like this as a layered package. If I were in your situation I would create a distrobox and build the stuff there. If this works and you end up with having a package to be installed you could install the package on your system.

As I have not tried here anything I don’t know, of course, if this is a viable path as in your distrobox you presumably would need plasma packages being installed.

Another idea: Create a Fedora VM and build it there.

I did try using a distrobox but the compile script just crashes, thing is this theme isn’t really compiled normally but instead uses a special script (called compile.sh) to compile everything related to the theme in question, not sure if it also had to do with how by default distrobox uses a normal fedora image rather than a Bazzite image

Yes. So, go for a Fedora VM… :slight_smile: