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:     src = fetchFromGitHub {
        owner  = "opencv";
        repo   = "opencv_3rdparty";
        rev    = "bdb7bb85f34a8cb0d35e40a81f58da431aa1557a";
        sha256 = "1ys9mshfpm8iy8h4ml792gnqrq959dsrcv26axx14niivxyjbji8";
      } + "/ippicv";
      files = let name = platform : "ippicv_2017u3_${platform}_general_20180518.tgz"; in
        if stdenv.hostPlatform.system == "x86_64-linux" then
        { ${name "lnx_intel64"} = "b7cc351267db2d34b9efa1cd22ff0572"; }
        else if stdenv.hostPlatform.system == "i686-linux" then
        { ${name "lnx_ia32"}    = "ea72de74dae3c604eb6348395366e78e"; }
        else if stdenv.hostPlatform.system == "x86_64-darwin" then
        { ${name "mac_intel64"} = "3ae52b9be0fe73dd45bc5e9429cd3732"; }
        else
        throw "ICV is not available for this platform (or not yet supported by this package)";
      dst = ".cache/ippicv";
  
negative.code: }:
  
  let
    version = "3.4.7";
  
    src = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv";
      rev    = version;
      sha256 = "0r5rrcnqx2lsnr1ja5ij2chb7yk9kkamr4p0ik52sqxydwkv3z50";
    };
  
    contribSrc = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv_contrib";
      rev    = version;
      sha256 = "1ik6acsmgrx66awf19r2y3ijqvv9xg43gaphwszbiyi0jq3r43yw";
    };
  
    # Contrib must be built in order to enable Tesseract support:
  