anchor.diff:    postUnpack = lib.optionalString buildContrib ''
       cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
     '';
  -
  -  patches = [
  -    (fetchpatch {
  -      url = "https://github.com/opencv/opencv/commit/5691d998ead1d9b0542bcfced36c2dceb3a59023.patch";
  -      name = "CVE-2019-14493.patch";
  -      sha256 = "14qva9f5z10apz5q0skdyiclr9sgkhab4fzksy1w3b6j6hg4wm7m";
  -    })
  -  ];
   
     # This prevents cmake from using libraries in impure paths (which
     # causes build failure on non NixOS)
  
positive.code: }:
  
  let
    version = "4.1.0";
  
    src = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv";
      rev    = version;
      sha256 = "0m1f51m11iz4vxfrmnhawksd669ld247rlfdq5fhkvfk3r7aidw6";
    };
  
    contribSrc = fetchFromGitHub {
      owner  = "opencv";
      repo   = "opencv_contrib";
      rev    = version;
      sha256 = "1phmmba96m5znjf3wxwhxavgzgp3bs5qqsjk9ay1i63rdacz4vlf";
    };
  
    # Contrib must be built in order to enable Tesseract support:
  
negative.code:   ade = rec {
      src = fetchurl {
        url = "https://github.com/opencv/ade/archive/${name}";
        sha256 = "04n9na2bph706bdxnnqfcbga4cyj8kd9s9ni7qyvnpj5v98jwvlm";
      };
      name = "v0.1.1f.zip";
      md5 = "b624b995ec9c439cbc2e9e6ee940d3a2";
      dst = ".cache/ade";
    };
  
  