anchor.diff:      version           = "6.0.0";
       rev               = "${version}-${rel}-Alpha-3";
       sha256            = "0qwlf4lgahxqxk1r2pzl866mi03pbp7l1fc0rk522sc0ak2s9jhb";
  -    buildInputs       = [ libdvdread ];
  -    nativeBuildInputs = [ autoreconfHook pkgconfig ];
  +    buildInputs       = [ libdvdcss libdvdread ];
  +    nativeBuildInputs = [ cmake pkgconfig ];
  +    postPatch         = cmakeProtoPatch;
  +    postInstall = ''
  +      mv $out/lib/liblibdvdnav.so $out/lib/libdvdnav.so
  +    '';
     };
   
     libdvdread = kodiDependency rec {
  
positive.code: { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, makeWrapper
  , pkgconfig, cmake, gnumake, yasm, python2Packages
  , libgcrypt, libgpgerror, libunistring
  , boost, avahi, lame, autoreconfHook
  
negative.code: assert vdpauSupport -> libvdpau != null;
  assert useWayland -> wayland != null && wayland-protocols != null && waylandpp != null && libxkbcommon != null;
  
  let
    kodiReleaseDate = "20190627";
    kodiVersion = "18.3";
    rel = "Leia";
  
    kodi_src = fetchFromGitHub {
      owner  = "xbmc";
      repo   = "xbmc";
      rev    = "${kodiVersion}-${rel}";
      sha256 = "18fbl5hs3aqccrn0m3x7hp95wlafjav0yvrwmb5q3gj24mwf6jld";
    };
  
    cmakeProto = fetchurl {
      url = "https://raw.githubusercontent.com/pramsey/libght/ca9b1121c352ea10170636e170040e1af015bad1/cmake/modules/CheckPrototypeExists.cmake";
      sha256  = "1zai82gm5x55n3xvdv7mns3ja6a2k81x9zz0nk42j6s2yb0fkjxh";
    };
  
    cmakeProtoPatch = ''
      # get rid of windows headers as they will otherwise be found first
      rm -rf msvc
  
      cp ${cmakeProto} cmake/${cmakeProto.name}
      # we need to enable support for C++ for check_prototype_exists to do its thing
      substituteInPlace CMakeLists.txt --replace 'LANGUAGES C' 'LANGUAGES C CXX'
      if [ -f cmake/CheckHeadersSTDC.cmake ]; then
        sed -i cmake/CheckHeadersSTDC.cmake \
          -e '7iinclude(CheckPrototypeExists)'
      fi
    '';
  
    kodiDependency = { name, version, rev, sha256, ... } @attrs:
      let
  