opencv3: Enable darwin build

This commit is contained in:
Josef Kemetmueller 2017-04-25 21:44:28 +02:00
parent fce59d47e7
commit 68c6e5bc8b
2 changed files with 9 additions and 5 deletions

View file

@ -4,7 +4,7 @@
, enablePNG ? true, libpng , enablePNG ? true, libpng
, enableTIFF ? true, libtiff , enableTIFF ? true, libtiff
, enableWebP ? true, libwebp , enableWebP ? true, libwebp
, enableEXR ? true, openexr, ilmbase , enableEXR ? (!stdenv.isDarwin), openexr, ilmbase
, enableJPEG2K ? true, jasper , enableJPEG2K ? true, jasper
, enableIpp ? false , enableIpp ? false
@ -16,6 +16,7 @@
, enableGStreamer ? false, gst_all_1 , enableGStreamer ? false, gst_all_1
, enableEigen ? false, eigen , enableEigen ? false, eigen
, enableCuda ? false, cudatoolkit, gcc5 , enableCuda ? false, cudatoolkit, gcc5
, AVFoundation, Cocoa, QTKit
}: }:
let let
@ -115,7 +116,7 @@ stdenv.mkDerivation rec {
++ lib.optional enableEigen eigen ++ lib.optional enableEigen eigen
++ lib.optionals enableCuda [ cudatoolkit gcc5 ] ++ lib.optionals enableCuda [ cudatoolkit gcc5 ]
++ lib.optional enableContrib protobuf3_1 ++ lib.optional enableContrib protobuf3_1
; ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ];
propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy; propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
@ -134,7 +135,8 @@ stdenv.mkDerivation rec {
(opencvFlag "CUDA" enableCuda) (opencvFlag "CUDA" enableCuda)
(opencvFlag "CUBLAS" enableCuda) (opencvFlag "CUBLAS" enableCuda)
] ++ lib.optionals enableCuda [ "-DCUDA_FAST_MATH=ON" ] ] ++ 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; enableParallelBuilding = true;
@ -147,6 +149,6 @@ stdenv.mkDerivation rec {
homepage = http://opencv.org/; homepage = http://opencv.org/;
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [viric flosse mdaiter]; maintainers = with stdenv.lib.maintainers; [viric flosse mdaiter];
platforms = with stdenv.lib.platforms; linux; platforms = with stdenv.lib.platforms; linux ++ darwin;
}; };
} }

View file

@ -9289,7 +9289,9 @@ with pkgs;
ffmpeg = ffmpeg_2; 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 # this ctl version is needed by openexr_viewers
openexr_ctl = ctl; openexr_ctl = ctl;