11 , enableX11 ? stdenv.isLinux
17 stdenv.mkDerivation rec {
18 pname = "intel-media-driver";
21 outputs = [ "out" "dev" ];
23 src = fetchFromGitHub {
25 repo = "media-driver";
26 rev = "intel-media-${version}";
27 sha256 = "sha256-3l8mfw1h1se0+w4VtfMr0xuPW8G3JA6hbvkyCaEGTek=";
31 # fix platform detection
33 url = "https://salsa.debian.org/multimedia-team/intel-media-driver-non-free/-/raw/master/debian/patches/0002-Remove-settings-based-on-ARCH.patch";
34 sha256 = "sha256-f4M0CPtAVf5l2ZwfgTaoPw7sPuAP/Uxhm5JSHEGhKT0=";
36 # fix compilation on i686-linux
38 url = "https://github.com/intel/media-driver/commit/5ee502b84eb70f0d677a3b49d624c356b3f0c2b1.patch";
40 sha256 = "sha256-yRS10BKD5IkW8U0PxmyB7ryQiLwrqeetm0NivnoM224=";
45 "-DINSTALL_DRIVER_SYSCONF=OFF"
46 "-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri"
47 # Works only on hosts with suitable CPUs.
48 "-DMEDIA_RUN_TEST_SUITE=OFF"
51 NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
53 nativeBuildInputs = [ cmake pkg-config ];
55 buildInputs = [ libva libpciaccess intel-gmmlib libdrm ]
56 ++ lib.optional enableX11 libX11;
58 postFixup = lib.optionalString enableX11 ''
59 patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
60 $out/lib/dri/iHD_drv_video.so
64 inherit (pkgsi686Linux) intel-media-driver;
68 description = "Intel Media Driver for VAAPI — Broadwell+ iGPUs";
70 The Intel Media Driver for VAAPI is a new VA-API (Video Acceleration API)
71 user mode driver supporting hardware accelerated decoding, encoding, and
72 video post processing for GEN based graphics hardware.
74 homepage = "https://github.com/intel/media-driver";
75 changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${version}";
76 license = with licenses; [ bsd3 mit ];
77 platforms = platforms.linux;
78 maintainers = with maintainers; [ jfrankenau SuperSandro2000 ];