anchor.diff:      "-DBUILD_opencv_videoio=OFF"
     ] ++ lib.optionals enablePython [
       "-DOPENCV_SKIP_PYTHON_LOADER=ON"
  +  ] ++ lib.optional enableEigen [
  +    # Autodetection broken by https://github.com/opencv/opencv/pull/13337
  +    "-DEIGEN_INCLUDE_PATH=${eigen}/include/eigen3"
     ];
   
     enableParallelBuilding = true;
  
positive.code: }:
  
  let
    version = "3.4.6";
  
    src = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv";
      rev    = version;
      sha256 = "1gf0rbgd5s13q46bdna0bqn4yz9rxfhvlhbp5ds9hs326q8zprg8";
    };
  
    contribSrc = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv_contrib";
      rev    = version;
      sha256 = "115qcq0k2wmvhxw5lyv14yrd8m6xq3qy0pdby90ml2yl1caymbfy";
    };
  
    # Contrib must be built in order to enable Tesseract support:
  
negative.code:     src = fetchFromGitHub {
        owner  = "opencv";
        repo   = "opencv_3rdparty";
        rev    = "32e315a5b106a7b89dbed51c28f8120a48b368b4";
        sha256 = "19w9f0r16072s59diqxsr5q6nmwyz9gnxjs49nglzhd66p3ddbkp";
      } + "/ippicv";
      files = let name = platform : "ippicv_2019_${platform}_general_20180723.tgz"; in
        if stdenv.hostPlatform.system == "x86_64-linux" then
        { ${name "lnx_intel64"} = "c0bd78adb4156bbf552c1dfe90599607"; }
        else if stdenv.hostPlatform.system == "i686-linux" then
        { ${name "lnx_ia32"}    = "4f38432c30bfd6423164b7a24bbc98a0"; }
        else if stdenv.hostPlatform.system == "x86_64-darwin" then
        { ${name "mac_intel64"} = "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2"; }
        else
        throw "ICV is not available for this platform (or not yet supported by this package)";
      dst = ".cache/ippicv";
  