extra/opencv to 4.5.2-3

This commit is contained in:
Kevin Mihelich 2021-04-28 14:09:21 +00:00
parent 4616a95474
commit 977261b855
2 changed files with 35 additions and 1 deletions

View file

@ -9,7 +9,7 @@
pkgbase=opencv
pkgname=(opencv opencv-samples python-opencv)
pkgver=4.5.2
pkgrel=2
pkgrel=3
pkgdesc="Open Source Computer Vision Library"
arch=(x86_64)
license=(BSD)
@ -26,15 +26,18 @@ optdepends=('opencv-samples: samples'
source=(https://github.com/opencv/opencv/archive/$pkgver/$pkgname-$pkgver.tar.gz
https://github.com/opencv/opencv_contrib/archive/$pkgver/opencv_contrib-$pkgver.tar.gz
opencv-lapack-3.9.1.patch
opencv-openexr3.patch
0001-link-with-libatomic.patch)
sha256sums=('be976b9ef14f1deaa282fb6e30d75aa8016a2d5c1f08e85795c235148940d753'
'9f52fd3114ac464cb4c9a2a6a485c729a223afb57b9c24848484e55cef0b5c2a'
'5233d9b4b8e3f4600e3f4ebef2b0ad5621faf25efbdfee96ee720a83cc81d0cc'
'dcddc1dd30139ac3ace668e0d530798c5691dfd2ad1e5e717db6010d659229ba'
'3376bc87ac7404c6f396f1bee03b76ab0e5cb18829f535bbc97cef71d28ab168')
prepare() {
patch -d $pkgname-$pkgver -p1 < opencv-lapack-3.9.1.patch # Fix build with LAPACK 3.9.1
patch -d $pkgname-$pkgver -p1 < opencv-openexr3.patch # Fix build with OpenEXR 3
cd $pkgname-$pkgver
if [[ $CARCH == "arm" || $CARCH == "armv6h" ]]; then
patch -p1 -i ../0001-link-with-libatomic.patch

View file

@ -0,0 +1,31 @@
diff --git a/cmake/OpenCVFindOpenEXR.cmake b/cmake/OpenCVFindOpenEXR.cmake
index ef633e853a..133468243a 100644
--- a/cmake/OpenCVFindOpenEXR.cmake
+++ b/cmake/OpenCVFindOpenEXR.cmake
@@ -9,6 +9,14 @@
# OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR.
#
+find_package(OpenEXR 3.0 CONFIG QUIET)
+if(TARGET OpenEXR::OpenEXR)
+ SET(OPENEXR_FOUND TRUE)
+ SET(OPENEXR_LIBRARIES OpenEXR::OpenEXR)
+ SET(OPENEXR_VERSION ${OpenEXR_VERSION})
+ return()
+endif()
+
SET(OPENEXR_LIBRARIES "")
SET(OPENEXR_LIBSEARCH_SUFFIXES "")
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
diff --git a/modules/imgcodecs/src/grfmt_exr.cpp b/modules/imgcodecs/src/grfmt_exr.cpp
index 9242871f8d..aaf28eead6 100644
--- a/modules/imgcodecs/src/grfmt_exr.cpp
+++ b/modules/imgcodecs/src/grfmt_exr.cpp
@@ -56,6 +56,7 @@
#include <iostream>
#include <stdexcept>
+#include <ImfFrameBuffer.h>
#include <ImfHeader.h>
#include <ImfInputFile.h>
#include <ImfOutputFile.h>