@@ -0,0 +1,63 @@
1+{ stdenv, fetchurl, lib, vdr
2+, libav, libcap, libvdpau
3+, xineLib, libjpeg, libextractor, mesa_noglu, libGLU
4+, libX11, libXext, libXrender, libXrandr
5+, makeWrapper
6+}: let
7+ name = "vdr-xineliboutput-2.1.0";
8+
9+ makeXinePluginPath = l: lib.concatStringsSep ":" (map (p: "${p}/lib/xine/plugins") l);
10+
11+ self = stdenv.mkDerivation {
12+ inherit name;
13+
14+ src = fetchurl {
15+ name = "src.tgz";
16+ url = "https://sourceforge.net/projects/xineliboutput/files/xineliboutput/${name}/${name}.tgz/download";
17+ sha256 = "6af99450ad0792bd646c6f4058f6e49541aab8ba3a10e131f82752f4d5ed19de";
18+ };
19+
20+ configurePhase = ''
21+ ./configure
22+ sed -i config.mak \
23+ -e 's,XINEPLUGINDIR=/[^/]*/[^/]*/[^/]*/,XINEPLUGINDIR=/,'
24+ '';
25+
26+ makeFlags = [ "DESTDIR=$(out)" ];
27+
28+ postFixup = ''
29+ for f in $out/bin/*; do
30+ wrapProgram $f \
31+ --prefix XINE_PLUGIN_PATH ":" "${makeXinePluginPath [ "$out" xineLib ]}"
32+ done
33+ '';
34+
35+ nativeBuildInputs = [ makeWrapper ];
36+
37+ buildInputs = [
38+ libav
39+ libcap
40+ libextractor
41+ libjpeg
42+ libGLU
43+ libvdpau
44+ libXext
45+ libXrandr
46+ libXrender
47+ libX11
48+ mesa_noglu
49+ vdr
50+ xineLib
51+ ];
52+
53+ passthru.requiredXinePlugins = [ xineLib self ];
54+
55+ meta = with lib;{
56+ homepage = https://sourceforge.net/projects/xineliboutput/;
57+ description = "xine-lib based software output device for VDR.";
58+ maintainers = [ maintainers.ck3d ];
59+ license = licenses.gpl2;
60+ platforms = [ "i686-linux" "x86_64-linux" ];
61+ };
62+ };
63+in self