1 { stdenv, lib, fetchFromGitHub, meson, pkg-config, ninja, wayland-scanner
4 , libX11, libXext, libXfixes, wayland, libffi, libGL
7 , intel-compute-runtime
15 stdenv.mkDerivation (finalAttrs: {
16 pname = "libva" + lib.optionalString minimal "-minimal";
19 src = fetchFromGitHub {
22 rev = finalAttrs.version;
23 sha256 = "sha256-0eOYxyMt2M2lkhoWOhoUQgP/1LYY3QQqSF5TdRUuCbs=";
26 outputs = [ "dev" "out" ];
28 depsBuildBuild = [ pkg-config ];
30 nativeBuildInputs = [ meson pkg-config ninja ]
31 ++ lib.optional (!minimal) wayland-scanner;
33 buildInputs = [ libdrm ]
34 ++ lib.optionals (!minimal) [ libX11 libXext libXfixes wayland libffi libGL ];
36 mesonFlags = lib.optionals stdenv.hostPlatform.isLinux [
37 # Add FHS and Debian paths for non-NixOS applications
38 "-Ddriverdir=${mesa.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/i386-linux-gnu/dri"
41 env = lib.optionalAttrs (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") {
42 NIX_LDFLAGS = "--undefined-version";
43 } // lib.optionalAttrs (stdenv.targetPlatform.useLLVM or false) {
44 NIX_CFLAGS_COMPILE = "-DHAVE_SECURE_GETENV";
48 # other drivers depending on libva and selected application users.
49 # Please get a confirmation from the maintainer before adding more applications.
50 inherit intel-compute-runtime intel-media-driver intel-vaapi-driver mpv vlc;
51 pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
55 description = "Implementation for VA-API (Video Acceleration API)";
57 VA-API is an open-source library and API specification, which provides
58 access to graphics hardware acceleration capabilities for video
59 processing. It consists of a main library (this package) and
60 driver-specific acceleration backends for each supported hardware vendor.
62 homepage = "https://01.org/linuxmedia/vaapi";
63 changelog = "https://raw.githubusercontent.com/intel/libva/${finalAttrs.version}/NEWS";
64 license = licenses.mit;
65 maintainers = with maintainers; [ SuperSandro2000 ];
66 pkgConfigModules = [ "libva" "libva-drm" ] ++ lib.optionals (!minimal) [
67 "libva-glx" "libva-wayland" "libva-x11"
69 platforms = platforms.unix;
71 # Mandatory libva shared library.
72 lib.systems.inspect.platformPatterns.isStatic