Merge pull request #256550 from bcdarwin/opencv-updates

{caffe,mxnet,sdrangel,video2midi,waifu2x-converter-cpp}: opencv3 -> opencv4
This commit is contained in:
Mario Rodas 2023-10-30 22:21:15 -05:00 committed by GitHub
commit f811a92b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 19 deletions

View File

@ -24,7 +24,7 @@
, libbladeRF
, mbelib
, ninja
, opencv3
, opencv4
, pkg-config
, qtcharts
, qtdeclarative
@ -90,7 +90,7 @@ stdenv.mkDerivation (finalAttrs: {
libusb1
limesuite
mbelib
opencv3
opencv4
qtcharts
qtdeclarative
qtgamepad

View File

@ -1,12 +1,13 @@
{ config, stdenv, lib
, fetchFromGitHub
, fetchurl
, fetchpatch
, cmake
, boost
, gflags
, glog
, hdf5-cpp
, opencv3
, opencv4
, protobuf
, doxygen
, blas
@ -71,7 +72,7 @@ stdenv.mkDerivation rec {
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
++ ["-DUSE_LMDB=${toggle lmdbSupport}"];
buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv3 blas ]
buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv4 blas ]
++ lib.optional cudaSupport cudatoolkit
++ lib.optional cudnnSupport cudnn
++ lib.optional lmdbSupport lmdb
@ -96,6 +97,11 @@ stdenv.mkDerivation rec {
patches = [
./darwin.patch
(fetchpatch {
name = "support-opencv4";
url = "https://github.com/BVLC/caffe/pull/6638/commits/0a04cc2ccd37ba36843c18fea2d5cbae6e7dd2b5.patch";
hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI=";
})
] ++ lib.optional pythonSupport (substituteAll {
src = ./python.patch;
inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy
@ -148,7 +154,7 @@ stdenv.mkDerivation rec {
'';
homepage = "http://caffe.berkeleyvision.org/";
maintainers = with maintainers; [ ];
broken = pythonSupport && (python.isPy310);
broken = (pythonSupport && (python.isPy310)) || cudaSupport;
license = licenses.bsd2;
platforms = platforms.linux ++ platforms.darwin;
};

View File

@ -1,5 +1,5 @@
{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake
, opencv3, gtest, blas, gomp, llvmPackages, perl
, opencv4, gtest, blas, gomp, llvmPackages, perl
, cudaSupport ? config.cudaSupport, cudaPackages ? { }, nvidia_x11
, cudnnSupport ? cudaSupport
}:
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake perl ];
buildInputs = [ opencv3 gtest blas.provider ]
buildInputs = [ opencv4 gtest blas.provider ]
++ lib.optional stdenv.cc.isGNU gomp
++ lib.optional stdenv.cc.isClang llvmPackages.openmp
# FIXME: when cuda build is fixed, remove nvidia_x11, and use /run/opengl-driver/lib

View File

@ -1,7 +1,7 @@
{ lib, fetchFromGitHub, pythonPackages, opencv3 }:
{ lib, fetchFromGitHub, pythonPackages, opencv4 }:
let
opencv3_ = pythonPackages.toPythonModule (opencv3.override {
opencv4_ = pythonPackages.toPythonModule (opencv4.override {
inherit pythonPackages;
enablePython = true;
enableFfmpeg = true;
@ -19,7 +19,7 @@ in pythonPackages.buildPythonApplication rec {
sha256 = "0qzrxqhsxn0h71nfrsi9g78hx3pqm3b8sr6fjq01k4k6dd2nwfam";
};
propagatedBuildInputs = with pythonPackages; [ opencv3_ midiutil pygame pyopengl ];
propagatedBuildInputs = with pythonPackages; [ opencv4_ midiutil pygame pyopengl ];
installPhase = ''
install -Dm755 v2m.py $out/bin/v2m.py

View File

@ -17,7 +17,6 @@
, libtiff
, ninja
, nix-update
, opencv3
, openexr
, pkg-config
, qtbase
@ -78,7 +77,6 @@ stdenv.mkDerivation (finalAttrs: {
libjpeg
libtiff
libpng
opencv3
openexr
graphicsmagick
curl

View File

@ -1,4 +1,4 @@
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL
{ cmake, fetchFromGitHub, makeWrapper, opencv4, lib, stdenv, ocl-icd, opencl-headers, OpenCL
, config
, cudaSupport ? config.cudaSupport, cudatoolkit ? null
}:
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
];
buildInputs = [
opencv3
opencv4
] ++ lib.optional cudaSupport cudatoolkit
++ lib.optional stdenv.isDarwin OpenCL
++ lib.optionals stdenv.isLinux [ ocl-icd opencl-headers ];

View File

@ -24345,10 +24345,6 @@ with pkgs;
ffmpeg = ffmpeg_4;
};
opencv3WithoutCuda = opencv3.override {
enableCuda = false;
};
opencv4 = callPackage ../development/libraries/opencv/4.x.nix {
inherit (darwin.apple_sdk.frameworks)
AVFoundation Cocoa VideoDecodeAcceleration CoreMedia MediaToolbox Accelerate;
@ -24356,6 +24352,10 @@ with pkgs;
ffmpeg = ffmpeg_4;
};
opencv4WithoutCuda = opencv4.override {
enableCuda = false;
};
opencv = opencv4;
imath = callPackage ../development/libraries/imath { };
@ -39806,7 +39806,7 @@ with pkgs;
caffe = callPackage ../applications/science/math/caffe ({
inherit (config) cudaSupport;
cudaPackages = cudaPackages_10_1;
opencv3 = opencv3WithoutCuda; # Used only for image loading.
opencv4 = opencv4WithoutCuda; # Used only for image loading.
blas = openblas;
inherit (darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo;
} // (config.caffe or {}));