opencv4: 4.7.0 -> 4.9.0

https://github.com/opencv/opencv/wiki/ChangeLog#version490

+119 -83
+119 -83
pkgs/development/libraries/opencv/4.x.nix
··· 2 2 , stdenv 3 3 , fetchurl 4 4 , fetchFromGitHub 5 - , fetchpatch 6 5 , cmake 7 6 , pkg-config 8 7 , unzip 9 8 , zlib 10 - , pcre 9 + , pcre2 11 10 , hdf5 12 11 , boost 12 + , glib 13 13 , gflags 14 14 , protobuf_21 15 15 , config ··· 35 35 , eigen 36 36 , enableBlas ? true 37 37 , blas 38 + , enableVA ? !stdenv.isDarwin 39 + , libva 38 40 , enableContrib ? true 39 41 40 42 , enableCuda ? config.cudaSupport ··· 58 60 , enableFfmpeg ? true 59 61 , ffmpeg 60 62 , enableGStreamer ? true 63 + , elfutils 61 64 , gst_all_1 65 + , orc 66 + , libunwind 67 + , zstd 62 68 , enableTesseract ? false 63 69 , tesseract 64 70 , leptonica ··· 85 91 }@inputs: 86 92 87 93 let 88 - version = "4.7.0"; 94 + version = "4.9.0"; 89 95 90 96 # It's necessary to consistently use backendStdenv when building with CUDA 91 97 # support, otherwise we get libstdc++ errors downstream ··· 96 102 owner = "opencv"; 97 103 repo = "opencv"; 98 104 rev = version; 99 - sha256 = "sha256-jUeGsu8+jzzCnIFbVMCW8DcUeGv/t1yCY/WXyW+uGDI="; 105 + hash = "sha256-3qqu4xlRyMbPKHHTIT+iRRGtpFlcv0NU8GNZpgjdi6k="; 100 106 }; 101 107 102 108 contribSrc = fetchFromGitHub { 103 109 owner = "opencv"; 104 110 repo = "opencv_contrib"; 105 111 rev = version; 106 - sha256 = "sha256-meya0J3RdOIeMM46e/6IOVwrKn3t/c0rhwP2WQaybkE="; 112 + hash = "sha256-K74Ghk4uDqj4OWEzDxT2R3ERi+jkAWZszzezRenfuZ8="; 107 113 }; 108 114 109 115 testDataSrc = fetchFromGitHub { 110 116 owner = "opencv"; 111 117 repo = "opencv_extra"; 112 118 rev = version; 113 - sha256 = "sha256-6hAdJdaUgtRGQanQKuY/q6fcXWXFZ3K/oLbGxvksry0="; 119 + hash = "sha256-pActKi7aN5EOZq2Fpf5mALnZq71c037/R3Q6wJ4uCfQ="; 114 120 }; 115 121 116 122 # Contrib must be built in order to enable Tesseract support: ··· 121 127 src = fetchFromGitHub { 122 128 owner = "opencv"; 123 129 repo = "opencv_3rdparty"; 124 - rev = "a56b6ac6f030c312b2dce17430eef13aed9af274"; 125 - sha256 = "1msbkc3zixx61rcg6a04i1bcfhw1phgsrh93glq1n80hgsk3nbjq"; 130 + rev = "0cc4aa06bf2bef4b05d237c69a5a96b9cd0cb85a"; 131 + hash = "sha256-/kHivOgCkY9YdcRRaVgytXal3ChE9xFfGAB0CfFO5ec="; 126 132 } + "/ippicv"; 127 - files = let name = platform: "ippicv_2019_${platform}_general_20180723.tgz"; in 133 + files = let name = platform: "ippicv_2021.10.0_${platform}_20230919_general.tgz"; in 128 134 if effectiveStdenv.hostPlatform.system == "x86_64-linux" then 129 - { ${name "lnx_intel64"} = "c0bd78adb4156bbf552c1dfe90599607"; } 135 + { ${name "lnx_intel64"} = "606a19b207ebedfe42d59fd916cc4850"; } 130 136 else if effectiveStdenv.hostPlatform.system == "i686-linux" then 131 - { ${name "lnx_ia32"} = "4f38432c30bfd6423164b7a24bbc98a0"; } 137 + { ${name "lnx_ia32"} = "ea08487b810baad2f68aca87b74a2db9"; } 132 138 else if effectiveStdenv.hostPlatform.system == "x86_64-darwin" then 133 - { ${name "mac_intel64"} = "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2"; } 139 + { ${name "mac_intel64"} = "14f01c5a4780bfae9dde9b0aaf5e56fc"; } 134 140 else 135 141 throw "ICV is not available for this platform (or not yet supported by this package)"; 136 142 dst = ".cache/ippicv"; ··· 142 148 owner = "opencv"; 143 149 repo = "opencv_3rdparty"; 144 150 rev = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"; 145 - sha256 = "0r9fam8dplyqqsd3qgpnnfgf9l7lj44di19rxwbm8mxiw0rlcdvy"; 151 + hash = "sha256-fjdGM+CxV1QX7zmF2AiR9NDknrP2PjyaxtjT21BVLmU="; 146 152 }; 147 153 files = { 148 154 "vgg_generated_48.i" = "e8d0dcd54d1bcfdc29203d011a797179"; ··· 179 185 owner = "opencv"; 180 186 repo = "opencv_3rdparty"; 181 187 rev = "8afa57abc8229d611c4937165d20e2a2d9fc5a12"; 182 - sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v"; 188 + hash = "sha256-m9yF4kfmpRJybohdRwUTmboeU+SbZQ6F6gm32PDWNBg="; 183 189 }; 184 190 files = { 185 191 "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05"; ··· 191 197 ade = rec { 192 198 src = fetchurl { 193 199 url = "https://github.com/opencv/ade/archive/${name}"; 194 - sha256 = "sha256-TjLRbFbC7MDY9PxIy560ryviBI58cbQwqgc7A7uOHkg="; 200 + hash = "sha256-WG/GudVpkO10kOJhoKXFMj672kggvyRYCIpezal3wcE="; 195 201 }; 196 - name = "v0.1.2a.zip"; 197 - md5 = "fa4b3e25167319cb0fa9432ef8281945"; 202 + name = "v0.1.2d.zip"; 203 + md5 = "dbb095a8bf3008e91edbbf45d8d34885"; 198 204 dst = ".cache/ade"; 199 205 }; 200 206 ··· 204 210 owner = "opencv"; 205 211 repo = "opencv_3rdparty"; 206 212 rev = "a8b69ccc738421293254aec5ddb38bd523503252"; 207 - sha256 = "sha256-/n6zHwf0Rdc4v9o4rmETzow/HTv+81DnHP+nL56XiTY="; 213 + hash = "sha256-/n6zHwf0Rdc4v9o4rmETzow/HTv+81DnHP+nL56XiTY="; 208 214 }; 209 215 files = { 210 216 "detect.caffemodel" = "238e2b2d6f3c18d6c3a30de0c31e23cf"; ··· 260 266 patches = [ 261 267 ./cmake-don-t-use-OpenCVFindOpenEXR.patch 262 268 ] ++ lib.optionals enableContrib [ 263 - (fetchpatch { 264 - name = "CVE-2023-2617.patch"; 265 - url = "https://github.com/opencv/opencv_contrib/commit/ccc277247ac1a7aef0a90353edcdec35fbc5903c.patch"; 266 - stripLen = 2; 267 - extraPrefix = [ "opencv_contrib/" ]; 268 - sha256 = "sha256-drZ+DVn+Pk4zAZJ+LgX5u3Tz7MU0AEI/73EVvxDP3AU="; 269 - }) 270 - (fetchpatch { 271 - name = "CVE-2023-2618.patch"; 272 - url = "https://github.com/opencv/opencv_contrib/commit/ec406fa4748fb4b0630c1b986469e7918d5e8953.patch"; 273 - stripLen = 2; 274 - extraPrefix = [ "opencv_contrib/" ]; 275 - sha256 = "sha256-cB5Tsh2fDOsc0BNtSzd6U/QoCjkd9yMW1QutUU69JJ0="; 276 - }) 277 269 ] ++ lib.optional enableCuda ./cuda_opt_flow.patch; 278 270 279 271 # This prevents cmake from using libraries in impure paths (which ··· 300 292 echo '"(build info elided)"' > modules/core/version_string.inc 301 293 ''; 302 294 303 - buildInputs = [ zlib pcre boost gflags protobuf_21 ] 304 - ++ lib.optional enablePython pythonPackages.python 305 - ++ lib.optional (effectiveStdenv.buildPlatform == effectiveStdenv.hostPlatform) hdf5 306 - ++ lib.optional enableGtk2 gtk2 307 - ++ lib.optional enableGtk3 gtk3 308 - ++ lib.optional enableVtk vtk 309 - ++ lib.optional enableJPEG libjpeg 310 - ++ lib.optional enablePNG libpng 311 - ++ lib.optional enableTIFF libtiff 312 - ++ lib.optional enableWebP libwebp 313 - ++ lib.optionals enableEXR [ openexr ilmbase ] 314 - ++ lib.optional enableJPEG2000 openjpeg 315 - ++ lib.optional enableFfmpeg ffmpeg 316 - ++ lib.optionals (enableFfmpeg && effectiveStdenv.isDarwin) 317 - [ VideoDecodeAcceleration bzip2 ] 318 - ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good ]) 319 - ++ lib.optional enableOvis ogre 320 - ++ lib.optional enableGPhoto2 libgphoto2 321 - ++ lib.optional enableDC1394 libdc1394 322 - ++ lib.optional enableEigen eigen 323 - ++ lib.optional enableBlas blas.provider 295 + buildInputs = [ 296 + boost 297 + gflags 298 + glib 299 + pcre2 300 + protobuf_21 301 + zlib 302 + ] ++ lib.optionals enablePython [ 303 + pythonPackages.python 304 + ] ++ lib.optionals (effectiveStdenv.buildPlatform == effectiveStdenv.hostPlatform) [ 305 + hdf5 306 + ] ++ lib.optionals enableGtk2 [ 307 + gtk2 308 + ] ++ lib.optionals enableGtk3 [ 309 + gtk3 310 + ] ++ lib.optionals enableVtk [ 311 + vtk 312 + ] ++ lib.optionals enableJPEG [ 313 + libjpeg 314 + ] ++ lib.optionals enablePNG [ 315 + libpng 316 + ] ++ lib.optionals enableTIFF [ 317 + libtiff 318 + ] ++ lib.optionals enableWebP [ 319 + libwebp 320 + ] ++ lib.optionals enableEXR [ 321 + openexr 322 + ilmbase 323 + ] ++ lib.optionals enableJPEG2000 [ 324 + openjpeg 325 + ] ++ lib.optionals enableFfmpeg [ 326 + ffmpeg 327 + ] ++ lib.optionals (enableFfmpeg && effectiveStdenv.isDarwin) [ 328 + bzip2 329 + VideoDecodeAcceleration 330 + ] ++ lib.optionals (enableGStreamer && effectiveStdenv.isLinux) (with gst_all_1; [ 331 + elfutils 332 + gst-plugins-base 333 + gst-plugins-good 334 + gstreamer 335 + libunwind 336 + orc 337 + zstd 338 + ]) ++ lib.optionals enableOvis [ 339 + ogre 340 + ] ++ lib.optionals enableGPhoto2 [ 341 + libgphoto2 342 + ] ++ lib.optionals enableDC1394 [ 343 + libdc1394 344 + ] ++ lib.optionals enableEigen [ 345 + eigen 346 + ] ++ lib.optionals enableVA [ 347 + libva 348 + ] ++ lib.optionals enableBlas [ 349 + blas.provider 350 + ] ++ lib.optionals enableTesseract [ 324 351 # There is seemingly no compile-time flag for Tesseract. It's 325 352 # simply enabled automatically if contrib is built, and it detects 326 353 # tesseract & leptonica. 327 - ++ lib.optionals enableTesseract [ tesseract leptonica ] 328 - ++ lib.optional enableTbb tbb 329 - ++ lib.optionals effectiveStdenv.isDarwin [ 330 - bzip2 AVFoundation Cocoa VideoDecodeAcceleration CoreMedia MediaToolbox Accelerate 331 - ] 332 - ++ lib.optionals enableDocs [ doxygen graphviz-nox ] 333 - ++ lib.optionals enableCuda (with cudaPackages; [ 334 - cuda_cudart.lib 335 - cuda_cudart.dev 336 - cuda_cccl.dev # <thrust/*> 337 - libnpp.dev # npp.h 338 - libnpp.lib 339 - libnpp.static 340 - nvidia-optical-flow-sdk 341 - ] ++ lib.optionals enableCublas [ 342 - # May start using the default $out instead once 343 - # https://github.com/NixOS/nixpkgs/issues/271792 344 - # has been addressed 345 - libcublas.static 346 - libcublas.lib 347 - libcublas.dev # cublas_v2.h 348 - ] ++ lib.optionals enableCudnn [ 349 - cudnn.dev # cudnn.h 350 - cudnn.lib 351 - cudnn.static 352 - ] ++ lib.optionals enableCufft [ 353 - libcufft.dev # cufft.h 354 - libcufft.lib 355 - libcufft.static 356 - ]); 354 + tesseract 355 + leptonica 356 + ] ++ lib.optionals enableTbb [ 357 + tbb 358 + ] ++ lib.optionals effectiveStdenv.isDarwin [ 359 + bzip2 360 + AVFoundation 361 + Cocoa 362 + VideoDecodeAcceleration 363 + CoreMedia 364 + MediaToolbox 365 + Accelerate 366 + ] ++ lib.optionals enableDocs [ 367 + doxygen 368 + graphviz-nox 369 + ] ++ lib.optionals enableCuda (with cudaPackages; [ 370 + cuda_cudart.lib 371 + cuda_cudart.dev 372 + cuda_cccl.dev # <thrust/*> 373 + libnpp.dev # npp.h 374 + libnpp.lib 375 + libnpp.static 376 + nvidia-optical-flow-sdk 377 + ] ++ lib.optionals enableCublas [ 378 + # May start using the default $out instead once 379 + # https://github.com/NixOS/nixpkgs/issues/271792 380 + # has been addressed 381 + libcublas.static 382 + libcublas.lib 383 + libcublas.dev # cublas_v2.h 384 + ] ++ lib.optionals enableCudnn [ 385 + cudnn.dev # cudnn.h 386 + cudnn.lib 387 + cudnn.static 388 + ] ++ lib.optionals enableCufft [ 389 + libcufft.dev # cufft.h 390 + libcufft.lib 391 + libcufft.static 392 + ]); 357 393 358 394 propagatedBuildInputs = lib.optionals enablePython [ pythonPackages.numpy ]; 359 395