2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-06-18 07:06:33 +00:00
|
|
|
, cmake, pkg-config
|
2021-01-09 10:05:03 +00:00
|
|
|
, libva, libpciaccess, intel-gmmlib
|
|
|
|
, enableX11 ? true, libX11
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "intel-media-driver";
|
2021-04-26 19:14:03 +00:00
|
|
|
version = "21.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "intel";
|
|
|
|
repo = "media-driver";
|
|
|
|
rev = "intel-media-${version}";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha256 = "101wbg5j00amdbfz4p6mpg90wi549dl78jd34mac5g6zhcpwqbh9";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DINSTALL_DRIVER_SYSCONF=OFF"
|
|
|
|
"-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri"
|
|
|
|
# Works only on hosts with suitable CPUs.
|
|
|
|
"-DMEDIA_RUN_TEST_SUITE=OFF"
|
|
|
|
];
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
buildInputs = [ libva libpciaccess intel-gmmlib ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional enableX11 libX11;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Intel Media Driver for VAAPI — Broadwell+ iGPUs";
|
|
|
|
longDescription = ''
|
|
|
|
The Intel Media Driver for VAAPI is a new VA-API (Video Acceleration API)
|
|
|
|
user mode driver supporting hardware accelerated decoding, encoding, and
|
|
|
|
video post processing for GEN based graphics hardware.
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/intel/media-driver";
|
2020-06-18 07:06:33 +00:00
|
|
|
changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ bsd3 mit ];
|
|
|
|
platforms = platforms.linux;
|
2020-06-18 07:06:33 +00:00
|
|
|
maintainers = with maintainers; [ primeos jfrankenau ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postFixup = lib.optionalString enableX11 ''
|
|
|
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
|
2021-01-09 10:05:03 +00:00
|
|
|
$out/lib/dri/iHD_drv_video.so
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|