anchor.diff:    postUnpack = lib.optionalString buildContrib ''
       cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
     '';
  -
  -  patches =
  -    # Fixes issue: https://github.com/opencv/opencv_contrib/issues/1923
  -    # PR: https://github.com/opencv/opencv_contrib/pull/1913
  -    lib.optional buildContrib (fetchpatch {
  -      url = https://github.com/opencv/opencv_contrib/commit/e068b62a1432d4d5688693a9e20bf175dfaa9a3e.patch;
  -      sha256 = "102mq1qgmla40hhj8mda70inhakdazm9agyah98kq9931scvf0c9";
  -      stripLen = 2;
  -      extraPrefix = "opencv_contrib/";
  -    });
   
     # This prevents cmake from using libraries in impure paths (which
     # causes build failure on non NixOS)
  
positive.code: { lib, stdenv
  , fetchurl, fetchFromGitHub, fetchpatch
  , cmake, pkgconfig, unzip, zlib, pcre, hdf5
  , glog, boost, google-gflags, protobuf
  , config
  
negative.code:   contribSrc = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv_contrib";
      rev    = version;
      sha256 = "0svw8f6nvnzmrc0baj6priq4hbijla4kl6gzy8yif1jfvcwb1syy";
    };
  
    # Contrib must be built in order to enable Tesseract support:
  