anchor.diff:  , enableEigen     ? false, eigen
   , enableOpenblas  ? false, openblas
   , enableCuda      ? false, cudatoolkit, gcc5
  +, enableTesseract ? false, tesseract, leptonica
   , AVFoundation, Cocoa, QTKit
   }:
   
  
positive.code:   inherit version src;
  
    postUnpack =
      (lib.optionalString enableContrib ''
        cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/opencv_contrib"
  
        # This fixes the build on OS X.
  
negative.code:     ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
      ++ lib.optional enableEigen eigen
      ++ lib.optional enableOpenblas openblas
      # There is seemingly no compile-time flag for Tesseract.  It's
      # simply enabled automatically if contrib is built, and it detects
      # tesseract & leptonica.
      ++ lib.optionals enableTesseract [ tesseract leptonica ]
      ++ lib.optionals enableCuda [ cudatoolkit gcc5 ]
      ++ lib.optional buildContrib protobuf3_1
      ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ];
  
    propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
  