mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 01:23:03 +00:00
Merge pull request #85879 from lovesegfault/opencv-4.3.0
opencv4: 4.1.2 -> 4.3.0
This commit is contained in:
commit
be36fc67ff
@ -38,20 +38,20 @@
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
version = "4.1.2";
|
||||
version = "4.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "opencv";
|
||||
repo = "opencv";
|
||||
rev = version;
|
||||
sha256 = "0c98ziwvfrzdzwn52a36d37n5rac8zmxq2jn479bzfaii1bib8xx";
|
||||
sha256 = "1r9bq9p1x99g2y8jvj9428sgqvljz75dm5vrfsma7hh5wjhz9775";
|
||||
};
|
||||
|
||||
contribSrc = fetchFromGitHub {
|
||||
owner = "opencv";
|
||||
repo = "opencv_contrib";
|
||||
rev = version;
|
||||
sha256 = "10ryyxhggin5dk5glf4ycyrfryqf50f4bs10biv6nxlrrinm2di4";
|
||||
sha256 = "068b4f95rlryab3mffxs2w6dnbmbhrnpsdgl007rxk4bwnz29y49";
|
||||
};
|
||||
|
||||
# Contrib must be built in order to enable Tesseract support:
|
||||
@ -62,8 +62,8 @@ let
|
||||
src = fetchFromGitHub {
|
||||
owner = "opencv";
|
||||
repo = "opencv_3rdparty";
|
||||
rev = "32e315a5b106a7b89dbed51c28f8120a48b368b4";
|
||||
sha256 = "19w9f0r16072s59diqxsr5q6nmwyz9gnxjs49nglzhd66p3ddbkp";
|
||||
rev = "a56b6ac6f030c312b2dce17430eef13aed9af274";
|
||||
sha256 = "1msbkc3zixx61rcg6a04i1bcfhw1phgsrh93glq1n80hgsk3nbjq";
|
||||
} + "/ippicv";
|
||||
files = let name = platform : "ippicv_2019_${platform}_general_20180723.tgz"; in
|
||||
if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||
@ -168,7 +168,9 @@ stdenv.mkDerivation {
|
||||
# Also, work around https://github.com/NixOS/nixpkgs/issues/26304 with
|
||||
# what appears to be some stray headers in dnn/misc/tensorflow
|
||||
# in contrib when generating the Python bindings:
|
||||
patches = lib.optional enableCuda ./cuda_opt_flow.patch;
|
||||
patches = [
|
||||
./cmake-don-t-use-OpenCVFindOpenEXR.patch
|
||||
] ++ lib.optional enableCuda ./cuda_opt_flow.patch;
|
||||
postPatch = ''
|
||||
sed -i '/Add these standard paths to the search paths for FIND_LIBRARY/,/^\s*$/{d}' CMakeLists.txt
|
||||
sed -i -e 's|if len(decls) == 0:|if len(decls) == 0 or "opencv2/" not in hdr:|' ./modules/python/src2/gen2.py
|
||||
|
@ -0,0 +1,55 @@
|
||||
From 6d988c08e852379a163ecd20df8639196d84d014 Mon Sep 17 00:00:00 2001
|
||||
From: Bernardo Meurer <meurerbernardo@gmail.com>
|
||||
Date: Sun, 26 Apr 2020 14:50:25 -0700
|
||||
Subject: [PATCH] cmake: don't use OpenCVFindOpenEXR
|
||||
|
||||
Use find_package for this.
|
||||
---
|
||||
CMakeLists.txt | 2 ++
|
||||
cmake/OpenCVFindLibsGrfmt.cmake | 15 +++------------
|
||||
2 files changed, 5 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 4c0b3880fc..0360469350 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -14,6 +14,8 @@ FATAL: In-source builds are not allowed.
|
||||
")
|
||||
endif()
|
||||
|
||||
+# the future!
|
||||
+include(FindPkgConfig)
|
||||
|
||||
include(cmake/OpenCVMinDepVersions.cmake)
|
||||
|
||||
diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
index 0beaf19317..4c5e46e615 100644
|
||||
--- a/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
+++ b/cmake/OpenCVFindLibsGrfmt.cmake
|
||||
@@ -227,20 +227,11 @@ endif()
|
||||
# --- OpenEXR (optional) ---
|
||||
if(WITH_OPENEXR)
|
||||
ocv_clear_vars(HAVE_OPENEXR)
|
||||
- if(NOT BUILD_OPENEXR)
|
||||
- include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
|
||||
- endif()
|
||||
-
|
||||
+ pkg_check_modules(OPENEXR OpenEXR)
|
||||
if(OPENEXR_FOUND)
|
||||
set(HAVE_OPENEXR YES)
|
||||
- else()
|
||||
- ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
|
||||
-
|
||||
- set(OPENEXR_LIBRARIES IlmImf)
|
||||
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
|
||||
- if(OPENEXR_VERSION) # check via TARGET doesn't work
|
||||
- set(HAVE_OPENEXR YES)
|
||||
- endif()
|
||||
+ set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_DIRS})
|
||||
+ set(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
--
|
||||
2.26.1
|
||||
|
Loading…
Reference in New Issue
Block a user