anchor.diff:    ] ++ 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;
  
positive.code:     dst = ".cache/xfeatures2d/boostdesc";
    };
  
    # See opencv/cmake/OpenCVDownload.cmake
    installExtraFiles = extra : with lib; ''
      mkdir -p "${extra.dst}"
  
negative.code:     ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
                       [ VideoDecodeAcceleration bzip2 ]
      ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
      ++ lib.optional enableOvis ogre
      ++ lib.optional enableGPhoto2 libgphoto2
      ++ lib.optional enableDC1394 libdc1394
      ++ lib.optional enableEigen eigen
      ++ lib.optional enableOpenblas openblas
      # There is seemingly no compile-time flag for Tesseract.  It's
  