Some overlay help for libdrm

NixOS 22.11
Kernel: 5.15.67

I’ve been using Hyprland WM for a while, and on a recent system rebuild I began getting this error:

error: builder for '/nix/store/701fi2g81yhwsibbbv9r2qyql8lv7bx6-wlroots-hyprland-hidpi-2022-09-18_2ad25b1.drv' failed with exit code 1;
       last 10 log lines:
       > Run-time dependency wayland-server found: YES 1.21.0
       > Dependency libdrm found: NO found 2.4.112 but need: '>=2.4.113'
       > Did not find CMake 'cmake'
       > Found CMake: NO
       > Run-time dependency libdrm found: NO (tried pkgconfig and cmake)
       > Looking for a fallback subproject for the dependency libdrm
       >
       > meson.build:109:0: ERROR: Neither a subproject directory nor a libdrm.wrap file was found.
       >
       > A full log can be found at /build/source/build/meson-logs/meson-log.txt
       For full logs, run 'nix log /nix/store/701fi2g81yhwsibbbv9r2qyql8lv7bx6-wlroots-hyprland-hidpi-2022-09-18_2ad25b1.drv'

I looked at libdrm in nixpkgs and it looks it isn’t updated yet for 2.4.113. At this point, my assumption was to just try and bump the version for my system via this overlay:

    libdrm = prev.libdrm.overrideAttrs (oldAttrs: rec {
      pname = "libdrm";
      version = "2.4.113";
      src = final.fetchurl {
        url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz";
        sha256 = "sha256-f9frKWf2O+tGBvItUOJ32ZNIDQXvdd2Iqb2OZ3Mj5eE=";
      };
    });

With this overlay, I get this error:

       > The Meson build system
       > Version: 0.63.1
       > Source dir: /build/libdrm-2.4.113
       > Build dir: /build/libdrm-2.4.113/build
       > Build type: native build
       >
       > meson.build:21:0: ERROR: Value "true" (of type "string") for combo option "Enable support for OMAP's experimental KMS API." is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".
       >

If I overlay the meson option to be -Domap=enabled, I can make progress and get this error:

    -Dwrap_mode=nodownload         --prefix=/nix/store/8s7gfvriicangwlzcvv7n7j39zw6cank-libdrm-2.4.113 -Dnm-path=nm -Dinstall-test-programs=true -Domap=enabled
       > The Meson build system
       > Version: 0.63.1
       > Source dir: /build/libdrm-2.4.113
       > Build dir: /build/libdrm-2.4.113/build
       > Build type: native build
       >
       > meson.build:21:0: ERROR: Unknown options: "nm-path"

The option nm-path is added from a patch file in nixpkgs libdrm

As a test, if I “overlay” out the nm-path option, I get this error:

error: builder for '/nix/store/ry4b6ihnbp562vka9iyl0ng3arnn8a6c-libdrm-2.4.113.drv' failed with exit code 1;
       last 10 log lines:
       > Compiler for C supports arguments -Wno-attributes: YES
       > Compiler for C supports arguments -Wno-long-long: YES
       > Compiler for C supports arguments -Wno-missing-field-initializers: YES
       > Run-time dependency pciaccess found: YES 0.16
       > Run-time dependency cunit found: NO (tried pkgconfig and cmake)
       > Run-time dependency cairo found: NO (tried pkgconfig)
       >
       > meson.build:245:0: ERROR: Dependency "cairo" not found, tried pkgconfig
       >

At this point, I’m way out of my depth on how everything is impacting everything else, and there are a couple of questions I could use help on before I put more time on resolving these errors:

  • Is an overlay even a reasonable approach to my original issue missing libdrm-2.4.113?
  • Is there a problem with my implementation/writing of the overlay?
  • Is libdrm-2.4.113 so different that it has a whole new set of meson flags and dependencies (cunit, cairo) that make the nixpkgs version not usable?
  • Should I just continue trying to resolve these error messages by incrementing my overlay one by one? I’m not sure if there is even hope here…
  • Are there glaring errors in my understanding of the whole system?

I have same error but one difference libdrm: found 2.4.112 but need 2.4.113. I check unstable branch and see there is 2.4.113 and I cant figure out why my nix dont get it.