1{ stdenv
2, fetchFromGitHub
3, lib
4, meson
5, ninja
6, pkg-config
7, libdrm
8, libGL
9, gst_all_1
10, nv-codec-headers-11
11, libva
12, addOpenGLRunpath
13}:
14
15stdenv.mkDerivation rec {
16 pname = "nvidia-vaapi-driver";
17 version = "0.0.9";
18
19 src = fetchFromGitHub {
20 owner = "elFarto";
21 repo = pname;
22 rev = "v${version}";
23 sha256 = "sha256-mQtprgm6QonYiMUPPIcCbWxPQ/b2XuQiOkROZNPYaQk=";
24 };
25
26 nativeBuildInputs = [
27 meson
28 ninja
29 pkg-config
30 addOpenGLRunpath
31 ];
32
33 buildInputs = [
34 libdrm
35 libGL
36 gst_all_1.gstreamer
37 gst_all_1.gst-plugins-bad
38 nv-codec-headers-11
39 libva
40 ];
41
42 # Note: Attempt to remove on next release after 0.0.9
43 # nixpkgs reference: https://github.com/NixOS/nixpkgs/pull/221978#issuecomment-1483892437
44 # upstream: https://github.com/elFarto/nvidia-vaapi-driver/issues/188
45 NIX_CFLAGS_COMPILE = [
46 "-Wno-error=format="
47 "-Wno-error=int-conversion"
48 ];
49
50 postFixup = ''
51 addOpenGLRunpath "$out/lib/dri/nvidia_drv_video.so"
52 '';
53
54 meta = with lib;{
55 homepage = "https://github.com/elFarto/nvidia-vaapi-driver";
56 description = "A VA-API implemention using NVIDIA's NVDEC";
57 changelog = "https://github.com/elFarto/nvidia-vaapi-driver/releases/tag/v${version}";
58 license = licenses.mit;
59 maintainers = with maintainers;[ nickcao ];
60 };
61}