summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/in/intel-vaapi-driver/package.nix
blob: ab09fdabff439ccbb427c75e41c020a83e40ec77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
  lib,
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  gnum4,
  pkg-config,
  python3,
  wayland-scanner,
  intel-gpu-tools,
  libdrm,
  libva,
  libx11,
  libGL,
  wayland,
  libxext,
  enableHybridCodec ? false,
  vaapi-intel-hybrid,
  enableGui ? true,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "intel-vaapi-driver";
  version = "2.4.5";

  src = fetchFromGitHub {
    owner = "irql-notlessorequal";
    repo = "intel-vaapi-driver";
    tag = finalAttrs.version;
    hash = "sha256-exQBA42jCmwybE7WIfF83cjmzBdtluDzUtOdqt49HSg=";
  };

  # Set the correct install path:
  env.LIBVA_DRIVERS_PATH = "${placeholder "out"}/lib/dri";

  postInstall = lib.optionalString enableHybridCodec ''
    ln -s ${vaapi-intel-hybrid}/lib/dri/* $out/lib/dri/
  '';

  configureFlags = [
    (lib.enableFeature enableGui "x11")
    (lib.enableFeature enableGui "wayland")
  ]
  ++ lib.optional enableHybridCodec "--enable-hybrid-codec";

  nativeBuildInputs = [
    autoreconfHook
    gnum4
    pkg-config
    python3
    wayland-scanner
  ];

  buildInputs = [
    intel-gpu-tools
    libdrm
    libva
  ]
  ++ lib.optionals enableGui [
    libx11
    libxext
    libGL
    wayland
  ]
  ++ lib.optional enableHybridCodec vaapi-intel-hybrid;

  enableParallelBuilding = true;

  passthru.updateScript = nix-update-script { };

  meta = {
    homepage = "https://github.com/irql-notlessorequal/intel-vaapi-driver";
    changelog = "https://github.com/irql-notlessorequal/intel-vaapi-driver/blob/${finalAttrs.src.tag}/NEWS";
    license = lib.licenses.mit;
    description = "VA-API user mode driver for Intel GEN Graphics family";
    longDescription = ''
      This VA-API video driver backend provides a bridge to the GEN GPUs through
      the packaging of buffers and commands to be sent to the i915 driver for
      exercising both hardware and shader functionality for video decode,
      encode, and processing.
      VA-API is an open-source library and API specification, which provides
      access to graphics hardware acceleration capabilities for video
      processing. It consists of a main library and driver-specific acceleration
      backends for each supported hardware vendor.
    '';
    platforms = [
      "x86_64-linux"
      "i686-linux"
    ];
    maintainers = with lib.maintainers; [ SuperSandro2000 ];
  };
})