From d7a0becf3709d3da1da00f74b34c19cdfbbb918f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 11 Sep 2015 14:48:33 +0200 Subject: [PATCH] opencv3: add enableContrib flag If true, enable the repository of extra modules for OpenCV. Build tested. Based on patch from Bas van Dijk . --- pkgs/development/libraries/opencv/3.x.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 365f11f88f0f..4a58ae43bb7a 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -1,9 +1,19 @@ -{ lib, stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg +{ lib, stdenv, fetchurl, fetchzip, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg , fetchpatch, pkgconfig, gstreamer, xineLib, glib, python27, python27Packages, unzip , enableIpp ? false +, enableContrib ? false , enableBloat ? false }: -let v = "3.0.0"; in +let + v = "3.0.0"; + + contribSrc = fetchzip { + url = "https://github.com/Itseez/opencv_contrib/archive/3.0.0.tar.gz"; + sha256 = "1gx7f9v85hmzh37s0zaillg7bs6cy9prm3wl0jb5zc5zrf9d8bm8"; + name = "opencv-contrib-3.0.0-src"; + }; + +in stdenv.mkDerivation rec { name = "opencv-${v}"; @@ -33,7 +43,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkgconfig ]; - cmakeFlags = [ "-DWITH_IPP=${if enableIpp then "ON" else "OFF"}" ]; + cmakeFlags = [ + "-DWITH_IPP=${if enableIpp then "ON" else "OFF"}" + ] ++ stdenv.lib.optionals enableContrib [ "-DOPENCV_EXTRA_MODULES_PATH=${contribSrc}/modules" ]; enableParallelBuilding = true;