git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #33225 from LumiGuide/opencv-3.4.0

opencv: 3.3.1 -> 3.4.0

commit2f6b88551ba76eaf7ec1f0cf9dec02c3ffb284f7 authorOrivej Desh <orivej@gmx.fr> dateThu 11 Jan 2018, 08:29 (9 years ago) parent8753b109bafe42
6 files changed+143−52
pkgs/applications/graphics/digikam/default.nix+8−21 pkgs/development/libraries/ogre/1.9.x.nix+46 pkgs/development/libraries/ogre/default.nix+3−3 pkgs/development/libraries/ogrepaged/default.nix+18−1 pkgs/development/libraries/opencv/3.x.nix+55−25 pkgs/top-level/all-packages.nix+13−2
pkgs/applications/graphics/digikam/default.nix+8−21
@@ -1,4 +1,4 @@
1−{ mkDerivation, lib, fetchurl, cmake, doxygen, extra-cmake-modules, wrapGAppsHook, fetchpatch
1+{ mkDerivation, lib, fetchFromGitHub, cmake, doxygen, extra-cmake-modules, wrapGAppsHook, fetchpatch
22
33# For `digitaglinktree`
44, perl, sqlite
@@ -50,11 +50,13 @@
5050
5151mkDerivation rec {
5252 name = "digikam-${version}";
53− version = "5.7.0";
53+ version = "5.8.0";
5454
55− src = fetchurl {
56− url = "mirror://kde/stable/digikam/${name}.tar.xz";
57− sha256 = "1xah079g47fih8l9qy1ifppfvmq5yms5y1z54nvxdyz8nsszy19n";
55+ src = fetchFromGitHub {
56+ owner = "KDE";
57+ repo = "digikam";
58+ rev = "v${version}";
59+ sha256 = "1bvidg0fn92xvw5brhb34lm7m4iy4jb5xpvnhbgh8vik2m4n41w1";
5860 };
5961
6062 nativeBuildInputs = [ cmake doxygen extra-cmake-modules kdoctools wrapGAppsHook ];
@@ -83,8 +85,7 @@ mkDerivation rec {
8385 qtsvg
8486 qtwebkit
8587
86− # https://bugs.kde.org/show_bug.cgi?id=387960
87− #kcalcore
88+ kcalcore
8889 kconfigwidgets
8990 kcoreaddons
9091 kfilemetadata
@@ -112,20 +113,6 @@ mkDerivation rec {
112113 --replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3"
113114 '';
114115
115− patches = [
116− # fix Qt-5.9.3 empty album problem
117− (fetchpatch {
118− url = "https://cgit.kde.org/digikam.git/patch/?id=855ba5b7d4bc6337234720a72ea824ddd3b32e5b";
119− sha256 = "0zk8p182piy6xn9v0mhwawya9ciq596vql1qc3lgnx371a97mmni";
120− })
121− ];
122−
123− patchFlags = "-d core -p1";
124−
125− # `en make -f core/utilities/assistants/expoblending/CMakeFiles/expoblending_src.dir/build.make core/utilities/assistants/expoblending/CMakeFiles/expoblending_src.dir/manager/expoblendingthread.cpp.o`:
126− # digikam_version.h:37:24: fatal error: gitversion.h: No such file or directory
127− enableParallelBuilding = false;
128−
129116 meta = with lib; {
130117 description = "Photo Management Program";
131118 license = licenses.gpl2;
pkgs/development/libraries/ogre/1.9.x.nixnew file+46
@@ -0,0 +1,46 @@
1+{ fetchFromGitHub, stdenv, lib
2+, cmake, mesa
3+, freetype, freeimage, zziplib, randrproto, libXrandr
4+, libXaw, freeglut, libXt, libpng, boost, ois
5+, xproto, libX11, libXmu, libSM, pkgconfig
6+, libXxf86vm, xf86vidmodeproto, libICE
7+, renderproto, libXrender
8+, withNvidiaCg ? false, nvidia_cg_toolkit
9+, withSamples ? false }:
10+
11+stdenv.mkDerivation rec {
12+ pname = "ogre";
13+ version = "1.9.1";
14+ name = "${pname}-${version}";
15+
16+ src = fetchFromGitHub {
17+ owner = "OGRECave";
18+ repo = "ogre";
19+ rev = "v${version}";
20+ sha256 = "11lfgzqaps3728dswrq3cbwk7aicigyz08q4hfyy6ikc6m35r4wg";
21+ };
22+
23+ cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
24+ ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
25+ ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
26+ ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
27+
28+ enableParallelBuilding = true;
29+
30+ buildInputs =
31+ [ cmake mesa
32+ freetype freeimage zziplib randrproto libXrandr
33+ libXaw freeglut libXt libpng boost ois
34+ xproto libX11 libXmu libSM pkgconfig
35+ libXxf86vm xf86vidmodeproto libICE
36+ renderproto libXrender
37+ ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
38+
39+ meta = {
40+ description = "A 3D engine";
41+ homepage = http://www.ogre3d.org/;
42+ maintainers = [ stdenv.lib.maintainers.raskin ];
43+ platforms = stdenv.lib.platforms.linux;
44+ license = stdenv.lib.licenses.mit;
45+ };
46+}
pkgs/development/libraries/ogre/default.nix+3−3
@@ -9,11 +9,11 @@
99, withSamples ? false }:
1010
1111stdenv.mkDerivation {
12− name = "ogre-1.9-hg-20160322";
12+ name = "ogre-1.10.11";
1313
1414 src = fetchurl {
15− url = "https://bitbucket.org/sinbad/ogre/get/v1-9.tar.gz";
16− sha256 = "0w3argjy1biaxwa3c80zxxgll67wjp8czd83p87awlcvwzdk5mz9";
15+ url = "https://bitbucket.org/sinbad/ogre/get/v1-10-11.tar.gz";
16+ sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
1717 };
1818
1919 cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
pkgs/development/libraries/ogrepaged/default.nix+18−1
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, cmake, pkgconfig, ois, ogre, libX11, boost }:
1+{ stdenv, fetchurl, fetchpatch, cmake, pkgconfig, ois, ogre, libX11, boost }:
22
33stdenv.mkDerivation rec {
44 name = "ogre-paged-${version}";
@@ -9,6 +9,23 @@ stdenv.mkDerivation rec {
99 sha256 = "17j7rw9wbkynxbhm2lay3qgjnnagb2vd5jn9iijnn2lf8qzbgy82";
1010 };
1111
12+ patches = [
13+ # These patches come from https://github.com/RigsOfRods/ogre-pagedgeometry/pull/6
14+ # and make ogre-paged build with ogre-1.10.
15+ (fetchpatch {
16+ url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/2d4df577decba37ec3cdafc965deae0f6d31fe45.patch";
17+ sha256 = "0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73";
18+ })
19+ (fetchpatch {
20+ url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/4d81789ec6f55e294a5ad040ea7abe2b415cbc92.patch";
21+ sha256 = "17q8djdz2y3g46azxc3idhyvi6vf0sqkxld4bbyp3l9zn7dq76rp";
22+ })
23+ (fetchpatch {
24+ url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/10f7c5ce5b422e9cbac59d466f3567a24c8831a4.patch";
25+ sha256 = "1kk0dbadzg73ai99l3w04q51sil36vzbkaqc79mdwy0vjrn4ardb";
26+ })
27+ ];
28+
1229 buildInputs = [ ois ogre libX11 boost ];
1330 nativeBuildInputs = [ cmake pkgconfig ];
1431
pkgs/development/libraries/opencv/3.x.nix+55−25
@@ -1,6 +1,7 @@
11{ lib, stdenv
2−, fetchurl, fetchFromGitHub
2+, fetchurl, fetchFromGitHub, fetchpatch
33, cmake, pkgconfig, unzip, zlib, pcre, hdf5
4+, caffe, glog, boost, google-gflags, protobuf
45, config
56
67, enableJPEG ? true, libjpeg
@@ -14,34 +15,39 @@
1415
1516, enableCuda ? (config.cudaSupport or false), cudatoolkit
1617
18+, enableUnfree ? false
1719, enableIpp ? false
18−, enableContrib ? false #, caffe, glog, boost, google-gflags
20+, enableContrib ? false
1921, enablePython ? false, pythonPackages
2022, enableGtk2 ? false, gtk2
2123, enableGtk3 ? false, gtk3
24+, enableVtk ? false, vtk
2225, enableFfmpeg ? false, ffmpeg
2326, enableGStreamer ? false, gst_all_1
2427, enableTesseract ? false, tesseract, leptonica
28+, enableOvis ? false, ogre
29+, enableGPhoto2 ? false, libgphoto2
30+, enableDC1394 ? false, libdc1394
2531, enableDocs ? false, doxygen, graphviz-nox
2632
2733, AVFoundation, Cocoa, QTKit, VideoDecodeAcceleration, bzip2
2834}:
2935
3036let
31− version = "3.3.1";
37+ version = "3.4.0";
3238
3339 src = fetchFromGitHub {
3440 owner = "opencv";
3541 repo = "opencv";
3642 rev = version;
37− sha256 = "1jq8nny78gp54yjgsnb2rdp5rwhp78b3r2i36b2vyx6xk6h6wwji";
43+ sha256 = "1nc14kvsjwaisv7d1r6f0hn7na9zr2cm2zh3hd3r9qwm3g78xnac";
3844 };
3945
4046 contribSrc = fetchFromGitHub {
4147 owner = "opencv";
4248 repo = "opencv_contrib";
4349 rev = version;
44− sha256 = "0q5vsa8dpa3mdhzas0ckagwh2sbckpm1kxsp0i3yfknsr5ampyi2";
50+ sha256 = "1cxw7nra3f1hng057c6hi1ynsyqdazd69irjdgn8xjg6q9h76br0";
4551 };
4652
4753 # Contrib must be built in order to enable Tesseract support:
@@ -104,6 +110,20 @@ let
104110 dst = ".cache/xfeatures2d/boostdesc";
105111 };
106112
113+ # See opencv_contrib/modules/face/CMakeLists.txt
114+ face = {
115+ src = fetchFromGitHub {
116+ owner = "opencv";
117+ repo = "opencv_3rdparty";
118+ rev = "8afa57abc8229d611c4937165d20e2a2d9fc5a12";
119+ sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v";
120+ };
121+ files = {
122+ "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05";
123+ };
124+ dst = ".cache/data";
125+ };
126+
107127 # See opencv/cmake/OpenCVDownload.cmake
108128 installExtraFiles = extra : with lib; ''
109129 mkdir -p "${extra.dst}"
@@ -122,14 +142,23 @@ let
122142 dst = ".cache/tiny_dnn";
123143 };
124144
125− opencvFlag = name: enabled: "-DWITH_${name}=${if enabled then "ON" else "OFF"}";
145+ opencvFlag = name: enabled: "-DWITH_${name}=${printEnabled enabled}";
126146
147+ printEnabled = enabled : if enabled then "ON" else "OFF";
127148in
128149
129150stdenv.mkDerivation rec {
130151 name = "opencv-${version}";
131152 inherit version src;
132153
154+ patches = [
155+ # Fix for: https://github.com/opencv/opencv/issues/10474
156+ (fetchpatch {
157+ url = "https://github.com/opencv/opencv/commit/ea5a3e557f93844fdb5e54e3e8acfc5f61c6fd9f.patch";
158+ sha256 = "1w7jmqlrx73ydh9jjsnnic5xz8r04kxbjpzkcfyb91v3az9132r1";
159+ })
160+ ];
161+
133162 postUnpack = lib.optionalString buildContrib ''
134163 cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/opencv_contrib"
135164 '';
@@ -151,16 +180,19 @@ stdenv.mkDerivation rec {
151180
152181 ${installExtraFiles vgg}
153182 ${installExtraFiles boostdesc}
183+ ${installExtraFiles face}
154184
155185 mkdir -p "${tinyDnn.dst}"
156186 ln -s "${tinyDnn.src}" "${tinyDnn.dst}/${tinyDnn.md5}-${tinyDnn.name}"
157187 '');
158188
159189 buildInputs =
160− [ zlib pcre hdf5 ]
190+ [ zlib pcre hdf5 glog boost google-gflags protobuf ]
191+ ++ lib.optional (!stdenv.isDarwin) caffe
161192 ++ lib.optional enablePython pythonPackages.python
162193 ++ lib.optional enableGtk2 gtk2
163194 ++ lib.optional enableGtk3 gtk3
195+ ++ lib.optional enableVtk vtk
164196 ++ lib.optional enableJPEG libjpeg
165197 ++ lib.optional enablePNG libpng
166198 ++ lib.optional enableTIFF libtiff
@@ -171,6 +203,9 @@ stdenv.mkDerivation rec {
171203 ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
172204 [ VideoDecodeAcceleration bzip2 ]
173205 ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
206+ ++ lib.optional enableOvis ogre
207+ ++ lib.optional enableGPhoto2 libgphoto2
208+ ++ lib.optional enableDC1394 libdc1394
174209 ++ lib.optional enableEigen eigen
175210 ++ lib.optional enableOpenblas openblas
176211 # There is seemingly no compile-time flag for Tesseract. It's
@@ -178,12 +213,7 @@ stdenv.mkDerivation rec {
178213 # tesseract & leptonica.
179214 ++ lib.optionals enableTesseract [ tesseract leptonica ]
180215 ++ lib.optional enableCuda cudatoolkit
181−
182− # These are only needed for the currently disabled
183− # cnn_3dobj and dnn_modern modules
184− # ++ lib.optionals buildContrib [ caffe glog boost google-gflags ]
185−
186− ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit ]
216+ ++ lib.optionals stdenv.isDarwin [ AVFoundation Cocoa QTKit VideoDecodeAcceleration bzip2 ]
187217 ++ lib.optionals enableDocs [ doxygen graphviz-nox ];
188218
189219 propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
@@ -194,6 +224,9 @@ stdenv.mkDerivation rec {
194224
195225 cmakeFlags = [
196226 "-DWITH_OPENMP=ON"
227+ "-DBUILD_PROTOBUF=OFF"
228+ "-DPROTOBUF_UPDATE_FILES=ON"
229+ "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
197230 (opencvFlag "IPP" enableIpp)
198231 (opencvFlag "TIFF" enableTIFF)
199232 (opencvFlag "JASPER" enableJPEG2K)
@@ -206,17 +239,14 @@ stdenv.mkDerivation rec {
206239 ] ++ lib.optionals enableCuda [
207240 "-DCUDA_FAST_MATH=ON"
208241 "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc"
209− ] ++ lib.optionals buildContrib [
210− # the cnn_3dobj module fails to build
211− "-DBUILD_opencv_cnn_3dobj=OFF"
212−
213− # the dnn_modern module causes:
214− # https://github.com/opencv/opencv_contrib/issues/823
215− #
216− # On OS X its dependency tiny-dnn-1.0.0a3 also fails to build.
217− "-DBUILD_opencv_dnn_modern=OFF"
218− ]
219− ++ lib.optionals stdenv.isDarwin ["-DWITH_OPENCL=OFF" "-DWITH_LAPACK=OFF"];
242+ ]
243+ ++ lib.optionals stdenv.isDarwin [
244+ "-DWITH_OPENCL=OFF"
245+ "-DWITH_LAPACK=OFF"
246+
247+ # On OS X the tiny-dnn-1.0.0a3 dependency of dnn_modern fails to build.
248+ "-DBUILD_opencv_dnn_modern=OFF"
249+ ];
220250
221251 enableParallelBuilding = true;
222252
@@ -231,7 +261,7 @@ stdenv.mkDerivation rec {
231261 meta = {
232262 description = "Open Computer Vision Library with more than 500 algorithms";
233263 homepage = http://opencv.org/;
234− license = stdenv.lib.licenses.bsd3;
264+ license = with stdenv.lib.licenses; if enableUnfree then unfree else bsd3;
235265 maintainers = with stdenv.lib.maintainers; [viric mdaiter basvandijk];
236266 platforms = with stdenv.lib.platforms; linux ++ darwin;
237267 };
pkgs/top-level/all-packages.nix+13−2
@@ -10205,7 +10205,9 @@ with pkgs;
1020510205
1020610206 mygpoclient = pythonPackages.mygpoclient;
1020710207
10208− mygui = callPackage ../development/libraries/mygui {};
10208+ mygui = callPackage ../development/libraries/mygui {
10209+ ogre = ogre1_9;
10210+ };
1020910211
1021010212 mysocketw = callPackage ../development/libraries/mysocketw { };
1021110213
@@ -10280,6 +10282,7 @@ with pkgs;
1028010282 ode = callPackage ../development/libraries/ode { };
1028110283
1028210284 ogre = callPackage ../development/libraries/ogre {};
10285+ ogre1_9 = callPackage ../development/libraries/ogre/1.9.x.nix {};
1028310286
1028410287 ogrepaged = callPackage ../development/libraries/ogrepaged { };
1028510288
@@ -18084,6 +18087,7 @@ with pkgs;
1808418087 digikam = libsForQt5.callPackage ../applications/graphics/digikam {
1808518088 inherit (plasma5) oxygen;
1808618089 inherit (kdeApplications) kcalcore;
18090+ opencv3 = opencv3.override { enableContrib = true; };
1808718091 };
1808818092
1808918093 displaycal = (newScope pythonPackages) ../applications/graphics/displaycal {};
@@ -18299,7 +18303,9 @@ with pkgs;
1829918303
1830018304 openarena = callPackage ../games/openarena { };
1830118305
18302− opendungeons = callPackage ../games/opendungeons { };
18306+ opendungeons = callPackage ../games/opendungeons {
18307+ ogre = ogre1_9;
18308+ };
1830318309
1830418310 openlierox = callPackage ../games/openlierox { };
1830518311
@@ -18383,6 +18389,10 @@ with pkgs;
1838318389
1838418390 rigsofrods = callPackage ../games/rigsofrods {
1838518391 angelscript = angelscript_2_22;
18392+ ogre = ogre1_9;
18393+ ogrepaged = ogrepaged.override {
18394+ ogre = ogre1_9;
18395+ };
1838618396 mygui = mygui.override {
1838718397 withOgre = true;
1838818398 };
@@ -18477,6 +18487,7 @@ with pkgs;
1847718487 };
1847818488
1847918489 stuntrally = callPackage ../games/stuntrally {
18490+ ogre = ogre1_9;
1848018491 mygui = mygui.override {
1848118492 withOgre = true;
1848218493 };