1{ stdenv, fetchurl, libvdpau, libGLU_combined, libva, pkgconfig }:
2let
3 libvdpau08patch = (fetchurl { url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-libvdpau-0.8.patch?revision=1.1";
4 name = "libva-vdpau-driver-0.7.4-libvdpau-0.8.patch";
5 sha256 = "1n2cys59wyv8ylx9i5m3s6856mgx24hzcp45w1ahdfbzdv9wrfbl";
6 });
7in
8stdenv.mkDerivation rec {
9 name = "libva-vdpau-driver-0.7.4";
10
11 src = fetchurl {
12 url = "https://www.freedesktop.org/software/vaapi/releases/libva-vdpau-driver/${name}.tar.bz2";
13 sha256 = "1fcvgshzyc50yb8qqm6v6wn23ghimay23ci0p8sm8gxcy211jp0m";
14 };
15
16 patches = [ ./glext85.patch
17 (fetchurl { url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch?revision=1.1";
18 name = "libva-vdpau-driver-0.7.4-VAEncH264VUIBufferType.patch";
19 sha256 = "166svcav6axkrlb3i4rbf6dkwjnqdf69xw339az1f5yabj72pqqs";
20 }) ];
21
22 nativeBuildInputs = [ pkgconfig ];
23 buildInputs = [ libvdpau libGLU_combined libva ];
24
25 preConfigure = ''
26 patch -p0 < ${libvdpau08patch} # use -p0 instead of -p1
27 sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
28 '';
29
30
31 meta = {
32 homepage = https://cgit.freedesktop.org/vaapi/vdpau-driver/;
33 license = stdenv.lib.licenses.gpl2Plus;
34 description = "VDPAU driver for the VAAPI library";
35 platforms = stdenv.lib.platforms.linux;
36 };
37}