2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, libva
|
|
|
|
, libpciaccess
|
|
|
|
, intel-gmmlib
|
2022-01-03 16:56:52 +00:00
|
|
|
, libdrm
|
2021-10-06 13:57:05 +00:00
|
|
|
, enableX11 ? stdenv.isLinux
|
|
|
|
, libX11
|
2022-09-09 14:08:57 +00:00
|
|
|
# for passhtru.tests
|
|
|
|
, pkgsi686Linux
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "intel-media-driver";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "22.5.2";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-10-06 13:57:05 +00:00
|
|
|
owner = "intel";
|
|
|
|
repo = "media-driver";
|
|
|
|
rev = "intel-media-${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-3WqmTM68XdQfGibkVAT1S9N7Cn8eviNM6qUeF8qogtc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
patches = [
|
|
|
|
# fix platform detection
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://salsa.debian.org/multimedia-team/intel-media-driver-non-free/-/raw/master/debian/patches/0002-Remove-settings-based-on-ARCH.patch";
|
|
|
|
sha256 = "sha256-f4M0CPtAVf5l2ZwfgTaoPw7sPuAP/Uxhm5JSHEGhKT0=";
|
|
|
|
})
|
2022-08-12 12:06:08 +00:00
|
|
|
# fix compilation on i686-linux
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/intel/media-driver/commit/5ee502b84eb70f0d677a3b49d624c356b3f0c2b1.patch";
|
|
|
|
revert = true;
|
|
|
|
sha256 = "sha256-yRS10BKD5IkW8U0PxmyB7ryQiLwrqeetm0NivnoM224=";
|
|
|
|
})
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
buildInputs = [ libva libpciaccess intel-gmmlib libdrm ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional enableX11 libX11;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postFixup = lib.optionalString enableX11 ''
|
|
|
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
|
|
|
|
$out/lib/dri/iHD_drv_video.so
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (pkgsi686Linux) intel-media-driver;
|
|
|
|
};
|
|
|
|
|
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;
|
2022-03-10 19:12:11 +00:00
|
|
|
maintainers = with maintainers; [ jfrankenau SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|