1 { lib, stdenv, fetchurl, pkg-config, xorg, mesa, meson, ninja }:
3 stdenv.mkDerivation rec {
8 url = "https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/${version}/${pname}-${version}.tar.bz2";
9 sha256 = "sha256-pdUKQrjCiP68BxUatkOsjeBqGERpZcckH4m06BCCGRM=";
11 patches = [ ./tracing.patch ];
13 outputs = [ "out" "dev" ];
15 nativeBuildInputs = [ meson ninja pkg-config ];
16 buildInputs = with xorg; [ xorgproto libXext ];
18 propagatedBuildInputs = [ xorg.libX11 ];
20 mesonFlags = lib.optionals stdenv.hostPlatform.isLinux [ "-Dmoduledir=${mesa.driverLink}/lib/vdpau" ];
22 NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lX11";
24 # The tracing library in this package must be conditionally loaded with dlopen().
25 # Therefore, we must restore the RPATH entry for the library itself that was removed by the patchelf hook.
26 postFixup = lib.optionalString stdenv.hostPlatform.isElf ''
27 patchelf $out/lib/libvdpau.so --add-rpath $out/lib
31 homepage = "https://www.freedesktop.org/wiki/Software/VDPAU/";
32 description = "Library to use the Video Decode and Presentation API for Unix (VDPAU)";
33 license = licenses.mit; # expat version
34 platforms = platforms.unix;
35 maintainers = [ maintainers.vcunat ];