anchor.diff:  { stdenv
  +, runCommandCC
   , lib
   , fetchPypi
   , gcc
  -, writeScriptBin
   , buildPythonPackage
   , isPyPy
   , pythonOlder
  
positive.code:                    && cudnn != null;
  
  let
    extraFlags =
      lib.optionals cudaSupport [ "-I ${cudatoolkit}/include" "-L ${cudatoolkit}/lib" ]
      ++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ]
      ++ lib.optionals cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ];
  
    gcc_ = writeScriptBin "g++" ''
      #!${stdenv.shell}
      export NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST=1
      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${toString extraFlags}"
      exec ${gcc}/bin/g++ "$@"
    '';
  
    libgpuarray_ = libgpuarray.override { inherit cudaSupport cudatoolkit; };
  
  
negative.code: 
    postPatch = ''
      substituteInPlace theano/configdefaults.py \
        --replace 'StrParam(param, is_valid=warn_cxx)' 'StrParam('\'''${cxx_compiler}'\''', is_valid=warn_cxx)' \
        --replace 'rc == 0 and config.cxx != ""' 'config.cxx != ""'
    '' + stdenv.lib.optionalString cudaSupport ''
      substituteInPlace theano/configdefaults.py \
  