anchor.diff: -{ stdenv, lib, fetchgit, cmake
  -, opencv, gtest, openblas, liblapack
  +{ stdenv, lib, fetchurl, bash, cmake
  +, opencv, gtest, openblas, liblapack, perl
   , cudaSupport ? false, cudatoolkit, nvidia_x11
   , cudnnSupport ? false, cudnn
   }:
  
positive.code:       "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
      ] else [ "-DUSE_CUDA=OFF" ])
      ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
  
    installPhase = ''
      install -Dm755 libmxnet.so $out/lib/libmxnet.so
  
negative.code: 
  stdenv.mkDerivation rec {
    name = "mxnet-${version}";
    version = "1.2.1";
  
    # Fetching from git does not work at the time (1.2.1) due to an
    # incorrect hash in one of the submodules. The provided tarballs
    # contain all necessary sources.
    src = fetchurl {
      url = "https://github.com/apache/incubator-mxnet/releases/download/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
      sha256 = "053zbdgs4j8l79ipdz461zc7wyfbfcflmi5bw7lj2q08zm1glnb2";
    };
  
    nativeBuildInputs = [ cmake perl ];
  
    buildInputs = [ opencv gtest openblas liblapack ]
                ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
  