nixpkgs-suyu/pkgs/development/libraries/libdrm/default.nix

54 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, pkgconfig, meson, ninja, libpthreadstubs, libpciaccess
, withValgrind ? valgrind-light.meta.available, valgrind-light, fetchpatch
}:
stdenv.mkDerivation rec {
pname = "libdrm";
version = "2.4.99";
2013-02-23 12:07:19 +01:00
src = fetchurl {
url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.bz2";
sha256 = "0pnsw4bmajzdbz8pk4wswdmw93shhympf2q9alhbnpfjgsf57gsd";
};
2017-10-06 19:51:14 +02:00
outputs = [ "out" "dev" "bin" ];
2013-08-23 09:54:18 +02:00
2019-03-17 00:56:49 +01:00
nativeBuildInputs = [ pkgconfig meson ninja ];
buildInputs = [ libpthreadstubs libpciaccess ]
++ lib.optional withValgrind valgrind-light;
patches = [ ./cross-build-nm-path.patch ] ++
lib.optionals stdenv.hostPlatform.isMusl [
# Fix tests not building on musl because they use the glibc-specific
# (non-POSIX) `ioctl()` type signature. See #66441.
(fetchpatch {
url = "https://raw.githubusercontent.com/openembedded/openembedded-core/30a2af80f5f8c8ddf0f619e4f50451b02baa22dd/meta/recipes-graphics/drm/libdrm/musl-ioctl.patch";
sha256 = "0rdmh4k5kb80hhk1sdhlil30yf0s8d8w0fnq0hzyvw3ir1mki3by";
})
];
2019-08-02 12:16:32 +02:00
2018-08-08 20:45:53 +02:00
postPatch = ''
for a in */*-symbol-check ; do
patchShebangs $a
done
'';
mesonFlags = [
"-Dnm-path=${stdenv.cc.targetPrefix}nm"
"-Dinstall-test-programs=true"
"-Domap=true"
] ++ lib.optionals (stdenv.isAarch32 || stdenv.isAarch64) [
"-Dtegra=true"
"-Detnaviv=true"
] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-Dintel=false";
2019-03-17 00:56:49 +01:00
enableParallelBuilding = true;
meta = {
homepage = https://dri.freedesktop.org/libdrm/;
description = "Library for accessing the kernel's Direct Rendering Manager";
license = "bsd";
platforms = lib.platforms.unix;
};
}