nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchFromGitHub,
6 autoreconfHook,
7 pkg-config,
8 cmrt,
9 libdrm,
10 libva,
11 libX11,
12 libGL,
13 wayland,
14}:
15
16stdenv.mkDerivation rec {
17 pname = "intel-hybrid-driver";
18 version = "1.0.2";
19
20 src = fetchFromGitHub {
21 owner = "intel";
22 repo = "intel-hybrid-driver";
23 rev = version;
24 sha256 = "sha256-uYX7RoU1XVzcC2ea3z/VBjmT47xmzK67Y4LaiFXyJZ8=";
25 };
26
27 patches = [
28 # driver_init: load libva-x11.so for any ABI version
29 (fetchurl {
30 url = "https://github.com/01org/intel-hybrid-driver/pull/26.diff";
31 sha256 = "1ql4mbi5x1d2a5c8mkjvciaq60zj8nhx912992winbhfkyvpb3gx";
32 })
33 ];
34
35 nativeBuildInputs = [
36 autoreconfHook
37 pkg-config
38 ];
39
40 buildInputs = [
41 cmrt
42 libdrm
43 libva
44 libX11
45 libGL
46 wayland
47 ];
48
49 enableParallelBuilding = true;
50
51 # Workaround build failure on -fno-common toolchains like upstream gcc-10.
52 env.NIX_CFLAGS_COMPILE = "-fcommon";
53
54 configureFlags = [
55 "--enable-drm"
56 "--enable-x11"
57 "--enable-wayland"
58 ];
59
60 postPatch = ''
61 patchShebangs ./src/shaders/gpp.py
62 '';
63
64 preConfigure = ''
65 sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
66 '';
67
68 meta = with lib; {
69 homepage = "https://01.org/linuxmedia";
70 description = "Intel driver for the VAAPI library with partial HW acceleration";
71 license = licenses.mit;
72 maintainers = with maintainers; [ tadfisher ];
73 platforms = platforms.linux;
74 };
75}