1 { stdenv, lib, fetchurl, pkg-config, meson, ninja, docutils
3 , withIntel ? lib.meta.availableOn stdenv.hostPlatform libpciaccess, libpciaccess
4 , withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light
8 stdenv.mkDerivation rec {
13 url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz";
14 hash = "sha256-ormFZ6FJp0sPUOkegl+cAxXYbnvpt0OU2uiymMqtt54=";
17 outputs = [ "out" "dev" "bin" ];
19 nativeBuildInputs = [ pkg-config meson ninja docutils ];
20 buildInputs = [ libpthreadstubs ]
21 ++ lib.optional withIntel libpciaccess
22 ++ lib.optional withValgrind valgrind-light;
25 "-Dinstall-test-programs=true"
26 "-Dcairo-tests=disabled"
27 (lib.mesonEnable "intel" withIntel)
28 (lib.mesonEnable "omap" stdenv.hostPlatform.isLinux)
29 (lib.mesonEnable "valgrind" withValgrind)
30 ] ++ lib.optionals stdenv.hostPlatform.isAarch [
32 ] ++ lib.optionals (!stdenv.hostPlatform.isLinux) [
37 updateScript = gitUpdater {
38 url = "https://gitlab.freedesktop.org/mesa/drm.git";
39 rev-prefix = "libdrm-";
40 # Skip versions like libdrm-2_0_2 that happen to go last when
42 ignoredVersions = "_";
47 homepage = "https://gitlab.freedesktop.org/mesa/drm";
48 downloadPage = "https://dri.freedesktop.org/libdrm/";
49 description = "Direct Rendering Manager library and headers";
51 A userspace library for accessing the DRM (Direct Rendering Manager) on
52 Linux, BSD and other operating systems that support the ioctl interface.
53 The library provides wrapper functions for the ioctls to avoid exposing
54 the kernel interface directly, and for chipsets with drm memory manager,
55 support for tracking relocations and buffers.
56 New functionality in the kernel DRM drivers typically requires a new
57 libdrm, but a new libdrm will always work with an older kernel.
59 libdrm is a low-level library, typically used by graphics drivers such as
60 the Mesa drivers, the X drivers, libva and similar projects.
62 license = licenses.mit;
63 platforms = lib.subtractLists platforms.darwin platforms.unix;
64 maintainers = with maintainers; [ primeos ];