anchor.diff:    NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
   
     cmakeFlags = [
  -    "-DWITH_IPP=${if enableIpp then "ON" else "OFF"} -DWITH_OPENMP=ON"
  +    "-DBUILD_PROTOBUF=OFF"
  +    "-DPROTOBUF_UPDATE_FILES=ON"
  +    "-DWITH_OPENMP=ON"
  +    (opencvFlag "IPP" enableIpp)
       (opencvFlag "TIFF" enableTIFF)
       (opencvFlag "JASPER" enableJPEG2K)
       (opencvFlag "WEBP" enableWebP)
  
positive.code:   '';
  
    preConfigure =
      (let version  = "20151201";
           md5      = "808b791a6eac9ed78d32a7666804320e";
           sha256   = "1nph0w0pdcxwhdb5lxkb8whpwd9ylvwl97hn0k425amg80z86cs3";
           rev      = "81a676001ca8075ada498583e4166079e5744668";
           platform = if stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux" then "linux"
                      else throw "ICV is not available for this platform (or not yet supported by this package)";
           name = "ippicv_${platform}_${version}.tgz";
           ippicv = fetchurl {
             url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${rev}/ippicv/${name}";
             inherit sha256;
           };
           dir = "3rdparty/ippicv/downloads/${platform}-${md5}";
       in lib.optionalString enableIpp ''
            mkdir -p "${dir}"
            ln -s "${ippicv}" "${dir}/${name}"
          ''
      ) +
      (lib.optionalString buildContrib ''
        cmakeFlagsArray+=("-DOPENCV_EXTRA_MODULES_PATH=$NIX_BUILD_TOP/opencv_contrib")
      '');
  
    buildInputs =
         [ zlib ]
      ++ lib.optional enablePython pythonPackages.python
      ++ lib.optional enableGtk2 gtk2
      ++ lib.optional enableGtk3 gtk3
  
negative.code: { lib, stdenv
  , fetchurl, fetchFromGitHub
  , cmake, pkgconfig, unzip, zlib, pcre, hdf5, protobuf
  , config
  
  , enableJPEG      ? true, libjpeg
  , enablePNG       ? true, libpng
  