summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Charles Campbell <rossbridger.cc@gmail.com>2020-10-18 22:59:46 +0800
committerSam James <sam@gentoo.org>2020-11-03 07:18:26 +0000
commitc92eaa6a7d93400503334e9c65df2b8e400ab90f (patch)
tree57344e42b594fc512bea012d87232c434637ec75 /media-libs/opencv
parentvirtual/lapacke: add sci-libs/openblas as an alternative (diff)
downloadgentoo-c92eaa6a7d93400503334e9c65df2b8e400ab90f.tar.gz
gentoo-c92eaa6a7d93400503334e9c65df2b8e400ab90f.tar.bz2
gentoo-c92eaa6a7d93400503334e9c65df2b8e400ab90f.zip
media-libs/opencv: various fixes
- Explicitly depends on virtual/lapacke to prevent its cmake build scripts from implicitly disabling lapack support when it can't find lapacke.h. - Link with cblas when sci-libs/lapack is supplimented as the default lapack implementation. - examples USE requires contribdnn USE to be enabled to prevent build failure. Closes: https://bugs.gentoo.org/700176 Closes: https://bugs.gentoo.org/749681 Closes: https://bugs.gentoo.org/717812 Closes: https://bugs.gentoo.org/701790 Closes: https://bugs.gentoo.org/704518 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/17964 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/files/opencv-4.5.0-link-with-cblas-for-lapack.patch18
-rw-r--r--media-libs/opencv/opencv-4.5.0.ebuild8
2 files changed, 25 insertions, 1 deletions
diff --git a/media-libs/opencv/files/opencv-4.5.0-link-with-cblas-for-lapack.patch b/media-libs/opencv/files/opencv-4.5.0-link-with-cblas-for-lapack.patch
new file mode 100644
index 000000000000..acee677052d6
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.5.0-link-with-cblas-for-lapack.patch
@@ -0,0 +1,18 @@
+diff --git a/cmake/OpenCVFindLAPACK.cmake b/cmake/OpenCVFindLAPACK.cmake
+index 342bebc..9ebd206 100644
+--- a/cmake/OpenCVFindLAPACK.cmake
++++ b/cmake/OpenCVFindLAPACK.cmake
+@@ -136,10 +136,12 @@ if(WITH_LAPACK)
+ ocv_lapack_check()
+ endif()
+ if(NOT HAVE_LAPACK)
+- if(LAPACKE_INCLUDE_DIR)
++ find_package(CBLAS)
++ if(LAPACKE_INCLUDE_DIR AND CBLAS_FOUND)
+ set(LAPACK_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR})
+ set(LAPACK_CBLAS_H "cblas.h")
+ set(LAPACK_LAPACKE_H "lapacke.h")
++ set(LAPACK_LIBRARIES ${LAPACK_LIBRARIES} ${CBLAS_LIBRARIES})
+ set(LAPACK_IMPL "LAPACK/Generic")
+ ocv_lapack_check()
+ elseif(APPLE)
diff --git a/media-libs/opencv/opencv-4.5.0.ebuild b/media-libs/opencv/opencv-4.5.0.ebuild
index 54bb9292356d..21f4784aa91c 100644
--- a/media-libs/opencv/opencv-4.5.0.ebuild
+++ b/media-libs/opencv/opencv-4.5.0.ebuild
@@ -70,6 +70,7 @@ REQUIRED_USE="
contribovis? ( contrib )
contribsfm? ( contrib eigen gflags glog )
contribxfeatures2d? ( contrib download )
+ examples? ( contribdnn )
java? ( python )
opengl? ( qt5 )
python? ( ${PYTHON_REQUIRED_USE} )
@@ -111,7 +112,11 @@ RDEPEND="
java? ( >=virtual/jre-1.6:* )
jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
- lapack? ( virtual/lapack )
+ lapack? (
+ virtual/cblas
+ virtual/lapack
+ virtual/lapacke
+ )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
opengl? (
@@ -274,6 +279,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-3.4.1-cuda-add-relaxed-constexpr.patch
"${FILESDIR}"/${PN}-4.1.2-opencl-license.patch
"${FILESDIR}"/${PN}-4.4.0-disable-native-cpuflag-detect.patch
+ "${FILESDIR}"/${PN}-4.5.0-link-with-cblas-for-lapack.patch
)
pkg_pretend() {