anchor.diff:      # I'm guessing there is a thing waiting to time out
       doCheck = false;
   
  +    # Need these tools on the build system when cross compiling,
  +    # hacky, but have found no other way.
  +    preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
  +      CXX=c++ LD=ld make -C tools/depends/native/JsonSchemaBuilder
  +      cmakeFlags+=" -DWITH_JSONSCHEMABUILDER=$PWD/tools/depends/native/JsonSchemaBuilder/bin"
  +
  +      CXX=c++ LD=ld make EXTRA_CONFIGURE= -C tools/depends/native/TexturePacker
  +      cmakeFlags+=" -DWITH_TEXTUREPACKER=$PWD/tools/depends/native/TexturePacker/bin"
  +    '';
  +
       postPatch = ''
         substituteInPlace xbmc/platform/linux/LinuxTimezone.cpp \
           --replace 'usr/share/zoneinfo' 'etc/zoneinfo'
  
positive.code:     ++ lib.optional  usbSupport      libusb
      ++ lib.optional  vdpauSupport    libvdpau
      ++ lib.optionals useWayland [
        wayland waylandpp
        # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise
        libxkbcommon.dev
      ]
  
negative.code:       "-DENABLE_EVENTCLIENTS=ON"
        "-DENABLE_INTERNAL_CROSSGUID=OFF"
        "-DENABLE_OPTICAL=ON"
        "-DLIRC_DEVICE=/run/lirc/lircd"
        "-DSWIG_EXECUTABLE=${buildPackages.swig}/bin/swig"
        "-DFLATBUFFERS_FLATC_EXECUTABLE=${buildPackages.flatbuffers}/bin/flatc"
        "-DPYTHON_EXECUTABLE=${buildPackages.python2Packages.python}/bin/python"
      ] ++ lib.optional useWayland [
        "-DCORE_PLATFORM_NAME=wayland"
        "-DWAYLAND_RENDER_SYSTEM=gl"
        "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++"
      ] ++ lib.optional useGbm [
        "-DCORE_PLATFORM_NAME=gbm"
        "-DGBM_RENDER_SYSTEM=gles"
  