anchor.diff:  
       cmakeFlags = [
         "-DAPP_RENDER_SYSTEM=${if useGbm then "gles" else "gl"}"
  -      "-Dlibdvdcss_URL=${libdvdcss.src}"
  -      "-Dlibdvdnav_URL=${libdvdnav.src}"
  -      "-Dlibdvdread_URL=${libdvdread.src}"
  +      "-Dlibdvdcss_URL=${libdvdcss}"
  +      "-Dlibdvdnav_URL=${libdvdnav}"
  +      "-Dlibdvdread_URL=${libdvdread}"
         "-DGIT_VERSION=${kodiReleaseDate}"
         "-DENABLE_EVENTCLIENTS=ON"
         "-DENABLE_INTERNAL_CROSSGUID=OFF"
  
positive.code:     sha256 = "097dg6a7v4ia85jx1pmlpwzdpqcqxlrmniqd005q73zvgj67zc2p";
    };
  
    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
        attrs' = builtins.removeAttrs attrs ["name" "version" "rev" "sha256"];
      in stdenv.mkDerivation ({
        name = "kodi-${lib.toLower name}-${version}";
        src = fetchFromGitHub {
          owner = "xbmc";
          repo  = name;
          inherit rev sha256;
        };
      } // attrs');
  
    ffmpeg = kodiDependency rec {
      name    = "FFmpeg";
      version = "4.3.1";
      rev     = "${version}-${rel}-Beta1";
      sha256  = "1c5rwlxn6xj501iw7masdv2p6wb9rkmd299lmlkx97sw1kvxvg2w";
      preConfigure = ''
        cp ${kodi_src}/tools/depends/target/ffmpeg/{CMakeLists.txt,*.cmake} .
        sed -i 's/ --cpu=''${CPU}//' CMakeLists.txt
  
negative.code: { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, makeWrapper
  , pkg-config, cmake, gnumake, yasm, python3Packages
  , libgcrypt, libgpgerror, libunistring
  , boost, avahi, lame
  