diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index af0456c0162b..52afa08f0317 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -4,7 +4,7 @@ , enablePNG ? true, libpng , enableTIFF ? true, libtiff , enableWebP ? true, libwebp -, enableEXR ? true, openexr, ilmbase +, enableEXR ? (!stdenv.isDarwin), openexr, ilmbase , enableJPEG2K ? true, jasper , enableIpp ? false @@ -16,6 +16,7 @@ , enableGStreamer ? false, gst_all_1 , enableEigen ? false, eigen , enableCuda ? false, cudatoolkit, gcc5 +, AVFoundation, Cocoa, QTKit }: let @@ -115,7 +116,7 @@ stdenv.mkDerivation rec { ++ lib.optional enableEigen eigen ++ lib.optionals enableCuda [ cudatoolkit gcc5 ] ++ lib.optional enableContrib protobuf3_1 - ; + ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ]; propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy; @@ -134,7 +135,8 @@ stdenv.mkDerivation rec { (opencvFlag "CUDA" enableCuda) (opencvFlag "CUBLAS" enableCuda) ] ++ lib.optionals enableCuda [ "-DCUDA_FAST_MATH=ON" ] - ++ lib.optional enableContrib "-DBUILD_PROTOBUF=off"; + ++ lib.optional enableContrib "-DBUILD_PROTOBUF=off" + ++ lib.optionals stdenv.isDarwin ["-DWITH_OPENCL=OFF" "-DWITH_LAPACK=OFF"]; enableParallelBuilding = true; @@ -147,6 +149,6 @@ stdenv.mkDerivation rec { homepage = http://opencv.org/; license = stdenv.lib.licenses.bsd3; maintainers = with stdenv.lib.maintainers; [viric flosse mdaiter]; - platforms = with stdenv.lib.platforms; linux; + platforms = with stdenv.lib.platforms; linux ++ darwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b3afc20e8cd..4e4fa5477262 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9326,7 +9326,9 @@ with pkgs; ffmpeg = ffmpeg_2; }; - opencv3 = callPackage ../development/libraries/opencv/3.x.nix { }; + opencv3 = callPackage ../development/libraries/opencv/3.x.nix { + inherit (darwin.apple_sdk.frameworks) AVFoundation Cocoa QTKit; + }; # this ctl version is needed by openexr_viewers openexr_ctl = ctl;