nixpkgs/pkgs/by-name/in/intel-media-driver/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

92 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
pkg-config,
libva,
libpciaccess,
intel-gmmlib,
libdrm,
enableX11 ? stdenv.hostPlatform.isLinux,
libX11,
# for passhtru.tests
pkgsi686Linux,
}:
stdenv.mkDerivation rec {
pname = "intel-media-driver";
version = "24.3.4";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "intel";
repo = "media-driver";
rev = "intel-media-${version}";
hash = "sha256-vgbWwL4mu8YZzfvBvxna8Ioz6ig29iA2RZHKuHdh5Ic=";
};
patches = [
# fix platform detection
(fetchpatch {
url = "https://salsa.debian.org/multimedia-team/intel-media-driver-non-free/-/raw/7376a99f060c26d6be8e56674da52a61662617b9/debian/patches/0002-Remove-settings-based-on-ARCH.patch";
hash = "sha256-57yePuHWYb3XXrB4MjYO2h6jbqfs4SGTLlLG91el8M4=";
})
];
cmakeFlags = [
"-DINSTALL_DRIVER_SYSCONF=OFF"
"-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri"
# Works only on hosts with suitable CPUs.
"-DMEDIA_RUN_TEST_SUITE=OFF"
"-DMEDIA_BUILD_FATAL_WARNINGS=OFF"
];
env.NIX_CFLAGS_COMPILE = lib.optionalString (
stdenv.hostPlatform.system == "i686-linux"
) "-D_FILE_OFFSET_BITS=64";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
libva
libpciaccess
intel-gmmlib
libdrm
] ++ lib.optional enableX11 libX11;
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
'';
passthru.tests = {
inherit (pkgsi686Linux) intel-media-driver;
};
meta = with lib; {
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.
'';
homepage = "https://github.com/intel/media-driver";
changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${version}";
license = with licenses; [
bsd3
mit
];
platforms = platforms.linux;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}