anchor.diff:  
         ${installExtraFiles vgg}
         ${installExtraFiles boostdesc}
  +      ${installExtraFiles face}
   
         mkdir -p "${tinyDnn.dst}"
         ln -s "${tinyDnn.src}" "${tinyDnn.dst}/${tinyDnn.md5}-${tinyDnn.name}"
       '');
   
     buildInputs =
  -       [ zlib pcre hdf5 ]
  +       [ zlib pcre hdf5 glog boost google-gflags protobuf ]
  +    ++ lib.optional (!stdenv.isDarwin) caffe
       ++ lib.optional enablePython pythonPackages.python
       ++ lib.optional enableGtk2 gtk2
       ++ lib.optional enableGtk3 gtk3
  +    ++ lib.optional enableVtk vtk
       ++ lib.optional enableJPEG libjpeg
       ++ lib.optional enablePNG libpng
       ++ lib.optional enableTIFF libtiff
  
positive.code:   ] ++ lib.optionals enableCuda [
      "-DCUDA_FAST_MATH=ON"
      "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc"
    ] ++ lib.optionals buildContrib [
           # the cnn_3dobj module fails to build
           "-DBUILD_opencv_cnn_3dobj=OFF"
  
           # the dnn_modern module causes:
           # https://github.com/opencv/opencv_contrib/issues/823
           #
           # On OS X its dependency tiny-dnn-1.0.0a3 also fails to build.
           "-DBUILD_opencv_dnn_modern=OFF"
         ]
      ++ lib.optionals stdenv.isDarwin ["-DWITH_OPENCL=OFF" "-DWITH_LAPACK=OFF"];
  
    enableParallelBuilding = true;
  
negative.code:     dst = ".cache/xfeatures2d/boostdesc";
    };
  
    # See opencv_contrib/modules/face/CMakeLists.txt
    face = {
      src = fetchFromGitHub {
        owner  = "opencv";
        repo   = "opencv_3rdparty";
        rev    = "8afa57abc8229d611c4937165d20e2a2d9fc5a12";
        sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v";
      };
      files = {
        "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05";
      };
      dst = ".cache/data";
    };
  
    # See opencv/cmake/OpenCVDownload.cmake
    installExtraFiles = extra : with lib; ''
      mkdir -p "${extra.dst}"
  