2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, pkg-config, meson, ninja, docutils
|
2024-06-05 15:53:02 +00:00
|
|
|
, libpthreadstubs
|
|
|
|
, withIntel ? lib.meta.availableOn stdenv.hostPlatform libpciaccess, libpciaccess
|
2023-10-09 19:29:22 +00:00
|
|
|
, withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light
|
2023-11-16 04:20:00 +00:00
|
|
|
, gitUpdater
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libdrm";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "2.4.123";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-08-20 17:08:02 +00:00
|
|
|
url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-ormFZ6FJp0sPUOkegl+cAxXYbnvpt0OU2uiymMqtt54=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "bin" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config meson ninja docutils ];
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ libpthreadstubs ]
|
|
|
|
++ lib.optional withIntel libpciaccess
|
2020-04-24 23:36:52 +00:00
|
|
|
++ lib.optional withValgrind valgrind-light;
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstall-test-programs=true"
|
2022-10-21 18:38:19 +00:00
|
|
|
"-Dcairo-tests=disabled"
|
2024-06-05 15:53:02 +00:00
|
|
|
(lib.mesonEnable "intel" withIntel)
|
2023-03-04 12:14:45 +00:00
|
|
|
(lib.mesonEnable "omap" stdenv.hostPlatform.isLinux)
|
|
|
|
(lib.mesonEnable "valgrind" withValgrind)
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch [
|
2022-10-21 18:38:19 +00:00
|
|
|
"-Dtegra=enabled"
|
2023-03-04 12:14:45 +00:00
|
|
|
] ++ lib.optionals (!stdenv.hostPlatform.isLinux) [
|
|
|
|
"-Detnaviv=disabled"
|
2021-03-09 03:18:52 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
url = "https://gitlab.freedesktop.org/mesa/drm.git";
|
|
|
|
rev-prefix = "libdrm-";
|
|
|
|
# Skip versions like libdrm-2_0_2 that happen to go last when
|
|
|
|
# sorted.
|
|
|
|
ignoredVersions = "_";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.freedesktop.org/mesa/drm";
|
|
|
|
downloadPage = "https://dri.freedesktop.org/libdrm/";
|
|
|
|
description = "Direct Rendering Manager library and headers";
|
|
|
|
longDescription = ''
|
|
|
|
A userspace library for accessing the DRM (Direct Rendering Manager) on
|
|
|
|
Linux, BSD and other operating systems that support the ioctl interface.
|
|
|
|
The library provides wrapper functions for the ioctls to avoid exposing
|
|
|
|
the kernel interface directly, and for chipsets with drm memory manager,
|
|
|
|
support for tracking relocations and buffers.
|
|
|
|
New functionality in the kernel DRM drivers typically requires a new
|
|
|
|
libdrm, but a new libdrm will always work with an older kernel.
|
|
|
|
|
|
|
|
libdrm is a low-level library, typically used by graphics drivers such as
|
|
|
|
the Mesa drivers, the X drivers, libva and similar projects.
|
|
|
|
'';
|
|
|
|
license = licenses.mit;
|
2023-01-20 10:41:00 +00:00
|
|
|
platforms = lib.subtractLists platforms.darwin platforms.unix;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ primeos ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|