2021-01-19 12:01:21 +00:00
|
|
|
{ stdenv, lib, fetchurl, pkg-config, meson, ninja, docutils
|
|
|
|
, libpthreadstubs, libpciaccess
|
2023-04-20 21:17:01 +00:00
|
|
|
, withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light
|
2023-10-23 11:12:48 +00:00
|
|
|
, gitUpdater
|
2019-07-20 17:13:21 +00:00
|
|
|
}:
|
2005-11-01 20:27:57 +00:00
|
|
|
|
2012-01-16 17:48:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-07-03 20:03:46 +00:00
|
|
|
pname = "libdrm";
|
2024-01-15 21:53:21 +00:00
|
|
|
version = "2.4.120";
|
2013-02-23 11:07:19 +00:00
|
|
|
|
2005-11-01 20:27:57 +00:00
|
|
|
src = fetchurl {
|
2020-06-18 11:04:29 +00:00
|
|
|
url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz";
|
2024-01-15 21:53:21 +00:00
|
|
|
hash = "sha256-O/VTY/dsclCUZEGrUdOmzArlGAVcD/AXMkq3bN77Mno=";
|
2008-10-08 17:02:48 +00:00
|
|
|
};
|
|
|
|
|
2017-10-06 17:51:14 +00:00
|
|
|
outputs = [ "out" "dev" "bin" ];
|
2013-08-23 07:54:18 +00:00
|
|
|
|
2021-01-19 12:01:21 +00:00
|
|
|
nativeBuildInputs = [ pkg-config meson ninja docutils ];
|
2019-07-20 17:13:21 +00:00
|
|
|
buildInputs = [ libpthreadstubs libpciaccess ]
|
|
|
|
++ lib.optional withValgrind valgrind-light;
|
2009-04-20 18:43:08 +00:00
|
|
|
|
2019-07-20 17:13:21 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dinstall-test-programs=true"
|
2022-09-14 23:07:40 +00:00
|
|
|
"-Dcairo-tests=disabled"
|
2023-01-27 09:56:37 +00:00
|
|
|
(lib.mesonEnable "omap" stdenv.hostPlatform.isLinux)
|
|
|
|
(lib.mesonEnable "valgrind" withValgrind)
|
2022-07-30 16:18:27 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch [
|
2022-09-14 23:07:40 +00:00
|
|
|
"-Dtegra=enabled"
|
2023-01-27 09:56:37 +00:00
|
|
|
] ++ lib.optionals (!stdenv.hostPlatform.isLinux) [
|
|
|
|
"-Detnaviv=disabled"
|
2021-01-30 08:53:37 +00:00
|
|
|
];
|
2012-01-16 17:48:33 +00:00
|
|
|
|
2023-10-23 11:12:48 +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-01-19 12:01:21 +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;
|
2022-12-09 15:54:32 +00:00
|
|
|
platforms = lib.subtractLists platforms.darwin platforms.unix;
|
2021-01-19 12:01:21 +00:00
|
|
|
maintainers = with maintainers; [ primeos ];
|
2005-11-01 20:27:57 +00:00
|
|
|
};
|
2012-01-16 17:48:33 +00:00
|
|
|
}
|