* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2016-02-25 13:35 Amy Winston
0 siblings, 0 replies; 20+ messages in thread
From: Amy Winston @ 2016-02-25 13:35 UTC (permalink / raw
To: gentoo-commits
commit: 48656e3b700cf6d771db428bc6dde322753839d3
Author: Amy Winston <amynka <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 25 13:32:22 2016 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Thu Feb 25 13:32:22 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48656e3b
media-libs/opencv: drop old 3.1.0-r1 and patches
Package-Manager: portage-2.2.26
| 91 --------
.../files/opencv-3.1.0-fix-ocl-declaration.patch | 214 -----------------
.../files/opencv-3.1.0-invalid-string-usage.patch | 75 ------
media-libs/opencv/opencv-3.1.0-r1.ebuild | 252 ---------------------
4 files changed, 632 deletions(-)
diff --git a/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch b/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch
deleted file mode 100644
index dd77571..0000000
--- a/media-libs/opencv/files/opencv-3.1.0-fix-hal-headers.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From f529a1df2b17bcada1179ddcaf1352e3a5ba97b8 Mon Sep 17 00:00:00 2001
-From: Maksim Shabunin <maksim.shabunin@itseez.com>
-Date: Tue, 15 Dec 2015 17:51:08 +0300
-Subject: [PATCH] Fixed HAL headers location
-
-diff --git opencv_contrib-master/modules/xfeatures2d/src/sift.cpp opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
-index fc67c4d..9634fbb 100644
---- opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
-+++ opencv_contrib-master/modules/xfeatures2d/src/sift.cpp
-@@ -105,6 +105,7 @@
- #include "precomp.hpp"
- #include <iostream>
- #include <stdarg.h>
-+#include <opencv2/core/hal/hal.hpp>
-
- namespace cv
- {
-@@ -337,9 +338,9 @@ static float calcOrientationHist( const Mat& img, Point pt, int radius,
- len = k;
-
- // compute gradient values, orientations and the weights over the pixel neighborhood
-- hal::exp(W, W, len);
-- hal::fastAtan2(Y, X, Ori, len, true);
-- hal::magnitude(X, Y, Mag, len);
-+ cv::hal::exp32f(W, W, len);
-+ cv::hal::fastAtan2(Y, X, Ori, len, true);
-+ cv::hal::magnitude32f(X, Y, Mag, len);
-
- for( k = 0; k < len; k++ )
- {
-@@ -620,9 +621,9 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
- }
-
- len = k;
-- hal::fastAtan2(Y, X, Ori, len, true);
-- hal::magnitude(X, Y, Mag, len);
-- hal::exp(W, W, len);
-+ cv::hal::fastAtan2(Y, X, Ori, len, true);
-+ cv::hal::magnitude32f(X, Y, Mag, len);
-+ cv::hal::exp32f(W, W, len);
-
- for( k = 0; k < len; k++ )
- {
-
-diff --git opencv_contrib-master/modules/optflow/src/motempl.cpp opencv_contrib-master/modules/optflow/src/motempl.cpp
-index ec18013..452ad63 100644
---- opencv_contrib-master/modules/optflow/src/motempl.cpp
-+++ opencv_contrib-master/modules/optflow/src/motempl.cpp
-@@ -41,6 +41,7 @@
-
- #include "precomp.hpp"
- #include "opencv2/core/utility.hpp"
-+#include "opencv2/core/hal/hal.hpp"
- #include "opencl_kernels_optflow.hpp"
-
- namespace cv {
-@@ -212,7 +213,7 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
- float* orient_row = orient.ptr<float>(y);
- uchar* mask_row = mask.ptr<uchar>(y);
-
-- hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
-+ cv::hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
-
- // make orientation zero where the gradient is very small
- for( x = 0; x < size.width; x++ )
-diff --git opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
-index e89eb8f..39307e5 100644
---- opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
-+++ opencv_contrib-master/modules/ximgproc/src/fgs_filter.cpp
-@@ -35,7 +35,7 @@
- */
-
- #include "precomp.hpp"
--#include "opencv2/hal/intrin.hpp"
-+#include "opencv2/core/hal/intrin.hpp"
- #include <vector>
-
- namespace cv {
-diff --git opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
-index 4780497..15530d3 100644
---- opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
-+++ opencv_contrib-master/modules/xphoto/src/grayworld_white_balance.cpp
-@@ -40,7 +40,7 @@
- #include "opencv2/xphoto.hpp"
-
- #include "opencv2/core.hpp"
--#include "opencv2/hal/intrin.hpp"
-+#include "opencv2/core/hal/intrin.hpp"
-
- namespace cv { namespace xphoto {
-
diff --git a/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch b/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch
deleted file mode 100644
index e9a190c..0000000
--- a/media-libs/opencv/files/opencv-3.1.0-fix-ocl-declaration.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From ac8dd366e4a1877e0af16961a4094496bed955f7 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.alekhin@itseez.com>
-Date: Sun, 13 Sep 2015 21:18:47 +0300
-Subject: [PATCH] ocl: fix "off" mode
-
-diff --git opencv_contrib-master/modules/tracking/src/tldDetector.cpp opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-index cbb783e..d61444b 100644
---- opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-+++ opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-@@ -104,6 +104,7 @@ namespace cv
- return splus / (sminus + splus);
- }
-
-+#ifdef HAVE_OPENCL
- double TLDDetector::ocl_Sr(const Mat_<uchar>& patch)
- {
- //int64 e1, e2, e3, e4;
-@@ -283,6 +284,7 @@ namespace cv
- //t = (e2 - e1) / getTickFrequency()*1000.0;
- //printf("Sr GPU: %f\n\n", t);
- }
-+#endif
-
- // Calculate Conservative similarity of the patch (NN-Model)
- double TLDDetector::Sc(const Mat_<uchar>& patch)
-@@ -337,6 +339,7 @@ namespace cv
- return splus / (sminus + splus);
- }
-
-+#ifdef HAVE_OPENCL
- double TLDDetector::ocl_Sc(const Mat_<uchar>& patch)
- {
- //int64 e1, e2, e3, e4;
-@@ -415,6 +418,7 @@ namespace cv
- return 0.0;
- return splus / (sminus + splus);
- }
-+#endif // HAVE_OPENCL
-
- // Generate Search Windows for detector from aspect ratio of initial BBs
- void TLDDetector::generateScanGrid(int rows, int cols, Size initBox, std::vector<Rect2d>& res, bool withScaling)
-@@ -565,6 +569,7 @@ namespace cv
- return true;
- }
-
-+#ifdef HAVE_OPENCL
- bool TLDDetector::ocl_detect(const Mat& img, const Mat& imgBlurred, Rect2d& res, std::vector<LabeledPatch>& patches, Size initSize)
- {
- patches.clear();
-@@ -696,6 +701,7 @@ namespace cv
- res = maxScRect;
- return true;
- }
-+#endif // HAVE_OPENCL
-
- // Computes the variance of subimage given by box, with the help of two integral
- // images intImgP and intImgP2 (sum of squares), which should be also provided.
-diff --git opencv_contrib-master/modules/tracking/src/tldDetector.hpp opencv_contrib-master/modules/tracking/src/tldDetector.hpp
-index 3e11895..1caff57 100644
---- opencv_contrib-master/modules/tracking/src/tldDetector.hpp
-+++ opencv_contrib-master/modules/tracking/src/tldDetector.hpp
-@@ -74,10 +74,12 @@ namespace cv
- inline double ensembleClassifierNum(const uchar* data);
- inline void prepareClassifiers(int rowstep);
- double Sr(const Mat_<uchar>& patch);
-- double ocl_Sr(const Mat_<uchar>& patch);
- double Sc(const Mat_<uchar>& patch);
-+#ifdef HAVE_OPENCL
-+ double ocl_Sr(const Mat_<uchar>& patch);
- double ocl_Sc(const Mat_<uchar>& patch);
- void ocl_batchSrSc(const Mat_<uchar>& patches, double *resultSr, double *resultSc, int numOfPatches);
-+#endif
-
- std::vector<TLDEnsembleClassifier> classifiers;
- Mat *posExp, *negExp;
-diff --git opencv_contrib-master/modules/tracking/src/tldModel.cpp opencv_contrib-master/modules/tracking/src/tldModel.cpp
-index 0854022..47fc32a 100644
---- opencv_contrib-master/modules/tracking/src/tldModel.cpp
-+++ opencv_contrib-master/modules/tracking/src/tldModel.cpp
-@@ -246,6 +246,7 @@ namespace cv
- dfprintf((stdout, "\n"));*/
- }
-
-+#ifdef HAVE_OPENCL
- void TrackerTLDModel::ocl_integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive)
- {
- int positiveIntoModel = 0, negativeIntoModel = 0, positiveIntoEnsemble = 0, negativeIntoEnsemble = 0;
-@@ -315,6 +316,7 @@ namespace cv
- dfprintf((stdout, "positiveIntoEnsemble = %d ", positiveIntoEnsemble));
- dfprintf((stdout, "\n"));*/
- }
-+#endif // HAVE_OPENCL
-
- //Push the patch to the model
- void TrackerTLDModel::pushIntoModel(const Mat_<uchar>& example, bool positive)
-diff --git opencv_contrib-master/modules/tracking/src/tldModel.hpp opencv_contrib-master/modules/tracking/src/tldModel.hpp
-index be9141a..ba7c926 100644
---- opencv_contrib-master/modules/tracking/src/tldModel.hpp
-+++ opencv_contrib-master/modules/tracking/src/tldModel.hpp
-@@ -58,7 +58,9 @@ namespace cv
- void setBoudingBox(Rect2d boundingBox){ boundingBox_ = boundingBox; }
- void integrateRelabeled(Mat& img, Mat& imgBlurred, const std::vector<TLDDetector::LabeledPatch>& patches);
- void integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive);
-+#ifdef HAVE_OPENCL
- void ocl_integrateAdditional(const std::vector<Mat_<uchar> >& eForModel, const std::vector<Mat_<uchar> >& eForEnsemble, bool isPositive);
-+#endif
- Size getMinSize(){ return minSize_; }
- void printme(FILE* port = stdout);
- Ptr<TLDDetector> detector;
-diff --git opencv_contrib-master/modules/tracking/src/tldTracker.cpp opencv_contrib-master/modules/tracking/src/tldTracker.cpp
-index 0f1e2f7..a5190f5 100644
---- opencv_contrib-master/modules/tracking/src/tldTracker.cpp
-+++ opencv_contrib-master/modules/tracking/src/tldTracker.cpp
-@@ -123,9 +123,11 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
-
- if (i == 1)
- {
-+#ifdef HAVE_OPENCL
- if (ocl::haveOpenCL())
- DETECT_FLG = tldModel->detector->ocl_detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
- else
-+#endif
- DETECT_FLG = tldModel->detector->detect(imageForDetector, image_blurred, tmpCandid, detectorResults, tldModel->getMinSize());
- }
-
-@@ -211,17 +213,21 @@ bool TrackerTLDImpl::updateImpl(const Mat& image, Rect2d& boundingBox)
- tldModel->integrateRelabeled(imageForDetector, image_blurred, detectorResults);
- //dprintf(("%d relabeled by nExpert\n", negRelabeled));
- pExpert.additionalExamples(examplesForModel, examplesForEnsemble);
-- if (ocl::haveOpenCL())
-- tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true);
-- else
-- tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, true);
-+#ifdef HAVE_OPENCL
-+ if (ocl::haveOpenCL())
-+ tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, true);
-+ else
-+#endif
-+ tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, true);
- examplesForModel.clear(); examplesForEnsemble.clear();
- nExpert.additionalExamples(examplesForModel, examplesForEnsemble);
-
-- if (ocl::haveOpenCL())
-- tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false);
-- else
-- tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, false);
-+#ifdef HAVE_OPENCL
-+ if (ocl::haveOpenCL())
-+ tldModel->ocl_integrateAdditional(examplesForModel, examplesForEnsemble, false);
-+ else
-+#endif
-+ tldModel->integrateAdditional(examplesForModel, examplesForEnsemble, false);
- }
- else
- {
-diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.cpp opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
-index 673817e..af5ceaf6 100644
---- opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
-+++ opencv_contrib-master/modules/xfeatures2d/src/surf.cpp
-@@ -892,6 +892,7 @@ void SURF_Impl::detectAndCompute(InputArray _img, InputArray _mask,
- CV_Assert(!_img.empty() && CV_MAT_DEPTH(imgtype) == CV_8U && (imgcn == 1 || imgcn == 3 || imgcn == 4));
- CV_Assert(_descriptors.needed() || !useProvidedKeypoints);
-
-+#ifdef HAVE_OPENCL
- if( ocl::useOpenCL() )
- {
- SURF_OCL ocl_surf;
-@@ -918,6 +919,7 @@ void SURF_Impl::detectAndCompute(InputArray _img, InputArray _mask,
- return;
- }
- }
-+#endif // HAVE_OPENCL
-
- Mat img = _img.getMat(), mask = _mask.getMat(), mask1, sum, msum;
-
-diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.hpp opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
-index 2c4e271..cf3fda1 100644
---- opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
-+++ opencv_contrib-master/modules/xfeatures2d/src/surf.hpp
-@@ -64,6 +64,7 @@ class SURF_Impl : public SURF
- bool upright;
- };
-
-+#ifdef HAVE_OPENCL
- class SURF_OCL
- {
- public:
-@@ -145,6 +146,7 @@ class SURF_OCL
-
- int status;
- };
-+#endif // HAVE_OPENCL
-
- /*
- template<typename _Tp> void copyVectorToUMat(const std::vector<_Tp>& v, UMat& um)
-diff --git opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
-index b12ebd3..3d9845d 100644
---- opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
-+++ opencv_contrib-master/modules/xfeatures2d/src/surf.ocl.cpp
-@@ -43,6 +43,9 @@
- //
- //M*/
- #include "precomp.hpp"
-+
-+#ifdef HAVE_OPENCL
-+
- #include "surf.hpp"
-
- #include <cstdio>
-@@ -461,3 +464,4 @@ bool SURF_OCL::calcOrientation(UMat &keypoints)
- }
- }
-
-+#endif // HAVE_OPENCL
diff --git a/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch b/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch
deleted file mode 100644
index c9f85a7..0000000
--- a/media-libs/opencv/files/opencv-3.1.0-invalid-string-usage.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 9862a8bac536981c1c1a74710741fb40db4beac7 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.alekhin@itseez.com>
-Date: Wed, 23 Sep 2015 12:44:26 +0300
-Subject: [PATCH] fix invalid String usage
-
----
- modules/tracking/src/tldDetector.cpp | 6 +++---
- modules/ximgproc/samples/live_demo.cpp | 12 ++++++------
- 2 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git opencv_contrib-master/modules/tracking/src/tldDetector.cpp opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-index cbb783e..0916092 100644
---- opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-+++ opencv_contrib-master/modules/tracking/src/tldDetector.cpp
-@@ -122,7 +122,7 @@ namespace cv
- ocl::Kernel k;
- ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
- String error;
-- ocl::Program prog(src, NULL, error);
-+ ocl::Program prog(src, String(), error);
- k.create("NCC", prog);
- if (k.empty())
- printf("Kernel create failed!!!\n");
-@@ -198,7 +198,7 @@ namespace cv
- ocl::Kernel k;
- ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
- String error;
-- ocl::Program prog(src, NULL, error);
-+ ocl::Program prog(src, String(), error);
- k.create("batchNCC", prog);
- if (k.empty())
- printf("Kernel create failed!!!\n");
-@@ -355,7 +355,7 @@ namespace cv
- ocl::Kernel k;
- ocl::ProgramSource src = ocl::tracking::tldDetector_oclsrc;
- String error;
-- ocl::Program prog(src, NULL, error);
-+ ocl::Program prog(src, String(), error);
- k.create("NCC", prog);
- if (k.empty())
- printf("Kernel create failed!!!\n");
-diff --git opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
-index dd5dc1b..8e16de3 100644
---- opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
-+++ opencv_contrib-master/modules/ximgproc/samples/live_demo.cpp
-@@ -189,7 +189,7 @@ int main()
-
- //Thread trackbar
- cv::setNumThreads(g_numberOfCPUs); //speedup filtering
-- createTrackbar("Threads", NULL, &g_numberOfCPUs, cv::getNumberOfCPUs(), changeNumberOfCpuCallback);
-+ createTrackbar("Threads", String(), &g_numberOfCPUs, cv::getNumberOfCPUs(), changeNumberOfCpuCallback);
-
- //Buttons to choose different modes
- createButton("Mode Details Enhancement", changeModeCallback, (void*)filterDetailEnhancement, QT_RADIOBOX, true);
-@@ -199,15 +199,15 @@ int main()
-
- //sliders for Details Enhancement mode
- g_filterOp = filterDetailEnhancement; //set Details Enhancement as default filter
-- createTrackbar("Detail contrast", NULL, &g_contrastBase, 200);
-- createTrackbar("Detail level" , NULL, &g_detailsLevel, 200);
-+ createTrackbar("Detail contrast", String(), &g_contrastBase, 200);
-+ createTrackbar("Detail level" , String(), &g_detailsLevel, 200);
-
- //sliders for Stylizing mode
-- createTrackbar("Style gamma", NULL, &g_edgesGamma, 300);
-+ createTrackbar("Style gamma", String(), &g_edgesGamma, 300);
-
- //sliders for every mode
-- createTrackbar("Sigma Spatial", NULL, &g_sigmaSpatial, 200);
-- createTrackbar("Sigma Color" , NULL, &g_sigmaColor, 200);
-+ createTrackbar("Sigma Spatial", String(), &g_sigmaSpatial, 200);
-+ createTrackbar("Sigma Color" , String(), &g_sigmaColor, 200);
-
- Mat rawFrame, outputFrame;
- Mat srcFrame, processedFrame;
diff --git a/media-libs/opencv/opencv-3.1.0-r1.ebuild b/media-libs/opencv/opencv-3.1.0-r1.ebuild
deleted file mode 100644
index bbbcde9..0000000
--- a/media-libs/opencv/opencv-3.1.0-r1.ebuild
+++ /dev/null
@@ -1,252 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4,3_5} )
-
-inherit toolchain-funcs cmake-utils python-single-r1 java-pkg-opt-2 java-ant-2
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="http://opencv.org"
-
-SRC_URI="
- mirror://sourceforge/opencvlibrary/opencv-unix/${PV}/${P}.zip
- https://github.com/Itseez/${PN}/archive/${PV}.zip -> ${P}.zip
- contrib? ( https://github.com/Itseez/${PN}_contrib/archive/${PV}.zip -> ${PN}_contrib.zip )"
-
-LICENSE="BSD"
-SLOT="0/3.1" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux"
-IUSE="contrib cuda doc +eigen examples ffmpeg gdal gphoto2 gstreamer gtk ieee1394 ipp jpeg jpeg2k libav opencl openexr opengl openmp pch png +python qt4 qt5 testprograms threads tiff vaapi v4l vtk webp xine"
-REQUIRED_USE="
- python? ( ${PYTHON_REQUIRED_USE} )
- ?? ( qt4 qt5 )
-"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# gtk? ( !qt4 )
-# opengl? ( || ( gtk qt4 ) )
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2
- sys-libs/zlib
- cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
- ffmpeg? (
- libav? ( media-video/libav:0= )
- !libav? ( media-video/ffmpeg:0= )
- )
- gdal? ( sci-libs/gdal )
- gphoto2? ( media-libs/libgphoto2 )
- gstreamer? (
- media-libs/gstreamer:1.0
- media-libs/gst-plugins-base:1.0
- )
- gtk? (
- dev-libs/glib:2
- x11-libs/gtk+:2
- opengl? ( x11-libs/gtkglext )
- )
- java? ( >=virtual/jre-1.6:* )
- jpeg? ( virtual/jpeg:0 )
- jpeg2k? ( media-libs/jasper )
- ieee1394? (
- media-libs/libdc1394
- sys-libs/libraw1394
- )
- ipp? ( sci-libs/ipp )
- opencl? ( virtual/opencl )
- openexr? ( media-libs/openexr )
- opengl? ( virtual/opengl virtual/glu )
- png? ( media-libs/libpng:0= )
- python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
- qt4? (
- dev-qt/qtgui:4
- dev-qt/qttest:4
- opengl? ( dev-qt/qtopengl:4 )
- )
- qt5? (
- dev-qt/qtgui:5
- dev-qt/qttest:5
- dev-qt/qtconcurrent:5
- opengl? ( dev-qt/qtopengl:5 )
- )
- threads? ( dev-cpp/tbb )
- tiff? ( media-libs/tiff:0 )
- v4l? ( >=media-libs/libv4l-0.8.3 )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp )
- xine? ( media-libs/xine-lib )
-"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- eigen? ( dev-cpp/eigen:3 )
- java? ( >=virtual/jdk-1.6 )
-"
-
-pkg_setup() {
- use python && python-single-r1_pkg_setup
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
-
- epatch "${FILESDIR}/${PN}-3.0.0-gles.patch" \
- "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch"
-
- # remove bundled stuff
- rm -rf 3rdparty
- sed -i \
- -e '/add_subdirectory(.*3rdparty.*)/ d' \
- CMakeLists.txt cmake/*cmake || die
-
- if use contrib; then
-
- cd "${WORKDIR}"
- epatch "${FILESDIR}/${PN}-3.1.0-fix-hal-headers.patch" \
- "${FILESDIR}/${PN}-3.1.0-fix-ocl-declaration.patch" \
- "${FILESDIR}/${PN}-3.1.0-invalid-string-usage.patch"
- fi
-
- java-pkg-opt-2_src_prepare
-}
-
-src_configure() {
- if use openmp; then
- tc-has-openmp || die "Please switch to an openmp compatible compiler"
- fi
-
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-
- # please dont sort here, order is the same as in CMakeLists.txt
- local mycmakeargs=(
- # the optinal dependency libraries
- $(cmake-utils_use_with ieee1394 1394)
- -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_CARBON=OFF # APPLE
- $(cmake-utils_use_with eigen)
- $(cmake-utils_use_with ffmpeg)
- -DWITH_VFW=OFF # video windows support
- $(cmake-utils_use_with gstreamer)
- -DWITH_GSTREAMER_0_10=OFF
- $(cmake-utils_use_with gtk)
- -DWITH_GTK_2_X=OFF
- $(cmake-utils_use_with ipp)
- $(cmake-utils_use_with java)
- $(cmake-utils_use_with jpeg2k JASPER)
- $(cmake-utils_use_with jpeg)
- $(cmake-utils_use_with webp)
- $(cmake-utils_use_with opencl)
- $(cmake-utils_use_with gphoto2)
- $(cmake-utils_use_with openexr)
- $(cmake-utils_use_with opengl)
- $(cmake-utils_use_with openmp)
- -DWITH_OPENNI=OFF #not packaged
- -DWITH_OPENNI2=OFF #not packaged
- $(cmake-utils_use_with png)
- $(cmake-utils_use_build python opencv_python)
- -DWITH_PVAPI=OFF # not packaged
- -DWITH_GIGEAPI=OFF
- -DWITH_QUICKTIME=OFF
- -DWITH_WIN32UI=OFF
- $(cmake-utils_use_with threads TBB)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- $(cmake-utils_use_with tiff)
- -DWITH_UNICAP=OFF # not packaged
- $(cmake-utils_use_with v4l V4L)
- $(cmake-utils_use_with vtk VTK)
- -DWITH_LIBV4L=ON
- -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_VIDEOINPUT=OFF # windows only
- -DWITH_XIMEA=OFF # windows only
- $(cmake-utils_use_with xine)
- -DWITH_CLP=OFF
- $(cmake-utils_use_with opencl)
- -DWITH_OPENCL_SVM=OFF
- $(cmake-utils_use_with opencl OPENCLAMDFFT)
- $(cmake-utils_use_with opencl OPENCLAMDBLAS)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=ON #default
- $(cmake-utils_use_with vaapi VA)
- $(cmake-utils_use_with vaapi VA_INTEL)
- $(cmake-utils_use_with gdal gdal)
- #
- # OpenCV build components
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_ANDROID_EXAMPLES=OFF
- $(cmake-utils_use_build doc DOCS)
- $(cmake-utils_use_build examples)
- $(cmake-utils_use_build java opencv_java) #for -java bug #555650
- -DBUILD_PERF_TESTS=OFF
- $(cmake-utils_use_build testprograms TESTS)
- # install examples, tests etc
- $(cmake-utils_use examples INSTALL_C_EXAMPLES)
- $(cmake-utils_use testprograms INSTALL_TESTS)
- # build options
- $(cmake-utils_use_enable pch PRECOMPILED_HEADERS)
- -DOPENCV_EXTRA_FLAGS_RELEASE="" # black magic
- )
-
- if use qt4; then
- mycmakeargs+=( "-DWITH_QT=4" )
- elif use qt5; then
- mycmakeargs+=( "-DWITH_QT=5" )
- else
- mycmakeargs+=( "-DWITH_QT=OFF" )
- fi
-
- if use contrib; then
- mycmakeargs+=( "-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules" )
- fi
-
- if use cuda; then
- mycmakeargs+=( "-DWITH_CUDA=ON" )
- mycmakeargs+=( "-DWITH_CUBLAS=ON" )
- mycmakeargs+=( "-DWITH_CUFFT=ON" )
- mycmakeargs+=( "-DWITH_NVCUVID=ON" ) #Nvidia video decoding library supp
- else
- mycmakeargs+=( "-DWITH_CUDA=OFF" )
- mycmakeargs+=( "-DWITH_CUBLAS=OFF" )
- mycmakeargs+=( "-DWITH_CUFFT=OFF" )
- mycmakeargs+=( "-DWITH_NVCUVID=OFF" )
- fi
-
- if use examples && use python; then
- mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=ON" )
- else
- mycmakeargs+=( "-DINSTALL_PYTHON_EXAMPLES=OFF" )
- fi
-
- # things we want to be hard off or not yet figured out
- mycmakeargs+=(
- "-DOPENCV_BUILD_3RDPARTY_LIBS=OFF"
- "-DBUILD_LATEX_DOCS=OFF"
- "-DBUILD_PACKAGE=OFF"
- "-DENABLE_PROFILING=OFF"
- )
-
- # things we want to be hard enabled not worth useflag
- mycmakeargs+=(
- "-DCMAKE_SKIP_RPATH=ON"
- "-DOPENCV_DOC_INSTALL_PATH=${EPREFIX}/usr/share/doc/${PF}"
- )
-
- # hardcode cuda paths
- mycmakeargs+=(
- "-DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda"
- )
-
- # workaround for bug 413429
- tc-export CC CXX
-
- cmake-utils_src_configure
-}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2016-04-07 17:39 Amy Winston
0 siblings, 0 replies; 20+ messages in thread
From: Amy Winston @ 2016-04-07 17:39 UTC (permalink / raw
To: gentoo-commits
commit: 6cd559c43465c20af06254031d6b6bef023be901
Author: Amy Winston <amynka <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 7 17:34:44 2016 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Thu Apr 7 17:36:44 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cd559c4
media-libs/opencv: disable git autodetect bug #558556
Package-Manager: portage-2.2.26
.../files/opencv-2.4.10-git-autodetect.patch | 57 +++++++++++++++++++++
.../files/opencv-2.4.11-git-autodetect.patch | 57 +++++++++++++++++++++
.../files/opencv-2.4.12-git-autodetect.patch | 57 +++++++++++++++++++++
.../opencv/files/opencv-2.4.9-git-autodetect.patch | 59 ++++++++++++++++++++++
.../opencv/files/opencv-3.0.0-git-autodetect.patch | 41 +++++++++++++++
.../opencv/files/opencv-3.1.0-git-autodetect.patch | 42 +++++++++++++++
media-libs/opencv/opencv-2.4.10.ebuild | 3 +-
media-libs/opencv/opencv-2.4.11.ebuild | 3 +-
media-libs/opencv/opencv-2.4.12.ebuild | 3 +-
media-libs/opencv/opencv-2.4.9.ebuild | 3 +-
media-libs/opencv/opencv-3.0.0.ebuild | 3 +-
media-libs/opencv/opencv-3.1.0-r1.ebuild | 3 +-
media-libs/opencv/opencv-3.1.0-r2.ebuild | 3 +-
13 files changed, 327 insertions(+), 7 deletions(-)
diff --git a/media-libs/opencv/files/opencv-2.4.10-git-autodetect.patch b/media-libs/opencv/files/opencv-2.4.10-git-autodetect.patch
new file mode 100644
index 0000000..9349864
--- /dev/null
+++ b/media-libs/opencv/files/opencv-2.4.10-git-autodetect.patch
@@ -0,0 +1,57 @@
+--- opencv-2.4.10/work/opencv-2.4.10/CMakeLists.txt.old 2016-04-07 14:17:10.524981054 +0200
++++ opencv-2.4.10/work/opencv-2.4.10/CMakeLists.txt 2016-04-07 14:13:38.726989961 +0200
+@@ -375,32 +375,32 @@
+ # ----------------------------------------------------------------------------
+
+ # don't use FindGit because it requires CMake 2.8.2
+-set(git_names git eg) # eg = easy git
++#set(git_names git eg) # eg = easy git
+ # Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
+-if(CMAKE_HOST_WIN32)
+- if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+- set(git_names git.cmd git eg.cmd eg)
+- endif()
+-endif()
++#if(CMAKE_HOST_WIN32)
++# if(NOT CMAKE_GENERATOR MATCHES "MSYS")
++# set(git_names git.cmd git eg.cmd eg)
++# endif()
++#endif()
+
+-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
+-mark_as_advanced(GIT_EXECUTABLE)
++#find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
++#mark_as_advanced(GIT_EXECUTABLE)
+
+-if(GIT_EXECUTABLE)
+- execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
++#if(GIT_EXECUTABLE)
++# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
+ # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/files/opencv-2.4.11-git-autodetect.patch b/media-libs/opencv/files/opencv-2.4.11-git-autodetect.patch
new file mode 100644
index 0000000..12a5ca0
--- /dev/null
+++ b/media-libs/opencv/files/opencv-2.4.11-git-autodetect.patch
@@ -0,0 +1,57 @@
+--- opencv-2.4.11/work/opencv-2.4.11/CMakeLists.txt.old 2016-04-07 14:20:23.874972922 +0200
++++ opencv-2.4.11/work/opencv-2.4.11/CMakeLists.txt 2016-04-07 14:21:15.689970743 +0200
+@@ -382,32 +382,32 @@
+ # ----------------------------------------------------------------------------
+
+ # don't use FindGit because it requires CMake 2.8.2
+-set(git_names git eg) # eg = easy git
++#set(git_names git eg) # eg = easy git
+ # Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
+-if(CMAKE_HOST_WIN32)
+- if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+- set(git_names git.cmd git eg.cmd eg)
+- endif()
+-endif()
++#if(CMAKE_HOST_WIN32)
++# if(NOT CMAKE_GENERATOR MATCHES "MSYS")
++# set(git_names git.cmd git eg.cmd eg)
++# endif()
++#endif()
+
+-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
+-mark_as_advanced(GIT_EXECUTABLE)
++#find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
++#mark_as_advanced(GIT_EXECUTABLE)
+
+-if(GIT_EXECUTABLE)
+- execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
++#if(GIT_EXECUTABLE)
++# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
+ # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/files/opencv-2.4.12-git-autodetect.patch b/media-libs/opencv/files/opencv-2.4.12-git-autodetect.patch
new file mode 100644
index 0000000..e981c37
--- /dev/null
+++ b/media-libs/opencv/files/opencv-2.4.12-git-autodetect.patch
@@ -0,0 +1,57 @@
+--- opencv-2.4.12/work/opencv-2.4.12/CMakeLists.txt.old 2016-04-07 14:44:17.461912634 +0200
++++ opencv-2.4.12/work/opencv-2.4.12/CMakeLists.txt 2016-04-07 14:45:10.674910396 +0200
+@@ -388,32 +388,32 @@
+ # ----------------------------------------------------------------------------
+
+ # don't use FindGit because it requires CMake 2.8.2
+-set(git_names git eg) # eg = easy git
++#set(git_names git eg) # eg = easy git
+ # Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
+-if(CMAKE_HOST_WIN32)
+- if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+- set(git_names git.cmd git eg.cmd eg)
+- endif()
+-endif()
++#if(CMAKE_HOST_WIN32)
++# if(NOT CMAKE_GENERATOR MATCHES "MSYS")
++# set(git_names git.cmd git eg.cmd eg)
++# endif()
++#endif()
+
+-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
+-mark_as_advanced(GIT_EXECUTABLE)
++#find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
++#mark_as_advanced(GIT_EXECUTABLE)
+
+-if(GIT_EXECUTABLE)
+- execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
++#if(GIT_EXECUTABLE)
++# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
+ # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/files/opencv-2.4.9-git-autodetect.patch b/media-libs/opencv/files/opencv-2.4.9-git-autodetect.patch
new file mode 100644
index 0000000..7c45857
--- /dev/null
+++ b/media-libs/opencv/files/opencv-2.4.9-git-autodetect.patch
@@ -0,0 +1,59 @@
+--- CMakeLists.txt.old 2016-04-07 13:07:18.177841867 +0200
++++ CMakeLists.txt 2016-04-07 13:09:39.449835926 +0200
+@@ -369,32 +369,32 @@
+ # ----------------------------------------------------------------------------
+
+ # don't use FindGit because it requires CMake 2.8.2
+-set(git_names git eg) # eg = easy git
++#set(git_names git eg) # eg = easy git
+ # Prefer .cmd variants on Windows unless running in a Makefile in the MSYS shell
+-if(CMAKE_HOST_WIN32)
+- if(NOT CMAKE_GENERATOR MATCHES "MSYS")
+- set(git_names git.cmd git eg.cmd eg)
+- endif()
+-endif()
+-
+-find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
+-mark_as_advanced(GIT_EXECUTABLE)
+-
+-if(GIT_EXECUTABLE)
+- execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
++#if(CMAKE_HOST_WIN32)
++# if(NOT CMAKE_GENERATOR MATCHES "MSYS")
++# set(git_names git.cmd git eg.cmd eg)
++# endif()
++#endif()
++
++#find_host_program(GIT_EXECUTABLE NAMES ${git_names} PATH_SUFFIXES Git/cmd Git/bin DOC "git command line client")
++#mark_as_advanced(GIT_EXECUTABLE)
++
++#if(GIT_EXECUTABLE)
++# execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty --match "2.[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
+ # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/files/opencv-3.0.0-git-autodetect.patch b/media-libs/opencv/files/opencv-3.0.0-git-autodetect.patch
new file mode 100644
index 0000000..7413075
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.0.0-git-autodetect.patch
@@ -0,0 +1,41 @@
+--- opencv-3.0.0/work/opencv-3.0.0/CMakeLists.txt.old 2016-04-07 14:28:07.641953419 +0200
++++ opencv-3.0.0/work/opencv-3.0.0/CMakeLists.txt 2016-04-07 14:28:47.713951734 +0200
+@@ -433,23 +433,23 @@
+ # ----------------------------------------------------------------------------
+ # Autodetect if we are in a GIT repository
+ # ----------------------------------------------------------------------------
+-find_host_package(Git QUIET)
++#find_host_package(Git QUIET)
+
+-if(GIT_FOUND)
+- execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
++#if(GIT_FOUND)
++# execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
+ # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch b/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch
new file mode 100644
index 0000000..e4fa287
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch
@@ -0,0 +1,42 @@
+--- opencv-3.1.0-r1/work/opencv-3.1.0/CMakeLists.txt.old 2016-04-07 14:34:35.090937125 +0200
++++ opencv-3.1.0-r1/work/opencv-3.1.0/CMakeLists.txt 2016-04-07 14:35:18.492935300 +0200
+@@ -444,23 +444,23 @@
+ # ----------------------------------------------------------------------------
+ # Autodetect if we are in a GIT repository
+ # ----------------------------------------------------------------------------
+-find_host_package(Git QUIET)
++#find_host_package(Git QUIET)
+
+-if(GIT_FOUND)
+- execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-else()
+- # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++#if(GIT_FOUND)
++# execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++#else()
++# # We don't have git:
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/opencv-2.4.10.ebuild b/media-libs/opencv/opencv-2.4.10.ebuild
index 04799f0..7e0970f 100644
--- a/media-libs/opencv/opencv-2.4.10.ebuild
+++ b/media-libs/opencv/opencv-2.4.10.ebuild
@@ -85,7 +85,8 @@ src_prepare() {
"${FILESDIR}/${PN}-2.4.8-javamagic.patch" \
"${FILESDIR}/${PN}-2.4.9-libav10.patch" \
"${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch" \
- "${FILESDIR}/${PN}-2.4.10-pic-x86.patch"
+ "${FILESDIR}/${PN}-2.4.10-pic-x86.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-2.4.11.ebuild b/media-libs/opencv/opencv-2.4.11.ebuild
index d5fc0f7..225533b 100644
--- a/media-libs/opencv/opencv-2.4.11.ebuild
+++ b/media-libs/opencv/opencv-2.4.11.ebuild
@@ -83,7 +83,8 @@ src_prepare() {
"${FILESDIR}/${PN}-2.4.3-gcc47.patch" \
"${FILESDIR}/${PN}-2.4.2-cflags.patch" \
"${FILESDIR}/${PN}-2.4.8-javamagic.patch" \
- "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch"
+ "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-2.4.12.ebuild b/media-libs/opencv/opencv-2.4.12.ebuild
index e6096e5..be13558 100644
--- a/media-libs/opencv/opencv-2.4.12.ebuild
+++ b/media-libs/opencv/opencv-2.4.12.ebuild
@@ -83,7 +83,8 @@ src_prepare() {
"${FILESDIR}/${PN}-2.4.3-gcc47.patch" \
"${FILESDIR}/${PN}-2.4.2-cflags.patch" \
"${FILESDIR}/${PN}-2.4.8-javamagic.patch" \
- "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch"
+ "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-2.4.9.ebuild b/media-libs/opencv/opencv-2.4.9.ebuild
index 872d74c..e192c8d 100644
--- a/media-libs/opencv/opencv-2.4.9.ebuild
+++ b/media-libs/opencv/opencv-2.4.9.ebuild
@@ -86,7 +86,8 @@ src_prepare() {
"${FILESDIR}/${PN}-2.4.8-javamagic.patch" \
"${FILESDIR}/${PN}-2.4.9-cuda.patch" \
"${FILESDIR}/${PN}-2.4.9-libav10.patch" \
- "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch"
+ "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-3.0.0.ebuild b/media-libs/opencv/opencv-3.0.0.ebuild
index 5e435a0..60aff3a 100644
--- a/media-libs/opencv/opencv-3.0.0.ebuild
+++ b/media-libs/opencv/opencv-3.0.0.ebuild
@@ -90,7 +90,8 @@ pkg_setup() {
}
src_prepare() {
- epatch "${FILESDIR}/${P}-gles.patch"
+ epatch "${FILESDIR}/${P}-gles.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-3.1.0-r1.ebuild b/media-libs/opencv/opencv-3.1.0-r1.ebuild
index bbbcde9..5df52b0 100644
--- a/media-libs/opencv/opencv-3.1.0-r1.ebuild
+++ b/media-libs/opencv/opencv-3.1.0-r1.ebuild
@@ -94,7 +94,8 @@ pkg_setup() {
src_prepare() {
epatch "${FILESDIR}/${PN}-3.0.0-gles.patch" \
- "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch"
+ "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
diff --git a/media-libs/opencv/opencv-3.1.0-r2.ebuild b/media-libs/opencv/opencv-3.1.0-r2.ebuild
index 310b4dc..66d7de4 100644
--- a/media-libs/opencv/opencv-3.1.0-r2.ebuild
+++ b/media-libs/opencv/opencv-3.1.0-r2.ebuild
@@ -94,7 +94,8 @@ pkg_setup() {
src_prepare() {
epatch "${FILESDIR}/${PN}-3.0.0-gles.patch" \
- "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch"
+ "${FILESDIR}/${PN}-3.1.0-cmake-no-opengl.patch" \
+ "${FILESDIR}/${P}-git-autodetect.patch"
# remove bundled stuff
rm -rf 3rdparty
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2016-06-09 13:54 Amy Winston
0 siblings, 0 replies; 20+ messages in thread
From: Amy Winston @ 2016-06-09 13:54 UTC (permalink / raw
To: gentoo-commits
commit: cf149b0c51363346080559b66a540c956cfd05aa
Author: dracwyrm <j.scruggs <AT> gmail <DOT> com>
AuthorDate: Thu Jun 9 12:52:00 2016 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Thu Jun 9 13:52:29 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf149b0c
media-libs/opencv: change to EAPI 6 and fix python installation
-Add patch to install the correct bindings based on single_python_target
-Fix Cuda in ebuild
-Remove unused CMake options
-Modified patch to be -p1 format
-Tiny fixes and rewrites for EAPI 6 specs
.../files/opencv-3.1.0-gentooify-python.patch | 101 ++++++++
.../opencv/files/opencv-3.1.0-git-autodetect.patch | 4 +-
.../opencv/files/opencv-3.1.0-java-magic.patch | 47 ++++
media-libs/opencv/opencv-3.1.0-r4.ebuild | 269 +++++++++++++++++++++
4 files changed, 419 insertions(+), 2 deletions(-)
diff --git a/media-libs/opencv/files/opencv-3.1.0-gentooify-python.patch b/media-libs/opencv/files/opencv-3.1.0-gentooify-python.patch
new file mode 100644
index 0000000..7bb01b4
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-gentooify-python.patch
@@ -0,0 +1,101 @@
+diff -purN a/cmake/OpenCVDetectGentooPython.cmake b/cmake/OpenCVDetectGentooPython.cmake
+--- a/cmake/OpenCVDetectGentooPython.cmake 1970-01-01 01:00:00.000000000 +0100
++++ b/cmake/OpenCVDetectGentooPython.cmake 2016-06-09 10:21:09.236148446 +0100
+@@ -0,0 +1,77 @@
++# Find specified Python version
++# Arguments:
++# found (variable): Set if interpreter found
++# executable (variable): Output of executable found
++# version_string (variable): Output of found version
++# version_major (variable): Output of found major version
++# version_minor (variable): Output of found minor version
++# libs_found (variable): Set if libs found
++# libs_version_string (variable): Output of found libs version
++# libraries (variable): Output of found Python libraries
++# library (variable): Output of found Python library
++# debug_libraries (variable): Output of found Python debug libraries
++# debug_library (variable): Output of found Python debug library
++# include_path (variable): Output of found Python include path
++# include_dir (variable): Output of found Python include dir
++# include_dir2 (variable): Output of found Python include dir2
++# packages_path (variable): Output of found Python packages path
++# numpy_include_dirs (variable): Output of found Python Numpy include dirs
++function(find_python found executable version_string version_major version_minor
++ libs_found libs_version_string libraries library debug_libraries
++ debug_library include_path include_dir include_dir2 packages_path
++ numpy_include_dirs)
++
++ set(${found} "TRUE" PARENT_SCOPE)
++ set(${executable} "${GENTOO_PYTHON_EXECUTABLE}" CACHE FILEPATH "Path to Python interpretor")
++ set(${version_string} "${GENTOO_PYTHON_MAJOR}.${GENTOO_PYTHON_MINOR}" PARENT_SCOPE)
++ set(${version_major} "${GENTOO_PYTHON_MAJOR}" PARENT_SCOPE)
++ set(${version_minor} "${GENTOO_PYTHON_MINOR}" PARENT_SCOPE)
++ set(${libs_found} "TRUE" PARENT_SCOPE)
++ set(${libs_version_string} "${version_string}" PARENT_SCOPE)
++ set(${libraries} "${GENTOO_PYTHON_LIBRARIES}" PARENT_SCOPE)
++ set(${library} "${GENTOO_PYTHON_LIBRARIES}" CACHE FILEPATH "Path to Python library")
++ set(${debug_libraries} "${GENTOO_PYTHON_DEBUG_LIBRARIES}" PARENT_SCOPE)
++ set(${debug_library} "${GENTOO_PYTHON_DEBUG_LIBRARIES}" CACHE FILEPATH "Path to Python debug")
++ set(${include_path} "${GENTOO_PYTHON_INCLUDE_PATH}" PARENT_SCOPE)
++ set(${include_dir} "${GENTOO_PYTHON_INCLUDE_PATH}" CACHE PATH "Python include dir")
++ set(${include_dir2} "${GENTOO_PYTHON_INCLUDE_PATH}" CACHE PATH "Python include dir 2")
++ set(${packages_path} "${GENTOO_PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
++ set(${numpy_include_dirs} "${GENTOO_PYTHON_PACKAGES_PATH}/numpy/core/include/" CACHE PATH "Path to numpy headers")
++endfunction(find_python)
++
++# In order to use existing CMake files, this needs to be here to switch between
++# Python 2 and 3. It's messy and could be in the ebuild to declare this,
++# but then the ebuild would be a mile long and unreadable. This makes then
++# messy stuff hidden out of the way.
++set(PYTHON2INTERP_FOUND "FALSE")
++set(PYTHON3INTERP_FOUND "FALSE")
++
++if(WITH_PYTHON)
++ if(GENTOO_PYTHON_MAJOR EQUAL 2)
++ find_python(PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
++ PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
++ PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
++ PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH
++ PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH
++ PYTHON2_NUMPY_INCLUDE_DIRS)
++ endif()
++
++ if(GENTOO_PYTHON_MAJOR EQUAL 3)
++ find_python(PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING
++ PYTHON3_VERSION_MAJOR PYTHON3_VERSION_MINOR PYTHON3LIBS_FOUND
++ PYTHON3LIBS_VERSION_STRING PYTHON3_LIBRARIES PYTHON3_LIBRARY
++ PYTHON3_DEBUG_LIBRARIES PYTHON3_LIBRARY_DEBUG PYTHON3_INCLUDE_PATH
++ PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH
++ PYTHON3_NUMPY_INCLUDE_DIRS)
++ endif()
++endif()
++
++if(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
++ set(PYTHON_DEFAULT_AVAILABLE "TRUE")
++ set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
++elseif(PYTHON3INTERP_FOUND) # Use Python 2 as fallback Python interpreter (if there is no Python 2)
++ set(PYTHON_DEFAULT_AVAILABLE "TRUE")
++ set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}")
++else()
++ set(PYTHON_DEFAULT_AVAILABLE "FALSE")
++endif()
+diff -purN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2015-12-18 15:02:16.000000000 +0000
++++ b/CMakeLists.txt 2016-06-08 18:57:53.489793304 +0100
+@@ -215,6 +215,7 @@ OCV_OPTION(WITH_VA "Include
+ OCV_OPTION(WITH_VA_INTEL "Include Intel VA-API/OpenCL support" OFF IF (UNIX AND NOT ANDROID) )
+ OCV_OPTION(WITH_GDAL "Include GDAL Support" OFF IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
+ OCV_OPTION(WITH_GPHOTO2 "Include gPhoto2 library support" ON IF (UNIX AND NOT ANDROID) )
++OCV_OPTION(WITH_PYTHON "Include python bindings" OFF)
+
+ # OpenCV build components
+ # ===================================================
+@@ -559,7 +560,7 @@ if(BUILD_DOCS)
+ endif(BUILD_DOCS)
+
+ # --- Python Support ---
+-include(cmake/OpenCVDetectPython.cmake)
++include(cmake/OpenCVDetectGentooPython.cmake)
+
+ # --- Java Support ---
+ include(cmake/OpenCVDetectApacheAnt.cmake)
diff --git a/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch b/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch
index e4fa287..f4bf0da 100644
--- a/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch
+++ b/media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch
@@ -1,5 +1,5 @@
---- opencv-3.1.0-r1/work/opencv-3.1.0/CMakeLists.txt.old 2016-04-07 14:34:35.090937125 +0200
-+++ opencv-3.1.0-r1/work/opencv-3.1.0/CMakeLists.txt 2016-04-07 14:35:18.492935300 +0200
+--- a/CMakeLists.txt 2016-04-07 14:34:35.090937125 +0200
++++ b/CMakeLists.txt 2016-04-07 14:35:18.492935300 +0200
@@ -444,23 +444,23 @@
# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
diff --git a/media-libs/opencv/files/opencv-3.1.0-java-magic.patch b/media-libs/opencv/files/opencv-3.1.0-java-magic.patch
new file mode 100644
index 0000000..96a0e7e
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.1.0-java-magic.patch
@@ -0,0 +1,47 @@
+diff -purN a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2015-12-18 15:02:16.000000000 +0000
++++ b/CMakeLists.txt 2016-06-06 17:15:48.006020666 +0100
+@@ -209,6 +209,7 @@ OCV_OPTION(WITH_OPENCLAMDFFT "Include
+ OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
+ OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF (WIN32 AND NOT WINRT) )
+ OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF (WIN32 AND NOT WINRT) )
++OCV_OPTION(WITH_JAVA "Include Java support" ON)
+ OCV_OPTION(WITH_IPP_A "Include Intel IPP_A support" OFF IF (MSVC OR X86 OR X86_64) )
+ OCV_OPTION(WITH_MATLAB "Include Matlab support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
+ OCV_OPTION(WITH_VA "Include VA support" OFF IF (UNIX AND NOT ANDROID) )
+@@ -562,20 +563,25 @@ endif(BUILD_DOCS)
+ include(cmake/OpenCVDetectPython.cmake)
+
+ # --- Java Support ---
+-include(cmake/OpenCVDetectApacheAnt.cmake)
+-if(ANDROID)
+- include(cmake/OpenCVDetectAndroidSDK.cmake)
++If(WITH_JAVA)
++ include(cmake/OpenCVDetectApacheAnt.cmake)
++ if(ANDROID)
++ include(cmake/OpenCVDetectAndroidSDK.cmake)
+
+- if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
+- message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
++ if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
++ message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
++ endif()
++ else()
++ find_package(JNI)
+ endif()
+-else()
+- find_package(JNI)
+-endif()
+
+-if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
+- SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
++ if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
++ SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
++ else()
++ SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
++ endif()
+ else()
++ SET(ANT_EXECUTABLE "")
+ SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
+ endif()
+
diff --git a/media-libs/opencv/opencv-3.1.0-r4.ebuild b/media-libs/opencv/opencv-3.1.0-r4.ebuild
new file mode 100644
index 0000000..d83ba38
--- /dev/null
+++ b/media-libs/opencv/opencv-3.1.0-r4.ebuild
@@ -0,0 +1,269 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit toolchain-funcs cmake-utils python-single-r1 java-pkg-opt-2 java-ant-2
+
+DESCRIPTION="A collection of algorithms and sample code for
+ various computer vision problems"
+HOMEPAGE="http://opencv.org"
+
+SRC_URI="
+ mirror://sourceforge/opencvlibrary/opencv-unix/${PV}/${P}.zip
+ https://github.com/Itseez/${PN}/archive/${PV}.zip -> ${P}.zip
+ contrib? (
+ https://github.com/Itseez/${PN}_contrib/archive/cd5993c6576267875adac300b9ddd1f881bb1766.zip
+ -> ${P}_contrib.zip )" #commit from Sun, 27 Mar 2016 17:31:51
+
+LICENSE="BSD"
+SLOT="0/3.1" # subslot = libopencv* soname version
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="contrib cuda +eigen examples ffmpeg gdal gphoto2 gstreamer gtk \
+ ieee1394 ipp jpeg jpeg2k libav opencl openexr opengl openmp pch png \
+ +python qt4 qt5 testprograms threads tiff vaapi v4l vtk webp xine"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+ ?? ( qt4 qt5 )"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# gtk? ( !qt4 )
+# opengl? ( || ( gtk qt4 ) )
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2
+ sys-libs/zlib
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
+ ffmpeg? (
+ libav? ( media-video/libav:0= )
+ !libav? ( media-video/ffmpeg:0= )
+ )
+ gdal? ( sci-libs/gdal )
+ gphoto2? ( media-libs/libgphoto2 )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ gtk? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ opengl? ( x11-libs/gtkglext )
+ )
+ java? ( >=virtual/jre-1.6:* )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ ieee1394? (
+ media-libs/libdc1394
+ sys-libs/libraw1394
+ )
+ ipp? ( sci-libs/ipp )
+ opencl? ( virtual/opencl )
+ openexr? ( media-libs/openexr )
+ opengl? ( virtual/opengl virtual/glu )
+ png? ( media-libs/libpng:0= )
+ python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qttest:4
+ opengl? ( dev-qt/qtopengl:4 )
+ )
+ qt5? (
+ dev-qt/qtgui:5
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ threads? ( dev-cpp/tbb )
+ tiff? ( media-libs/tiff:0 )
+ v4l? ( >=media-libs/libv4l-0.8.3 )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp )
+ xine? ( media-libs/xine-lib )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ eigen? ( dev-cpp/eigen:3 )
+ java? ( >=virtual/jdk-1.6 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.0-gles.patch
+ "${FILESDIR}"/${PN}-3.1.0-cmake-no-opengl.patch
+ "${FILESDIR}"/${P}-git-autodetect.patch
+ "${FILESDIR}"/${P}-java-magic.patch
+ "${FILESDIR}"/${P}-gentooify-python.patch
+)
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # remove bundled stuff
+ rm -rf 3rdparty || die "Removing 3rd party components failed"
+ sed -i \
+ -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ CMakeLists.txt cmake/*cmake || die
+
+ java-pkg-opt-2_src_prepare
+}
+
+src_configure() {
+ if use openmp; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+
+ # please dont sort here, order is the same as in CMakeLists.txt
+ local mycmakeargs=(
+ # Optional 3rd party components
+ # ===================================================
+ -DWITH_1394=$(usex ieee1394 ON OFF)
+ -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_VTK=$(usex vtk ON OFF)
+ -DWITH_EIGEN=$(usex eigen ON OFF)
+ -DWITH_VFW=OFF # Video windows support
+ -DWITH_FFMPEG=$(usex ffmpeg ON OFF)
+ -DWITH_GSTREAMER=$(usex gstreamer ON OFF)
+ -DWITH_GSTREAMER_0_10=OFF # Don't want this
+ -DWITH_GTK=$(usex gtk ON OFF)
+ -DWITH_GTK_2_X=OFF
+ -DWITH_IPP=$(usex ipp ON OFF)
+ -DWITH_JASPER=$(usex jpeg2k ON OFF)
+ -DWITH_JPEG=$(usex jpeg ON OFF)
+ -DWITH_WEBP=$(usex webp ON OFF)
+ -DWITH_OPENEXR=$(usex openexr ON OFF)
+ -DWITH_OPENGL=$(usex opengl ON OFF)
+ -DWITH_OPENNI=OFF # Not packaged
+ -DWITH_OPENNI2=OFF # Not packaged
+ -DWITH_PNG=$(usex png ON OFF)
+ -DWITH_PVAPI=OFF # Not packaged
+ -DWITH_GIGEAPI=OFF
+ # Qt in CMakeList.txt here: See below
+ -DWITH_WIN32UI=OFF # Windows only
+ -DWITH_QUICKTIME=OFF
+ -DWITH_TBB=$(usex threads ON OFF)
+ -DWITH_OPENMP=$(usex openmp ON OFF)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ -DWITH_TIFF=$(usex tiff ON OFF)
+ -DWITH_UNICAP=OFF # Not packaged
+ -DWITH_V4L=$(usex v4l ON OFF)
+ -DWITH_LIBV4L=$(usex v4l ON OFF)
+ -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_XIMEA=OFF # Windows only
+ -DWITH_XINE=$(usex xine ON OFF)
+ -DWITH_CLP=OFF
+ -DWITH_OPENCL=$(usex opencl ON OFF)
+ -DWITH_OPENCL_SVM=OFF
+ -DWITH_OPENCLAMDFFT=$(usex opencl ON OFF)
+ -DWITH_OPENCLAMDBLAS=$(usex opencl ON OFF)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_JAVA=$(usex java ON OFF) # Ant needed, no compile flag
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=ON
+ -DWITH_VA=$(usex vaapi ON OFF)
+ -DWITH_VA_INTEL=$(usex vaapi ON OFF)
+ -DWITH_GDAL=$(usex gdal ON OFF)
+ -DWITH_GPHOTO2=$(usex gphoto2 ON OFF)
+ # ===================================================
+ # OpenCV build components
+ # ===================================================
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ -DBUILD_DOCS=OFF # Doesn't install anyways.
+ -DBUILD_EXAMPLES=$(usex examples ON OFF)
+ -DBUILD_PERF_TESTS=OFF
+ -DBUILD_TESTS=$(usex testprograms ON OFF)
+ # ===================================================
+ # OpenCV installation options
+ # ===================================================
+ -DINSTALL_C_EXAMPLES=$(usex examples ON OFF)
+ -DINSTALL_TESTS=$(usex testprograms ON OFF)
+ # ===================================================
+ # OpenCV build options
+ # ===================================================
+ -DENABLE_PRECOMPILED_HEADERS=$(usex pch ON OFF)
+ -DHAVE_opencv_java=$(usex java YES NO)
+ )
+
+ if use qt4; then
+ mycmakeargs+=( -DWITH_QT=4 )
+ elif use qt5; then
+ mycmakeargs+=( -DWITH_QT=5 )
+ else
+ mycmakeargs+=( -DWITH_QT=OFF )
+ fi
+
+ if use cuda; then
+ if [[ "$(gcc-version)" > "4.8" ]]; then
+ # bug 577410
+ # #error -- unsupported GNU version! gcc 4.9 and up are not supported!
+ ewarn "CUDA and >=sys-devel/gcc-4.9 do not play well together. Disabling CUDA support."
+ mycmakeargs+=( -DWITH_CUDA=OFF )
+ mycmakeargs+=( -DWITH_CUBLAS=OFF )
+ mycmakeargs+=( -DWITH_CUFFT=OFF )
+
+ else
+ mycmakeargs+=( -DWITH_CUDA=ON )
+ mycmakeargs+=( -DWITH_CUBLAS=ON )
+ mycmakeargs+=( -DWITH_CUFFT=ON )
+ mycmakeargs+=( -DCUDA_NPP_LIBRARY_ROOT_DIR="/opt/cuda" )
+ fi
+ else
+ mycmakeargs+=( -DWITH_CUDA=OFF )
+ mycmakeargs+=( -DWITH_CUBLAS=OFF )
+ mycmakeargs+=( -DWITH_CUFFT=OFF )
+ fi
+
+ use contrib && mycmakeargs+=(
+ -DOPENCV_EXTRA_MODULES_PATH="${WORKDIR}/opencv_contrib-${PV}/modules"
+ )
+
+ if use python; then
+ # Set all python variables to load the correct Gentoo paths
+ mycmakeargs+=(
+ -DWITH_PYTHON=ON
+ -DGENTOO_PYTHON_EXECUTABLE=${EPYTHON}
+ -DGENTOO_PYTHON_INCLUDE_PATH="$(python_get_includedir)"
+ -DGENTOO_PYTHON_LIBRARIES="$(python_get_library_path)"
+ -DGENTOO_PYTHON_PACKAGES_PATH="$(python_get_sitedir)"
+ -DGENTOO_PYTHON_MAJOR=${EPYTHON:6:1}
+ -DGENTOO_PYTHON_MINOR=${EPYTHON:8:1}
+ -DGENTOO_PYTHON_DEBUG_LIBRARIES="" # Absolutely no clue what this is
+ )
+ use examples && mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=ON )
+ else
+ mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=OFF )
+ fi
+
+ # things we want to be hard off or not yet figured out
+ mycmakeargs+=(
+ -DBUILD_PACKAGE=OFF
+ -DENABLE_PROFILING=OFF
+ )
+
+ # things we want to be hard enabled not worth useflag
+ mycmakeargs+=(
+ -DCMAKE_SKIP_RPATH=ON
+ -DOPENCV_DOC_INSTALL_PATH=
+ )
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ cmake-utils_src_configure
+}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2016-09-27 14:22 Amy Winston
0 siblings, 0 replies; 20+ messages in thread
From: Amy Winston @ 2016-09-27 14:22 UTC (permalink / raw
To: gentoo-commits
commit: 366480ac81d84673ffbbfcfff277a91d6c6041df
Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
AuthorDate: Thu Sep 22 17:08:23 2016 +0000
Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
CommitDate: Tue Sep 27 14:22:31 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=366480ac
media-libs/opencv: revision bump to 3.1.0-r5
- Feature: added in support for installing the Python module for each
implementation selected
Gentoo-Bug: 593504
- Bug fix: under certain conditions the HDF5 library isn't found
Gentoo-Bug: 588850
- Bug fix: OpenGL needs Qt or Gtk+ otherwise it's disabled
- Misc: cleaned up usex expressions
added qtwidgets depend
moved openmp detection to pkg_pretend as per Gentoo style guidelines
Signed off by Jonathan Scruggs (j.scruggs <AT> gmail.com, irc: Dracwyrm)
.../files/opencv-contrib-find-hdf5-fix.patch | 392 +++++++++++++++++++++
media-libs/opencv/opencv-3.1.0-r5.ebuild | 300 ++++++++++++++++
2 files changed, 692 insertions(+)
diff --git a/media-libs/opencv/files/opencv-contrib-find-hdf5-fix.patch b/media-libs/opencv/files/opencv-contrib-find-hdf5-fix.patch
new file mode 100644
index 00000000..af86cf98
--- /dev/null
+++ b/media-libs/opencv/files/opencv-contrib-find-hdf5-fix.patch
@@ -0,0 +1,392 @@
+diff -purN a/modules/hdf/cmake/FindHDF5.cmake b/modules/hdf/cmake/FindHDF5.cmake
+--- a/modules/hdf/cmake/FindHDF5.cmake 1970-01-01 01:00:00.000000000 +0100
++++ b/modules/hdf/cmake/FindHDF5.cmake 2015-09-16 17:53:05.000000000 +0100
+@@ -0,0 +1,379 @@
++#.rst:
++# FindHDF5
++# --------
++#
++# Find HDF5, a library for reading and writing self describing array data.
++#
++#
++#
++# This module invokes the HDF5 wrapper compiler that should be installed
++# alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
++# compiler is called either h5cc or h5pcc. If this succeeds, the module
++# will then call the compiler with the -show argument to see what flags
++# are used when compiling an HDF5 client application.
++#
++# The module will optionally accept the COMPONENTS argument. If no
++# COMPONENTS are specified, then the find module will default to finding
++# only the HDF5 C library. If one or more COMPONENTS are specified, the
++# module will attempt to find the language bindings for the specified
++# components. The only valid components are C, CXX, Fortran, HL, and
++# Fortran_HL. If the COMPONENTS argument is not given, the module will
++# attempt to find only the C bindings.
++#
++# On UNIX systems, this module will read the variable
++# HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
++# static link to a dynamic link for HDF5 and all of it's dependencies.
++# To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
++# variable is set before the call to find_package.
++#
++# To provide the module with a hint about where to find your HDF5
++# installation, you can set the environment variable HDF5_ROOT. The
++# Find module will then look in this path when searching for HDF5
++# executables, paths, and libraries.
++#
++# In addition to finding the includes and libraries required to compile
++# an HDF5 client application, this module also makes an effort to find
++# tools that come with the HDF5 distribution that may be useful for
++# regression testing.
++#
++# This module will define the following variables:
++#
++# ::
++#
++# HDF5_INCLUDE_DIRS - Location of the hdf5 includes
++# HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
++# HDF5_DEFINITIONS - Required compiler definitions for HDF5
++# HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings.
++# HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
++# HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
++# HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API
++# HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
++# bindings.
++# HDF5_LIBRARIES - Required libraries for all requested bindings
++# HDF5_FOUND - true if HDF5 was found on the system
++# HDF5_VERSION - HDF5 version in format Major.Minor.Release
++# HDF5_LIBRARY_DIRS - the full set of library directories
++# HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
++# HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
++# HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
++# HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
++# HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
++
++#=============================================================================
++# Copyright 2015 Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
++# Copyright 2009 Kitware, Inc.
++#
++# Distributed under the OSI-approved BSD License (the "License");
++# see accompanying file Copyright.txt for details.
++#
++# This software is distributed WITHOUT ANY WARRANTY; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++# See the License for more information.
++#=============================================================================
++# (To distribute this file outside of CMake, substitute the full
++# License text for the above reference.)
++
++# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
++
++include(SelectLibraryConfigurations)
++include(FindPackageHandleStandardArgs)
++
++# List of the valid HDF5 components
++set( HDF5_VALID_COMPONENTS
++ C
++ CXX
++ Fortran
++ HL
++ Fortran_HL
++)
++
++# Validate the list of find components.
++if( NOT HDF5_FIND_COMPONENTS )
++ set( HDF5_LANGUAGE_BINDINGS "C" )
++else()
++ # add the extra specified components, ensuring that they are valid.
++ foreach( component ${HDF5_FIND_COMPONENTS} )
++ list( FIND HDF5_VALID_COMPONENTS ${component} component_location )
++ if( ${component_location} EQUAL -1 )
++ message( FATAL_ERROR
++ "\"${component}\" is not a valid HDF5 component." )
++ else()
++ list( APPEND HDF5_LANGUAGE_BINDINGS ${component} )
++ endif()
++ endforeach()
++endif()
++
++# try to find the HDF5 wrapper compilers
++find_program( HDF5_C_COMPILER_EXECUTABLE
++ NAMES h5cc h5pcc
++ HINTS ENV HDF5_ROOT
++ PATH_SUFFIXES bin Bin
++ DOC "HDF5 Wrapper compiler. Used only to detect HDF5 compile flags." )
++mark_as_advanced( HDF5_C_COMPILER_EXECUTABLE )
++
++find_program( HDF5_CXX_COMPILER_EXECUTABLE
++ NAMES h5c++ h5pc++
++ HINTS ENV HDF5_ROOT
++ PATH_SUFFIXES bin Bin
++ DOC "HDF5 C++ Wrapper compiler. Used only to detect HDF5 compile flags." )
++mark_as_advanced( HDF5_CXX_COMPILER_EXECUTABLE )
++
++find_program( HDF5_Fortran_COMPILER_EXECUTABLE
++ NAMES h5fc h5pfc
++ HINTS ENV HDF5_ROOT
++ PATH_SUFFIXES bin Bin
++ DOC "HDF5 Fortran Wrapper compiler. Used only to detect HDF5 compile flags." )
++mark_as_advanced( HDF5_Fortran_COMPILER_EXECUTABLE )
++
++find_program( HDF5_DIFF_EXECUTABLE
++ NAMES h5diff
++ HINTS ENV HDF5_ROOT
++ PATH_SUFFIXES bin Bin
++ DOC "HDF5 file differencing tool." )
++mark_as_advanced( HDF5_DIFF_EXECUTABLE )
++
++# Invoke the HDF5 wrapper compiler. The compiler return value is stored to the
++# return_value argument, the text output is stored to the output variable.
++macro( _HDF5_invoke_compiler language output return_value )
++ if( HDF5_${language}_COMPILER_EXECUTABLE )
++ exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
++ ARGS -show
++ OUTPUT_VARIABLE ${output}
++ RETURN_VALUE ${return_value}
++ )
++ if( ${${return_value}} EQUAL 0 )
++ # do nothing
++ else()
++ message( STATUS
++ "Unable to determine HDF5 ${language} flags from HDF5 wrapper." )
++ endif()
++ endif()
++endmacro()
++
++# Parse a compile line for definitions, includes, library paths, and libraries.
++macro( _HDF5_parse_compile_line
++ compile_line_var
++ include_paths
++ definitions
++ library_paths
++ libraries )
++
++ # Match the include paths
++ string( REGEX MATCHALL "-I([^\" ]+)" include_path_flags
++ "${${compile_line_var}}"
++ )
++ foreach( IPATH ${include_path_flags} )
++ string( REGEX REPLACE "^-I" "" IPATH ${IPATH} )
++ string( REPLACE "//" "/" IPATH ${IPATH} )
++ list( APPEND ${include_paths} ${IPATH} )
++ endforeach()
++
++ # Match the definitions
++ string( REGEX MATCHALL "-D[^ ]*" definition_flags "${${compile_line_var}}" )
++ foreach( DEF ${definition_flags} )
++ list( APPEND ${definitions} ${DEF} )
++ endforeach()
++
++ # Match the library paths
++ string( REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" library_path_flags
++ "${${compile_line_var}}"
++ )
++
++ foreach( LPATH ${library_path_flags} )
++ string( REGEX REPLACE "^-L" "" LPATH ${LPATH} )
++ string( REPLACE "//" "/" LPATH ${LPATH} )
++ list( APPEND ${library_paths} ${LPATH} )
++ endforeach()
++
++ # now search for the library names specified in the compile line (match -l...)
++ # match only -l's preceded by a space or comma
++ # this is to exclude directory names like xxx-linux/
++ string( REGEX MATCHALL "[, ]-l([^\", ]+)" library_name_flags
++ "${${compile_line_var}}" )
++ # strip the -l from all of the library flags and add to the search list
++ foreach( LIB ${library_name_flags} )
++ string( REGEX REPLACE "^[, ]-l" "" LIB ${LIB} )
++ list( APPEND ${libraries} ${LIB} )
++ endforeach()
++endmacro()
++
++# Try to find HDF5 using an installed hdf5-config.cmake
++if( NOT HDF5_FOUND )
++ find_package( HDF5 QUIET NO_MODULE )
++ if( HDF5_FOUND )
++ set( HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR} )
++ set( HDF5_LIBRARIES )
++ set( HDF5_C_TARGET hdf5 )
++ set( HDF5_CXX_TARGET hdf5_cpp )
++ set( HDF5_HL_TARGET hdf5_hl )
++ set( HDF5_Fortran_TARGET hdf5_fortran )
++ set( HDF5_Fortran_HL_TARGET hdf5_hl_fortran )
++ foreach( _component ${HDF5_LANGUAGE_BINDINGS} )
++ list( FIND HDF5_VALID_COMPONENTS ${_component} _component_location )
++ get_target_property( _comp_location ${HDF5_${_component}_TARGET} LOCATION )
++ if( _comp_location )
++ set( HDF5_${_component}_LIBRARY ${_comp_location} CACHE PATH
++ "HDF5 ${_component} library" )
++ mark_as_advanced( HDF5_${_component}_LIBRARY )
++ list( APPEND HDF5_LIBRARIES ${HDF5_${_component}_LIBRARY} )
++ endif()
++ endforeach()
++ endif()
++endif()
++
++if( NOT HDF5_FOUND )
++ _HDF5_invoke_compiler( C HDF5_C_COMPILE_LINE HDF5_C_RETURN_VALUE )
++ _HDF5_invoke_compiler( CXX HDF5_CXX_COMPILE_LINE HDF5_CXX_RETURN_VALUE )
++ _HDF5_invoke_compiler( Fortran HDF5_Fortran_COMPILE_LINE HDF5_Fortran_RETURN_VALUE )
++
++ # seed the initial lists of libraries to find with items we know we need
++ set( HDF5_C_LIBRARY_NAMES_INIT hdf5 )
++ set( HDF5_HL_LIBRARY_NAMES_INIT hdf5_hl ${HDF5_C_LIBRARY_NAMES_INIT} )
++ set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} )
++ set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran
++ ${HDF5_C_LIBRARY_NAMES_INIT} )
++ set( HDF5_Fortran_HL_LIBRARY_NAMES_INIT hdf5hl_fortran
++ ${HDF5_Fortran_LIBRARY_NAMES_INIT} )
++
++ foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} )
++ if( HDF5_${LANGUAGE}_COMPILE_LINE )
++ _HDF5_parse_compile_line( HDF5_${LANGUAGE}_COMPILE_LINE
++ HDF5_${LANGUAGE}_INCLUDE_FLAGS
++ HDF5_${LANGUAGE}_DEFINITIONS
++ HDF5_${LANGUAGE}_LIBRARY_DIRS
++ HDF5_${LANGUAGE}_LIBRARY_NAMES
++ )
++
++ # take a guess that the includes may be in the 'include' sibling
++ # directory of a library directory.
++ foreach( dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
++ list( APPEND HDF5_${LANGUAGE}_INCLUDE_FLAGS ${dir}/../include )
++ endforeach()
++ endif()
++
++ # set the definitions for the language bindings.
++ list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} )
++
++ # find the HDF5 include directories
++ if(${LANGUAGE} MATCHES "Fortran")
++ set(HDF5_INCLUDE_FILENAME hdf5.mod)
++ else()
++ set(HDF5_INCLUDE_FILENAME hdf5.h)
++ endif()
++
++ find_path( HDF5_${LANGUAGE}_INCLUDE_DIR ${HDF5_INCLUDE_FILENAME}
++ HINTS
++ ${HDF5_${LANGUAGE}_INCLUDE_FLAGS}
++ ENV
++ HDF5_ROOT
++ PATHS
++ $ENV{HOME}/.local/include
++ PATH_SUFFIXES
++ include
++ Include
++ )
++ mark_as_advanced( HDF5_${LANGUAGE}_INCLUDE_DIR )
++ list( APPEND HDF5_INCLUDE_DIRS ${HDF5_${LANGUAGE}_INCLUDE_DIR} )
++
++ set( HDF5_${LANGUAGE}_LIBRARY_NAMES
++ ${HDF5_${LANGUAGE}_LIBRARY_NAMES_INIT}
++ ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
++
++ # find the HDF5 libraries
++ foreach( LIB ${HDF5_${LANGUAGE}_LIBRARY_NAMES} )
++ if( UNIX AND HDF5_USE_STATIC_LIBRARIES )
++ # According to bug 1643 on the CMake bug tracker, this is the
++ # preferred method for searching for a static library.
++ # See http://www.cmake.org/Bug/view.php?id=1643. We search
++ # first for the full static library name, but fall back to a
++ # generic search on the name if the static search fails.
++ set( THIS_LIBRARY_SEARCH_DEBUG lib${LIB}d.a ${LIB}d )
++ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} )
++ else()
++ set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d )
++ set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} )
++ endif()
++ find_library( HDF5_${LIB}_LIBRARY_DEBUG
++ NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
++ HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
++ ENV HDF5_ROOT
++ PATH_SUFFIXES lib Lib )
++ find_library( HDF5_${LIB}_LIBRARY_RELEASE
++ NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
++ HINTS ${HDF5_${LANGUAGE}_LIBRARY_DIRS}
++ ENV HDF5_ROOT
++ PATH_SUFFIXES lib Lib )
++ select_library_configurations( HDF5_${LIB} )
++ list(APPEND HDF5_${LANGUAGE}_LIBRARIES ${HDF5_${LIB}_LIBRARY})
++ endforeach()
++ list( APPEND HDF5_LIBRARY_DIRS ${HDF5_${LANGUAGE}_LIBRARY_DIRS} )
++
++ # Append the libraries for this language binding to the list of all
++ # required libraries.
++ list(APPEND HDF5_LIBRARIES ${HDF5_${LANGUAGE}_LIBRARIES})
++ endforeach()
++
++ # We may have picked up some duplicates in various lists during the above
++ # process for the language bindings (both the C and C++ bindings depend on
++ # libz for example). Remove the duplicates. It appears that the default
++ # CMake behavior is to remove duplicates from the end of a list. However,
++ # for link lines, this is incorrect since unresolved symbols are searched
++ # for down the link line. Therefore, we reverse the list, remove the
++ # duplicates, and then reverse it again to get the duplicates removed from
++ # the beginning.
++ macro( _remove_duplicates_from_beginning _list_name )
++ list( REVERSE ${_list_name} )
++ list( REMOVE_DUPLICATES ${_list_name} )
++ list( REVERSE ${_list_name} )
++ endmacro()
++
++ if( HDF5_INCLUDE_DIRS )
++ _remove_duplicates_from_beginning( HDF5_INCLUDE_DIRS )
++ endif()
++ if( HDF5_LIBRARY_DIRS )
++ _remove_duplicates_from_beginning( HDF5_LIBRARY_DIRS )
++ endif()
++
++ # If the HDF5 include directory was found, open H5pubconf.h to determine if
++ # HDF5 was compiled with parallel IO support
++ set( HDF5_IS_PARALLEL FALSE )
++ set( HDF5_VERSION "" )
++ foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
++ foreach(_hdr "${_dir}/H5pubconf.h" "${_dir}/H5pubconf-64.h" "${_dir}/H5pubconf-32.h")
++ if( EXISTS "${_hdr}" )
++ file( STRINGS "${_hdr}"
++ HDF5_HAVE_PARALLEL_DEFINE
++ REGEX "HAVE_PARALLEL 1" )
++ if( HDF5_HAVE_PARALLEL_DEFINE )
++ set( HDF5_IS_PARALLEL TRUE )
++ endif()
++ unset(HDF5_HAVE_PARALLEL_DEFINE)
++
++ file( STRINGS "${_hdr}"
++ HDF5_VERSION_DEFINE
++ REGEX "^[ \t]*#[ \t]*define[ \t]+H5_VERSION[ \t]+" )
++ if( "${HDF5_VERSION_DEFINE}" MATCHES
++ "H5_VERSION[ \t]+\"([0-9]+\\.[0-9]+\\.[0-9]+).*\"" )
++ set( HDF5_VERSION "${CMAKE_MATCH_1}" )
++ endif()
++ unset(HDF5_VERSION_DEFINE)
++ endif()
++ endforeach()
++ endforeach()
++ set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL
++ "HDF5 library compiled with parallel IO support" )
++ mark_as_advanced( HDF5_IS_PARALLEL )
++
++ # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
++ # HDF5_INCLUDE_DIRS
++ if( HDF5_INCLUDE_DIRS )
++ set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
++ endif()
++
++endif()
++
++find_package_handle_standard_args( HDF5
++ REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS
++ VERSION_VAR HDF5_VERSION
++)
++
+diff -purN a/modules/hdf/CMakeLists.txt b/modules/hdf/CMakeLists.txt
+--- a/modules/hdf/CMakeLists.txt 2015-12-17 17:11:31.000000000 +0000
++++ b/modules/hdf/CMakeLists.txt 2016-09-19 15:24:47.958650311 +0100
+@@ -1,4 +1,4 @@
+-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR}/cmake)
+
+ find_package(HDF5)
+ if(HDF5_FOUND)
diff --git a/media-libs/opencv/opencv-3.1.0-r5.ebuild b/media-libs/opencv/opencv-3.1.0-r5.ebuild
new file mode 100644
index 00000000..581b725
--- /dev/null
+++ b/media-libs/opencv/opencv-3.1.0-r5.ebuild
@@ -0,0 +1,300 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit toolchain-funcs cmake-utils python-r1 java-pkg-opt-2 java-ant-2
+
+DESCRIPTION="A collection of algorithms and sample code for
+ various computer vision problems"
+HOMEPAGE="http://opencv.org"
+
+SRC_URI="
+ mirror://sourceforge/opencvlibrary/opencv-unix/${PV}/${P}.zip
+ https://github.com/Itseez/${PN}/archive/${PV}.zip -> ${P}.zip
+ contrib? (
+ https://github.com/Itseez/${PN}_contrib/archive/cd5993c6576267875adac300b9ddd1f881bb1766.zip -> ${P}_contrib.zip )" #commit from Sun, 27 Mar 2016 17:31:51
+
+LICENSE="BSD"
+SLOT="0/3.1" # subslot = libopencv* soname version
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="contrib cuda +eigen examples ffmpeg gdal gphoto2 gstreamer gtk \
+ ieee1394 ipp jpeg jpeg2k libav opencl openexr opengl openmp pch png \
+ +python qt4 qt5 testprograms threads tiff vaapi v4l vtk webp xine"
+
+# OpenGL needs gtk or Qt installed to activate, otherwise build system
+# will silently disable it without the user knowing, which defeats the
+# purpose of the opengl use flag.
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+ ?? ( qt4 qt5 )
+ opengl? ( || ( gtk qt4 qt5 ) )"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# gtk? ( !qt4 )
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2
+ sys-libs/zlib
+ cuda? ( dev-util/nvidia-cuda-toolkit:0= )
+ ffmpeg? (
+ libav? ( media-video/libav:0= )
+ !libav? ( media-video/ffmpeg:0= )
+ )
+ gdal? ( sci-libs/gdal )
+ gphoto2? ( media-libs/libgphoto2 )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ gtk? (
+ dev-libs/glib:2
+ x11-libs/gtk+:2
+ opengl? ( x11-libs/gtkglext )
+ )
+ java? ( >=virtual/jre-1.6:* )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ ieee1394? (
+ media-libs/libdc1394
+ sys-libs/libraw1394
+ )
+ ipp? ( sci-libs/ipp )
+ opencl? ( virtual/opencl )
+ openexr? ( media-libs/openexr )
+ opengl? ( virtual/opengl virtual/glu )
+ png? ( media-libs/libpng:0= )
+ python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+ qt4? (
+ dev-qt/qtgui:4
+ dev-qt/qttest:4
+ opengl? ( dev-qt/qtopengl:4 )
+ )
+ qt5? (
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ threads? ( dev-cpp/tbb )
+ tiff? ( media-libs/tiff:0 )
+ v4l? ( >=media-libs/libv4l-0.8.3 )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp )
+ xine? ( media-libs/xine-lib )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ eigen? ( dev-cpp/eigen:3 )
+ java? ( >=virtual/jdk-1.6 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.0-gles.patch
+ "${FILESDIR}"/${PN}-3.1.0-cmake-no-opengl.patch
+ "${FILESDIR}"/${P}-git-autodetect.patch
+ "${FILESDIR}"/${P}-java-magic.patch
+ "${FILESDIR}"/${P}-gentooify-python.patch
+)
+
+GLOBALCMAKEARGS=()
+
+pkg_pretend() {
+ if use openmp; then
+ tc-has-openmp || die "Please switch to an openmp compatible compiler"
+ fi
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ # remove bundled stuff
+ rm -rf 3rdparty || die "Removing 3rd party components failed"
+ sed -i \
+ -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ CMakeLists.txt cmake/*cmake || die
+
+ java-pkg-opt-2_src_prepare
+
+ # Out-of-$S patching
+ if use contrib; then
+ cd "${WORKDIR}"/opencv_contrib-${PV} || die "cd failed"
+ epatch "${FILESDIR}"/${PN}-contrib-find-hdf5-fix.patch
+ fi
+}
+
+src_configure() {
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+
+ # please dont sort here, order is the same as in CMakeLists.txt
+ GLOBALCMAKEARGS=(
+ # Optional 3rd party components
+ # ===================================================
+ -DWITH_1394=$(usex ieee1394)
+ -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_VTK=$(usex vtk)
+ -DWITH_EIGEN=$(usex eigen)
+ -DWITH_VFW=OFF # Video windows support
+ -DWITH_FFMPEG=$(usex ffmpeg)
+ -DWITH_GSTREAMER=$(usex gstreamer)
+ -DWITH_GSTREAMER_0_10=OFF # Don't want this
+ -DWITH_GTK=$(usex gtk)
+ -DWITH_GTK_2_X=OFF
+ -DWITH_IPP=$(usex ipp)
+ -DWITH_JASPER=$(usex jpeg2k)
+ -DWITH_JPEG=$(usex jpeg)
+ -DWITH_WEBP=$(usex webp)
+ -DWITH_OPENEXR=$(usex openexr)
+ -DWITH_OPENGL=$(usex opengl)
+ -DWITH_OPENNI=OFF # Not packaged
+ -DWITH_OPENNI2=OFF # Not packaged
+ -DWITH_PNG=$(usex png)
+ -DWITH_PVAPI=OFF # Not packaged
+ -DWITH_GIGEAPI=OFF
+ # Qt in CMakeList.txt here: See below
+ -DWITH_WIN32UI=OFF # Windows only
+ -DWITH_QUICKTIME=OFF
+ -DWITH_TBB=$(usex threads)
+ -DWITH_OPENMP=$(usex openmp)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ -DWITH_TIFF=$(usex tiff)
+ -DWITH_UNICAP=OFF # Not packaged
+ -DWITH_V4L=$(usex v4l)
+ -DWITH_LIBV4L=$(usex v4l)
+ -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_XIMEA=OFF # Windows only
+ -DWITH_XINE=$(usex xine)
+ -DWITH_CLP=OFF
+ -DWITH_OPENCL=$(usex opencl)
+ -DWITH_OPENCL_SVM=OFF
+ -DWITH_OPENCLAMDFFT=$(usex opencl)
+ -DWITH_OPENCLAMDBLAS=$(usex opencl)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_JAVA=$(usex java) # Ant needed, no compile flag
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=ON
+ -DWITH_VA=$(usex vaapi)
+ -DWITH_VA_INTEL=$(usex vaapi)
+ -DWITH_GDAL=$(usex gdal)
+ -DWITH_GPHOTO2=$(usex gphoto2)
+ # ===================================================
+ # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
+ # ===================================================
+ -DWITH_CUDA=$(usex cuda)
+ -DWITH_CUBLAS=$(usex cuda)
+ -DWITH_CUFFT=$(usex cuda)
+ -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
+ # ===================================================
+ # OpenCV build components
+ # ===================================================
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ -DBUILD_DOCS=OFF # Doesn't install anyways.
+ -DBUILD_EXAMPLES=$(usex examples)
+ -DBUILD_PERF_TESTS=OFF
+ -DBUILD_TESTS=$(usex testprograms)
+ # ===================================================
+ # OpenCV installation options
+ # ===================================================
+ -DINSTALL_C_EXAMPLES=$(usex examples)
+ -DINSTALL_TESTS=$(usex testprograms)
+ # ===================================================
+ # OpenCV build options
+ # ===================================================
+ -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
+ -DHAVE_opencv_java=$(usex java YES NO)
+ # ===================================================
+ # things we want to be hard off or not yet figured out
+ # ===================================================
+ -DBUILD_PACKAGE=OFF
+ -DENABLE_PROFILING=OFF
+ # ===================================================
+ # things we want to be hard enabled not worth useflag
+ # ===================================================
+ -DCMAKE_SKIP_RPATH=ON
+ -DOPENCV_DOC_INSTALL_PATH=
+ )
+
+ if use qt4; then
+ GLOBALCMAKEARGS+=( -DWITH_QT=4 )
+ elif use qt5; then
+ GLOBALCMAKEARGS+=( -DWITH_QT=5 )
+ else
+ GLOBALCMAKEARGS+=( -DWITH_QT=OFF )
+ fi
+
+ use contrib && GLOBALCMAKEARGS+=(
+ -DOPENCV_EXTRA_MODULES_PATH="${WORKDIR}/opencv_contrib-${PV}/modules"
+ )
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
+ -DWITH_PYTHON=OFF
+ -DINSTALL_PYTHON_EXAMPLES=OFF
+ )
+
+ cmake-utils_src_configure
+}
+
+python_module_compile() {
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
+
+ # Set all python variables to load the correct Gentoo paths
+ mycmakeargs+=(
+ -DWITH_PYTHON=ON
+ -DGENTOO_PYTHON_EXECUTABLE=${EPYTHON}
+ -DGENTOO_PYTHON_INCLUDE_PATH="$(python_get_includedir)"
+ -DGENTOO_PYTHON_LIBRARIES="$(python_get_library_path)"
+ -DGENTOO_PYTHON_PACKAGES_PATH="$(python_get_sitedir)"
+ -DGENTOO_PYTHON_MAJOR=${EPYTHON:6:1}
+ -DGENTOO_PYTHON_MINOR=${EPYTHON:8:1}
+ -DGENTOO_PYTHON_DEBUG_LIBRARIES="" # Absolutely no clue what this is
+ )
+
+ if use examples; then
+ mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=ON )
+ else
+ mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=OFF )
+ fi
+
+ # Compile and install all at once because configuration will be wiped
+ # for each impl of Python
+ BUILD_DIR="${WORKDIR}"/${P}_build
+ cd "${BUILD_DIR}" || die "cd failed"
+
+ # Regenerate cache file. Can't use rebuild_cache as it won't
+ # have the Gentoo specific options.
+ rm -rf CMakeCache.txt || die "rm failed"
+ cmake-utils_src_configure
+ cmake-utils_src_compile opencv_${EPYTHON:0:7}
+ cmake-utils_src_install install/fast
+
+ # Remove compiled binary so new version compiles
+ # Avoid conflicts with new module builds as build system doesn't
+ # really support it.
+ emake -C modules/${EPYTHON:0:7} clean
+ rm -rf modules/${EPYTHON:0:7} || die "rm failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ # Build and install the python modules for all targets
+ use python && python_foreach_impl python_module_compile
+}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2017-07-27 18:42 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2017-07-27 18:42 UTC (permalink / raw
To: gentoo-commits
commit: e62eff34b2ebd90b7b23812d793456df4dba22fc
Author: Yurii Moskalenko <yuramuv <AT> gmail <DOT> com>
AuthorDate: Mon Jul 3 01:21:32 2017 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Thu Jul 27 18:36:55 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e62eff34
media-libs/opencv: Fix usage CPU instructions
.../opencv-3.2.0-fix_ussage_cpu_instructions.patch | 64 ++++++++++++++++++++++
...encv-3.2.0-r1.ebuild => opencv-3.2.0-r2.ebuild} | 1 +
2 files changed, 65 insertions(+)
diff --git a/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch b/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch
new file mode 100644
index 00000000000..7b88216f329
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch
@@ -0,0 +1,64 @@
+--- a/cmake/OpenCVCompilerOptions.cmake
++++ b/cmake/OpenCVCompilerOptions.cmake
+@@ -164,8 +164,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ # Other optimizations
+ if(ENABLE_OMIT_FRAME_POINTER)
+ add_extra_compiler_option(-fomit-frame-pointer)
+- else()
+- add_extra_compiler_option(-fno-omit-frame-pointer)
+ endif()
+ if(ENABLE_FAST_MATH)
+ add_extra_compiler_option(-ffast-math)
+@@ -195,8 +193,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ if(NOT MINGW)
+ if(ENABLE_AVX)
+ add_extra_compiler_option(-mavx)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-avx)
+ endif()
+ if(ENABLE_AVX2)
+ add_extra_compiler_option(-mavx2)
+@@ -210,26 +206,18 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
+ if(ENABLE_SSE3)
+ add_extra_compiler_option(-msse3)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse3)
+ endif()
+
+ if(ENABLE_SSSE3)
+ add_extra_compiler_option(-mssse3)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-ssse3)
+ endif()
+
+ if(ENABLE_SSE41)
+ add_extra_compiler_option(-msse4.1)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse4.1)
+ endif()
+
+ if(ENABLE_SSE42)
+ add_extra_compiler_option(-msse4.2)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse4.2)
+ endif()
+
+ if(ENABLE_POPCNT)
+@@ -238,16 +226,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
+ endif()
+ endif(NOT MINGW)
+
+- if(X86 OR X86_64)
+- if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+- if(OPENCV_EXTRA_CXX_FLAGS MATCHES "-m(sse2|avx)")
+- add_extra_compiler_option(-mfpmath=sse)# !! important - be on the same wave with x64 compilers
+- else()
+- add_extra_compiler_option(-mfpmath=387)
+- endif()
+- endif()
+- endif()
+-
+ # Profiling?
+ if(ENABLE_PROFILING)
+ add_extra_compiler_option("-pg -g"
diff --git a/media-libs/opencv/opencv-3.2.0-r1.ebuild b/media-libs/opencv/opencv-3.2.0-r2.ebuild
similarity index 99%
rename from media-libs/opencv/opencv-3.2.0-r1.ebuild
rename to media-libs/opencv/opencv-3.2.0-r2.ebuild
index fc5c7aeb029..e8fe383042f 100644
--- a/media-libs/opencv/opencv-3.2.0-r1.ebuild
+++ b/media-libs/opencv/opencv-3.2.0-r2.ebuild
@@ -97,6 +97,7 @@ PATCHES=(
"${FILESDIR}/${PN}-3.1.0-find-libraries-fix.patch"
"${FILESDIR}/${P}-vtk.patch"
"${FILESDIR}/${P}-gcc-6.0.patch"
+ "${FILESDIR}/${PN}-3.2.0-fix_ussage_cpu_instructions.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2017-07-27 18:54 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2017-07-27 18:54 UTC (permalink / raw
To: gentoo-commits
commit: 0bf608a00f6466cb09e7d55b9e2579f0ca0b07c6
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 27 18:50:07 2017 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Thu Jul 27 18:53:52 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bf608a0
media-libs/opencv: fix mno-sse2
Package-Manager: Portage-2.3.6, Repoman-2.3.1
media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch | 11 +++++++++++
media-libs/opencv/opencv-3.2.0-r2.ebuild | 1 +
2 files changed, 12 insertions(+)
diff --git a/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch b/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch
new file mode 100644
index 00000000000..a73456411f2
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch
@@ -0,0 +1,11 @@
+--- a/cmake/OpenCVCompilerOptions.cmake 2017-07-22 13:26:51.178960091 +0200
++++ b/cmake/OpenCVCompilerOptions.cmake 2017-07-22 13:27:47.238961469 +0200
+@@ -176,8 +176,6 @@
+ endif()
+ if(ENABLE_SSE2)
+ add_extra_compiler_option(-msse2)
+- elseif(X86 OR X86_64)
+- add_extra_compiler_option(-mno-sse2)
+ endif()
+ if(ARM)
+ add_extra_compiler_option("-mfp16-format=ieee")
diff --git a/media-libs/opencv/opencv-3.2.0-r2.ebuild b/media-libs/opencv/opencv-3.2.0-r2.ebuild
index e8fe383042f..6793803ee3b 100644
--- a/media-libs/opencv/opencv-3.2.0-r2.ebuild
+++ b/media-libs/opencv/opencv-3.2.0-r2.ebuild
@@ -98,6 +98,7 @@ PATCHES=(
"${FILESDIR}/${P}-vtk.patch"
"${FILESDIR}/${P}-gcc-6.0.patch"
"${FILESDIR}/${PN}-3.2.0-fix_ussage_cpu_instructions.patch"
+ "${FILESDIR}/${P}-cpu-mno-sse2.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2018-01-21 8:36 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2018-01-21 8:36 UTC (permalink / raw
To: gentoo-commits
commit: b311829f28929c5dd15402b395365ccffb85ecd1
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 21 08:35:52 2018 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Sun Jan 21 08:36:21 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b311829f
media-libs/opencv: fix cuda9 and autodownload
- Fix cuda 9 compatibility
Submitted-by: Todd Walter <twalter <AT> rogers.com>
- Remove autodownload tiny_dnn from contrib
Submitted-by: Jonathan Scruggs <j.scruggs <AT> gmail.com>
- Add PYTHON_COMPAT 3_6
Closes: https://bugs.gentoo.org/637078
Closes: https://bugs.gentoo.org/633844
Closes: https://bugs.gentoo.org/632116
Package-Manager: Portage-2.3.13, Repoman-2.3.3
media-libs/opencv/Manifest | 1 +
.../opencv/files/opencv-3.3.0-cuda9-cmake.patch | 87 ++++
.../files/opencv-3.3.0-cuda9-compute20.patch | 21 +
.../opencv/files/opencv-3.3.0-cuda9-saturate.patch | 41 ++
media-libs/opencv/metadata.xml | 1 +
media-libs/opencv/opencv-3.3.0-r5.ebuild | 466 +++++++++++++++++++++
6 files changed, 617 insertions(+)
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index 84e8300ba03..b193d22127a 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -6,4 +6,5 @@ DIST opencv-3.2.0.tar.gz 78861546 BLAKE2B 6d44263792b9cd2d009c7eeaddc2ef87acb014
DIST opencv-3.2.0_contrib.tar.gz 54765210 BLAKE2B 6c5bcb1c18da937751f234cc1edaae58416ab9ab5a3407a2ab2c22f4e174ffeb800396d34fe489f424b288fbd608e106cd5f5b458a06a509cea5f7d8e23a67a7 SHA512 eadb6a8a3625235b0c71e29c36d15d9342278aaf9148ef6a7e1aa80f4db0491aaf30b6df16bfd0cd358402b2a3059b6acbce23fb5fe2c0c57150a733ffbbff5a
DIST opencv-3.3.0.tar.gz 81238534 BLAKE2B 9eac7de8eefbcc9981a249343052c2dcada4e73c3406d545a89b9e6a054a7c7153933537d123f227caf51f23196fcaaed4135229db195e9c4139f2977e034e34 SHA512 13dee5c1c5fec1dccdbb05879d299b93ef8ddeb87f561a6c4178e33a4cf5ae919765119068d0387a3efea0e09a625ca993cffac60a772159690fcbee4e8d70fb
DIST opencv-3.3.0_contrib.tar.gz 54848519 BLAKE2B 53615af19426bf7a1540a6f23c7803276d6de594260b0d87b06b6b12c9e20326925a275e31e017784e8e876e30df7b8f326e192a75c5300252ae09f50d0d9a8b SHA512 ebe3dbe6c754c6fbaabbf6b0d2a4209964e625fd68e593f30ce043792740c8c1d4440d7870949b5b33f488fd7e2e05f3752287b7f50dd24c29202e268776520e
+DIST tiny-dnn-1.0.0a3.tar.gz 12885646 BLAKE2B 85c0715ab6c692b77522487775e70b0db645528baed1830c83c9f44d2b67a5207e4f7ea1709b35c6a4217d287199549304e9be19f4a5cec9a1183b0b5dccc562 SHA512 5f2c1a161771efa67e85b1fea395953b7744e29f61187ac5a6c54c912fb195b3aef9a5827135c3668bd0eeea5ae04a33cc433e1f6683e2b7955010a2632d168b
DIST vgg_boostdesc-3.2.0.tar.gz 1867770 BLAKE2B 1fa5b58e73b6fa56ecf8d19af22298f729942ee1369082e173445d09d3de767bf844bad3d2b462efc1199c392f37c88ba49a9996ba8bfd84b4abeba7de94db63 SHA512 4a046aedd639c8eb4b295b0f499e756deb66210ca083f0124c75531e540663367cb58f6d175f66c4713324177036cd89a8869bdab2de8d1736dafc7f00ef9f44
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch
new file mode 100644
index 00000000000..270c599d708
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch
@@ -0,0 +1,87 @@
+diff --git a/cmake/FindCUDA.cmake b/cmake/FindCUDA.cmake
+index 678b450ab..c2a58bd00 100644
+--- a/cmake/FindCUDA.cmake
++++ b/cmake/FindCUDA.cmake
+@@ -283,7 +283,38 @@
+ # CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
+ # Only available for CUDA version 5.5+.
+ # CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+-# Only available for CUDA version 5.5+.
++# Only available for CUDA version 5.5+ and was split up
++# in CUDA version 8.0+ and doesn't exist in combined
++# form in CUDA version 9.0+.
++# CUDA_nppial_LIBRARY -- NVIDIA Performance Primatives library (arithmetic and
++# logical operation functions). Only available for CUDA
++# version 8.0+.
++# CUDA_nppicc_LIBRARY -- NVIDIA Performance Primatives library (color conversion
++# and sampling functions). Only available for CUDA version
++# 8.0+.
++# CUDA_nppicom_LIBRARY -- NVIDIA Performance Primatives library (JPEG compression
++# and decompression functions). Only available for CUDA
++# version 8.0+.
++# CUDA_nppidei_LIBRARY -- NVIDIA Performance Primatives library (data exchange and
++# initialization functions). Only available for CUDA
++# version 8.0+.
++# CUDA_nppif_LIBRARY -- NVIDIA Performance Primatives library (filtering and
++# computer vision functions). Only available for CUDA
++# version 8.0+.
++# CUDA_nppig_LIBRARY -- NVIDIA Performance Primatives library (geometry
++# transformation functions). Only available for CUDA
++# version 8.0+.
++# CUDA_nppim_LIBRARY -- NVIDIA Performance Primatives library (morphological
++# operation functions). Only available for CUDA version
++# 8.0+.
++# CUDA_nppist_LIBRARY -- NVIDIA Performance Primatives library (statistics and
++# linear transform). Only available for CUDA version
++# 8.0+.
++# CUDA_nppisu_LIBRARY -- NVIDIA Performance Primatives library (memory support
++# functions). Only available for CUDA version 8.0+.
++# CUDA_nppitc_LIBRARY -- NVIDIA Performance Primatives library (threshold and
++# compare operation functions). Only available for CUDA
++# version 8.0+.
+ # CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
+ # Only available for CUDA version 5.5+.
+ # CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
+@@ -522,6 +553,16 @@ macro(cuda_unset_include_and_libraries)
+ unset(CUDA_npp_LIBRARY CACHE)
+ unset(CUDA_nppc_LIBRARY CACHE)
+ unset(CUDA_nppi_LIBRARY CACHE)
++ unset(CUDA_nppial_LIBRARY CACHE)
++ unset(CUDA_nppicc_LIBRARY CACHE)
++ unset(CUDA_nppicom_LIBRARY CACHE)
++ unset(CUDA_nppidei_LIBRARY CACHE)
++ unset(CUDA_nppif_LIBRARY CACHE)
++ unset(CUDA_nppig_LIBRARY CACHE)
++ unset(CUDA_nppim_LIBRARY CACHE)
++ unset(CUDA_nppist_LIBRARY CACHE)
++ unset(CUDA_nppisu_LIBRARY CACHE)
++ unset(CUDA_nppitc_LIBRARY CACHE)
+ unset(CUDA_npps_LIBRARY CACHE)
+ unset(CUDA_nvcuvenc_LIBRARY CACHE)
+ unset(CUDA_nvcuvid_LIBRARY CACHE)
+@@ -787,7 +828,22 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2")
+ find_cuda_helper_libs(nvcuvid)
+ endif()
+ endif()
+-if(CUDA_VERSION VERSION_GREATER "5.0")
++if(CUDA_VERSION VERSION_GREATER "7.5")
++ # In CUDA 8.0 NPP was splitted onto 12 separate libraries.
++ find_cuda_helper_libs(nppc)
++ find_cuda_helper_libs(nppial)
++ find_cuda_helper_libs(nppicc)
++ find_cuda_helper_libs(nppicom)
++ find_cuda_helper_libs(nppidei)
++ find_cuda_helper_libs(nppif)
++ find_cuda_helper_libs(nppig)
++ find_cuda_helper_libs(nppim)
++ find_cuda_helper_libs(nppist)
++ find_cuda_helper_libs(nppisu)
++ find_cuda_helper_libs(nppitc)
++ find_cuda_helper_libs(npps)
++ set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}")
++elseif(CUDA_VERSION VERSION_GREATER "5.0")
+ # In CUDA 5.5 NPP was splitted onto 3 separate libraries.
+ find_cuda_helper_libs(nppc)
+ find_cuda_helper_libs(nppi)
+
+
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch
new file mode 100644
index 00000000000..384630002d9
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch
@@ -0,0 +1,21 @@
+--- a/cmake/OpenCVDetectCUDA.cmake 2018-01-02 11:57:50.358147518 -0500
++++ b/cmake/OpenCVDetectCUDA.cmake 2018-01-02 12:48:44.108965500 -0500
+@@ -104,7 +104,7 @@
+ if(${CUDA_VERSION} VERSION_LESS "8.0")
+ set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2")
+ else()
+- set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2 6.0 6.1")
++ set(__cuda_arch_bin "3.0 3.5 3.7 5.0 5.2 6.0 6.1")
+ endif()
+ endif()
+ endif()
+@@ -209,7 +209,7 @@ if(CUDA_FOUND)
+ endif()
+
+ if(UNIX OR APPLE)
+- set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC)
++ set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC --expt-relaxed-constexpr)
+ endif()
+ if(APPLE)
+ set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
+
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch
new file mode 100644
index 00000000000..43e2a0833ca
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch
@@ -0,0 +1,41 @@
+diff --git a/var/tmp/portage/media-libs/opencv-3.3.0-r4/work/opencv-3.3.0/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp b/./saturate_cast.hpp
+index ec9804c..4359d18 100644
+--- a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
++++ b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
+@@ -47,6 +47,9 @@
+ #define OPENCV_CUDEV_UTIL_SATURATE_CAST_HPP
+
+ #include "../common.hpp"
++#if __CUDACC_VER_MAJOR__ >= 9
++#include <cuda_fp16.h>
++#endif
+
+ namespace cv { namespace cudev {
+
+@@ -274,15 +277,25 @@ template <typename T, typename D> __device__ __forceinline__ D cast_fp16(T v);
+
+ template <> __device__ __forceinline__ float cast_fp16<short, float>(short v)
+ {
++#if __CUDACC_VER_MAJOR__ >= 9
++ return float(*(__half*)&v);
++#else
+ return __half2float(v);
++#endif
+ }
+
+ template <> __device__ __forceinline__ short cast_fp16<float, short>(float v)
+ {
+- return (short)__float2half_rn(v);
++#if __CUDACC_VER_MAJOR__ >= 9
++ __half h(v);
++ return *(short*)&v;
++#else
++ return (short)__float2half_rn(v);
++#endif
+ }
+ //! @}
+
+ }}
+
+ #endif
++
diff --git a/media-libs/opencv/metadata.xml b/media-libs/opencv/metadata.xml
index 271e8804134..a557fc06098 100644
--- a/media-libs/opencv/metadata.xml
+++ b/media-libs/opencv/metadata.xml
@@ -25,6 +25,7 @@ Face Recognition; Gesture Recognition; Motion Tracking, Ego Motion, Motion Under
<flag name="ipp">Enable Intel Integrated Primitive support</flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_xfeatures2d">Enables xfeatures2d and autodownload of samples in contrib</flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_cvv">CVV module requires Qt5</flag>
+ <flag restrict=">=media-libs/opencv-3.3.0" name="contrib_dnn">DNN module contrib requires tiny dnn</flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_hdf">HDF module requires <pkg>sci-libs/hdf5</pkg></flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_sfm">SFM module requires eigen, gflags, and glog</flag>
<flag name="opencl">Add support for OpenCL</flag>
diff --git a/media-libs/opencv/opencv-3.3.0-r5.ebuild b/media-libs/opencv/opencv-3.3.0-r5.ebuild
new file mode 100644
index 00000000000..8b76d791041
--- /dev/null
+++ b/media-libs/opencv/opencv-3.3.0-r5.ebuild
@@ -0,0 +1,466 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit toolchain-funcs python-r1 java-pkg-opt-2 java-ant-2 cmake-multilib
+
+DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
+HOMEPAGE="https://opencv.org"
+TINY_DNN_PV="1.0.0a3"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+ https://dev.gentoo.org/~amynka/snap/imgcodecs-${P}.tar.gz
+ contrib? ( https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
+ contrib_dnn? ( https://github.com/tiny-dnn/tiny-dnn/archive/v${TINY_DNN_PV}.tar.gz -> tiny-dnn-${TINY_DNN_PV}.tar.gz )
+ contrib_xfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz ) ) "
+LICENSE="BSD"
+SLOT="0/3.3" # subslot = libopencv* soname version
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="contrib cuda debug +eigen examples ffmpeg gdal gflags glog gphoto2 gstreamer gtk ieee1394 ipp jpeg jpeg2k lapack libav opencl openexr opengl openmp pch png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine contrib_cvv contrib_dnn contrib_hdf contrib_sfm contrib_xfeatures2d"
+
+# OpenGL needs gtk or Qt installed to activate, otherwise build system
+# will silently disable it without the user knowing, which defeats the
+# purpose of the opengl use flag.
+REQUIRED_USE="
+ cuda? ( tesseract? ( opencl ) )
+ gflags? ( contrib )
+ glog? ( contrib )
+ contrib_cvv? ( contrib qt5 )
+ contrib_dnn? ( contrib )
+ contrib_hdf? ( contrib )
+ contrib_sfm? ( contrib eigen gflags glog )
+ contrib_xfeatures2d? ( contrib cuda )
+ java? ( python )
+ opengl? ( || ( gtk qt5 ) )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ tesseract? ( contrib )"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# gtk? ( !qt5 )
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2[${MULTILIB_USEDEP}]
+ dev-libs/protobuf:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ cuda? ( dev-util/nvidia-cuda-toolkit:0= )
+ contrib_hdf? ( sci-libs/hdf5 )
+ ffmpeg? (
+ libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
+ !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
+ )
+ gdal? ( sci-libs/gdal:= )
+ gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )
+ glog? ( dev-cpp/glog[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
+ )
+ gtk? (
+ dev-libs/glib:2[${MULTILIB_USEDEP}]
+ x11-libs/gtk+:2[${MULTILIB_USEDEP}]
+ opengl? ( x11-libs/gtkglext[${MULTILIB_USEDEP}] )
+ )
+ ieee1394? (
+ media-libs/libdc1394[${MULTILIB_USEDEP}]
+ sys-libs/libraw1394[${MULTILIB_USEDEP}]
+ )
+ ipp? ( sci-libs/ipp )
+ java? ( >=virtual/jre-1.6:* )
+ jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
+ jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
+ lapack? ( virtual/lapack )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/opengl[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+ qt5? (
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ tesseract? ( app-text/tesseract[opencl=] )
+ threads? ( dev-cpp/tbb[${MULTILIB_USEDEP}] )
+ tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
+ v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp[${MULTILIB_USEDEP}] )
+ xine? ( media-libs/xine-lib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig[${MULTILIB_USEDEP}]
+ contrib_dnn? ( dev-libs/cereal )
+ eigen? ( dev-cpp/eigen:3 )
+ java? ( >=virtual/jdk-1.6 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/opencv2/cvconfig.h
+ /usr/include/opencv2/opencv_modules.hpp
+ # [contrib_cvv]
+ /usr/include/opencv2/cvv.hpp
+ /usr/include/opencv2/cvv/call_meta_data.hpp
+ /usr/include/opencv2/cvv/cvv.hpp
+ /usr/include/opencv2/cvv/debug_mode.hpp
+ /usr/include/opencv2/cvv/dmatch.hpp
+ /usr/include/opencv2/cvv/filter.hpp
+ /usr/include/opencv2/cvv/final_show.hpp
+ /usr/include/opencv2/cvv/show_image.hpp
+ # [contrib_hdf]
+ /usr/include/opencv2/hdf.hpp
+ /usr/include/opencv2/hdf/hdf5.hpp
+ # [vtk]
+ /usr/include/opencv2/viz.hpp
+ /usr/include/opencv2/viz/types.hpp
+ /usr/include/opencv2/viz/viz3d.hpp
+ /usr/include/opencv2/viz/vizcore.hpp
+ /usr/include/opencv2/viz/widget_accessor.hpp
+ /usr/include/opencv2/viz/widgets.hpp
+ # [cudev]
+ /usr/include/opencv2/cudaarithm.hpp
+ /usr/include/opencv2/cudabgsegm.hpp
+ /usr/include/opencv2/cudacodec.hpp
+ /usr/include/opencv2/cudafeatures2d.hpp
+ /usr/include/opencv2/cudafilters.hpp
+ /usr/include/opencv2/cudaimgproc.hpp
+ /usr/include/opencv2/cudalegacy.hpp
+ /usr/include/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
+ /usr/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
+ /usr/include/opencv2/cudalegacy/NCV.hpp
+ /usr/include/opencv2/cudalegacy/NCVPyramid.hpp
+ /usr/include/opencv2/cudalegacy/NPP_staging.hpp
+ /usr/include/opencv2/cudaobjdetect.hpp
+ /usr/include/opencv2/cudaoptflow.hpp
+ /usr/include/opencv2/cudastereo.hpp
+ /usr/include/opencv2/cudawarping.hpp
+ /usr/include/opencv2/cudev/block/block.hpp
+ /usr/include/opencv2/cudev/block/detail/reduce.hpp
+ /usr/include/opencv2/cudev/block/detail/reduce_key_val.hpp
+ /usr/include/opencv2/cudev/block/dynamic_smem.hpp
+ /usr/include/opencv2/cudev/block/reduce.hpp
+ /usr/include/opencv2/cudev/block/scan.hpp
+ /usr/include/opencv2/cudev/block/vec_distance.hpp
+ /usr/include/opencv2/cudev/common.hpp
+ /usr/include/opencv2/cudev/expr/binary_func.hpp
+ /usr/include/opencv2/cudev/expr/binary_op.hpp
+ /usr/include/opencv2/cudev/expr/color.hpp
+ /usr/include/opencv2/cudev/expr/deriv.hpp
+ /usr/include/opencv2/cudev/expr/expr.hpp
+ /usr/include/opencv2/cudev/expr/per_element_func.hpp
+ /usr/include/opencv2/cudev/expr/reduction.hpp
+ /usr/include/opencv2/cudev/expr/unary_func.hpp
+ /usr/include/opencv2/cudev/expr/unary_op.hpp
+ /usr/include/opencv2/cudev/expr/warping.hpp
+ /usr/include/opencv2/cudev/functional/color_cvt.hpp
+ /usr/include/opencv2/cudev/functional/detail/color_cvt.hpp
+ /usr/include/opencv2/cudev/functional/functional.hpp
+ /usr/include/opencv2/cudev/functional/tuple_adapter.hpp
+ /usr/include/opencv2/cudev/grid/copy.hpp
+ /usr/include/opencv2/cudev/grid/detail/copy.hpp
+ /usr/include/opencv2/cudev/grid/detail/histogram.hpp
+ /usr/include/opencv2/cudev/grid/detail/integral.hpp
+ /usr/include/opencv2/cudev/grid/detail/minmaxloc.hpp
+ /usr/include/opencv2/cudev/grid/detail/pyr_down.hpp
+ /usr/include/opencv2/cudev/grid/detail/pyr_up.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce_to_column.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce_to_row.hpp
+ /usr/include/opencv2/cudev/grid/detail/split_merge.hpp
+ /usr/include/opencv2/cudev/grid/detail/transform.hpp
+ /usr/include/opencv2/cudev/grid/detail/transpose.hpp
+ /usr/include/opencv2/cudev/grid/histogram.hpp
+ /usr/include/opencv2/cudev/grid/integral.hpp
+ /usr/include/opencv2/cudev/grid/pyramids.hpp
+ /usr/include/opencv2/cudev/grid/reduce.hpp
+ /usr/include/opencv2/cudev/grid/reduce_to_vec.hpp
+ /usr/include/opencv2/cudev/grid/split_merge.hpp
+ /usr/include/opencv2/cudev/grid/transform.hpp
+ /usr/include/opencv2/cudev/grid/transpose.hpp
+ /usr/include/opencv2/cudev.hpp
+ /usr/include/opencv2/cudev/ptr2d/constant.hpp
+ /usr/include/opencv2/cudev/ptr2d/deriv.hpp
+ /usr/include/opencv2/cudev/ptr2d/detail/gpumat.hpp
+ /usr/include/opencv2/cudev/ptr2d/extrapolation.hpp
+ /usr/include/opencv2/cudev/ptr2d/glob.hpp
+ /usr/include/opencv2/cudev/ptr2d/gpumat.hpp
+ /usr/include/opencv2/cudev/ptr2d/interpolation.hpp
+ /usr/include/opencv2/cudev/ptr2d/lut.hpp
+ /usr/include/opencv2/cudev/ptr2d/mask.hpp
+ /usr/include/opencv2/cudev/ptr2d/remap.hpp
+ /usr/include/opencv2/cudev/ptr2d/resize.hpp
+ /usr/include/opencv2/cudev/ptr2d/texture.hpp
+ /usr/include/opencv2/cudev/ptr2d/traits.hpp
+ /usr/include/opencv2/cudev/ptr2d/transform.hpp
+ /usr/include/opencv2/cudev/ptr2d/warping.hpp
+ /usr/include/opencv2/cudev/ptr2d/zip.hpp
+ /usr/include/opencv2/cudev/util/atomic.hpp
+ /usr/include/opencv2/cudev/util/detail/tuple.hpp
+ /usr/include/opencv2/cudev/util/detail/type_traits.hpp
+ /usr/include/opencv2/cudev/util/limits.hpp
+ /usr/include/opencv2/cudev/util/saturate_cast.hpp
+ /usr/include/opencv2/cudev/util/simd_functions.hpp
+ /usr/include/opencv2/cudev/util/tuple.hpp
+ /usr/include/opencv2/cudev/util/type_traits.hpp
+ /usr/include/opencv2/cudev/util/vec_math.hpp
+ /usr/include/opencv2/cudev/util/vec_traits.hpp
+ /usr/include/opencv2/cudev/warp/detail/reduce.hpp
+ /usr/include/opencv2/cudev/warp/detail/reduce_key_val.hpp
+ /usr/include/opencv2/cudev/warp/reduce.hpp
+ /usr/include/opencv2/cudev/warp/scan.hpp
+ /usr/include/opencv2/cudev/warp/shuffle.hpp
+ /usr/include/opencv2/cudev/warp/warp.hpp
+)
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0.0-gles.patch"
+ "${FILESDIR}/${PN}-3.1.0-java-magic.patch"
+ "${FILESDIR}/${PN}-3.1.0-find-libraries-fix.patch"
+ "${WORKDIR}/${P}-imgcodecs-gcc.patch" # bug 627958 and https://github.com/opencv/opencv/pull/9376
+ "${FILESDIR}/${P}-cuda9-cmake.patch"
+ "${FILESDIR}/${P}-cuda9-saturate.patch"
+ "${FILESDIR}/${P}-cuda9-compute20.patch"
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # remove bundled stuff
+ rm -rf 3rdparty || die "Removing 3rd party components failed"
+ sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ -i CMakeLists.txt cmake/*cmake || die
+
+ if use contrib && use contrib_dnn; then
+ cd "${WORKDIR}/${PN}_contrib-${PV}" || die
+ eapply "${FILESDIR}/${P}-remove-tiny-dnn-autodownload.patch"
+ fi
+
+ if use contrib && use contrib_xfeatures2d; then
+ cd "${WORKDIR}/${PN}_contrib-${PV}" || die
+ eapply "${FILESDIR}/${P}-contrib-xfeatures2d.patch"
+ mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
+ fi
+
+ java-pkg-opt-2_src_prepare
+
+ # this really belongs in src_prepare() too
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+}
+
+multilib_src_configure() {
+ # please dont sort here, order is the same as in CMakeLists.txt
+ GLOBALCMAKEARGS=(
+ # Optional 3rd party components
+ # ===================================================
+ -DWITH_1394=$(usex ieee1394)
+ # -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_VTK=$(multilib_native_usex vtk)
+ -DWITH_EIGEN=$(usex eigen)
+ -DWITH_VFW=OFF # Video windows support
+ -DWITH_FFMPEG=$(usex ffmpeg)
+ -DWITH_GSTREAMER=$(usex gstreamer)
+ -DWITH_GSTREAMER_0_10=OFF # Don't want this
+ -DWITH_GTK=$(usex gtk)
+ -DWITH_GTK_2_X=$(usex gtk)
+ -DWITH_IPP=$(multilib_native_usex ipp)
+ -DWITH_JASPER=$(usex jpeg2k)
+ -DWITH_JPEG=$(usex jpeg)
+ -DWITH_WEBP=$(usex webp)
+ -DWITH_OPENEXR=$(usex openexr)
+ -DWITH_OPENGL=$(usex opengl)
+ -DWITH_OPENVX=OFF
+ -DWITH_OPENNI=OFF # Not packaged
+ -DWITH_OPENNI2=OFF # Not packaged
+ -DWITH_PNG=$(usex png)
+ -DWITH_GDCM=OFF
+ -DWITH_PVAPI=OFF
+ -DWITH_GIGEAPI=OFF
+ -DWITH_ARAVIS=OFF
+ -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
+ -DWITH_WIN32UI=OFF # Windows only
+ # -DWITH_QUICKTIME=OFF
+ # -DWITH_QTKIT=OFF
+ -DWITH_TBB=$(usex threads)
+ -DWITH_OPENMP=$(usex openmp)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ -DWITH_TIFF=$(usex tiff)
+ -DWITH_UNICAP=OFF # Not packaged
+ -DWITH_V4L=$(usex v4l)
+ -DWITH_LIBV4L=$(usex v4l)
+ -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_XIMEA=OFF # Windows only
+ -DWITH_XINE=$(multilib_native_usex xine)
+ -DWITH_CLP=OFF
+ -DWITH_OPENCL=$(usex opencl)
+ -DWITH_OPENCL_SVM=OFF
+ -DWITH_OPENCLAMDFFT=$(usex opencl)
+ -DWITH_OPENCLAMDBLAS=$(usex opencl)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=OFF
+ -DWITH_VA=$(usex vaapi)
+ -DWITH_VA_INTEL=$(usex vaapi)
+ -DWITH_GDAL=$(multilib_native_usex gdal)
+ -DWITH_GPHOTO2=$(usex gphoto2)
+ -DWITH_LAPACK=$(multilib_native_usex lapack)
+ -DWITH_ITT=OFF # 3dparty libs itt_notify
+ # ===================================================
+ # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
+ # ===================================================
+ -DWITH_CUDA=$(multilib_native_usex cuda)
+ -DWITH_CUBLAS=$(multilib_native_usex cuda)
+ -DWITH_CUFFT=$(multilib_native_usex cuda)
+ -DWITH_NVCUVID=OFF
+# -DWITH_NVCUVID=$(usex cuda)
+ -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
+ # ===================================================
+ # OpenCV build components
+ # ===================================================
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ -BUILD_opencv_apps=
+ -DBUILD_DOCS=OFF # Doesn't install anyways.
+ -DBUILD_EXAMPLES=$(multilib_native_usex examples)
+ -DBUILD_PERF_TESTS=OFF
+ -DBUILD_TESTS=$(multilib_native_usex testprograms)
+ -DBUILD_WITH_DEBUG_INFO=$(usex debug)
+ # -DBUILD_WITH_STATIC_CRT=OFF
+ -DBUILD_WITH_DYNAMIC_IPP=OFF
+ -DBUILD_FAT_JAVA_LIB=$(multilib_native_usex java)
+ # -DBUILD_ANDROID_SERVICE=OFF
+ -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
+ -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
+ # ===================================================
+ # OpenCV installation options
+ # ===================================================
+ -DINSTALL_CREATE_DISTRIB=OFF
+ -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
+ -DINSTALL_TESTS=$(multilib_native_usex testprograms)
+ -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
+ # -DINSTALL_ANDROID_EXAMPLES=OFF
+ -DINSTALL_TO_MANGLED_PATHS=OFF
+ # ===================================================
+ # OpenCV build options
+ # ===================================================
+ -DENABLE_CCACHE=OFF
+ -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
+ -DENABLE_SOLUTION_FOLDERS=OFF
+ -DENABLE_PROFILING=OFF
+ -DENABLE_COVERAGE=OFF
+
+ -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
+ -DENABLE_NOISY_WARNINGS=OFF
+ -DOPENCV_WARNINGS_ARE_ERRORS=OFF
+ -DENABLE_IMPL_COLLECTION=OFF
+ -DENABLE_INSTRUMENTATION=OFF
+ -DGENERATE_ABI_DESCRIPTOR=OFF
+ -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
+ # ===================================================
+ # things we want to be hard off or not yet figured out
+ # ===================================================
+ -DBUILD_PACKAGE=OFF
+ # ===================================================
+ # Not building protobuf but update files bug #631418
+ # ===================================================
+ -DBUILD_PROTOBUF=OFF
+ -DPROTOBUF_UPDATE_FILES=ON
+ # ===================================================
+ # things we want to be hard enabled not worth useflag
+ # ===================================================
+ -DCMAKE_SKIP_RPATH=ON
+ -DOPENCV_DOC_INSTALL_PATH=
+ )
+
+ # ===================================================
+ # OpenCV Contrib Modules
+ # ===================================================
+ if use contrib; then
+ GLOBALCMAKEARGS+=(
+ -DBUILD_opencv_dnn=$(usex contrib_dnn ON OFF)
+ -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
+ -DBUILD_opencv_dnns_easily_fooled=OFF
+ -DBUILD_opencv_xfeatures2d=$(usex contrib_xfeatures2d ON OFF)
+ -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF)
+ -DBUILD_opencv_hdf=$(multilib_native_usex contrib_hdf ON OFF)
+ -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF)
+ )
+
+ if multilib_is_native_abi; then
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
+ )
+ else
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
+ )
+ fi
+ fi
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
+ -DPYTHON_EXECUTABLE=OFF
+ -DINSTALL_PYTHON_EXAMPLES=OFF
+ )
+
+ cmake-utils_src_configure
+}
+
+python_module_compile() {
+ local BUILD_DIR=${orig_BUILD_DIR}
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
+
+ # Set all python variables to load the correct Gentoo paths
+ mycmakeargs+=(
+ # cheap trick: python_setup sets one of them as a symlink
+ # to the correct interpreter, and the other to fail-wrapper
+ -DPYTHON2_EXECUTABLE=$(type -P python2)
+ -DPYTHON3_EXECUTABLE=$(type -P python3)
+ -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
+ )
+
+ # Regenerate cache file. Can't use rebuild_cache as it won't
+ # have the Gentoo specific options.
+ rm -rf CMakeCache.txt || die "rm failed"
+ cmake-utils_src_configure
+ cmake-utils_src_compile
+ cmake-utils_src_install
+
+ # Remove compiled binary so new version compiles
+ # Avoid conflicts with new module builds as build system doesn't
+ # really support it.
+ rm -rf modules/python2 || die "rm failed"
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # Build and install the python modules for all targets
+ if multilib_is_native_abi && use python; then
+ local orig_BUILD_DIR=${BUILD_DIR}
+ python_foreach_impl python_module_compile
+ fi
+}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2018-05-25 19:26 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2018-05-25 19:26 UTC (permalink / raw
To: gentoo-commits
commit: f3c8fe50642f04ec8434ee96f153689cedb8ec5c
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Fri May 25 19:23:46 2018 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Fri May 25 19:26:03 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3c8fe50
media-libs/opencv: version bump 3.4.1
Closes: https://bugs.gentoo.org/642800
Closes: https://bugs.gentoo.org/633900
Package-Manager: Portage-2.3.24, Repoman-2.3.6
media-libs/opencv/Manifest | 4 +
.../files/opencv-3.4.0-disable-download.patch | 29 ++
media-libs/opencv/metadata.xml | 1 +
media-libs/opencv/opencv-3.4.1.ebuild | 495 +++++++++++++++++++++
4 files changed, 529 insertions(+)
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index b193d22127a..26353736e85 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -6,5 +6,9 @@ DIST opencv-3.2.0.tar.gz 78861546 BLAKE2B 6d44263792b9cd2d009c7eeaddc2ef87acb014
DIST opencv-3.2.0_contrib.tar.gz 54765210 BLAKE2B 6c5bcb1c18da937751f234cc1edaae58416ab9ab5a3407a2ab2c22f4e174ffeb800396d34fe489f424b288fbd608e106cd5f5b458a06a509cea5f7d8e23a67a7 SHA512 eadb6a8a3625235b0c71e29c36d15d9342278aaf9148ef6a7e1aa80f4db0491aaf30b6df16bfd0cd358402b2a3059b6acbce23fb5fe2c0c57150a733ffbbff5a
DIST opencv-3.3.0.tar.gz 81238534 BLAKE2B 9eac7de8eefbcc9981a249343052c2dcada4e73c3406d545a89b9e6a054a7c7153933537d123f227caf51f23196fcaaed4135229db195e9c4139f2977e034e34 SHA512 13dee5c1c5fec1dccdbb05879d299b93ef8ddeb87f561a6c4178e33a4cf5ae919765119068d0387a3efea0e09a625ca993cffac60a772159690fcbee4e8d70fb
DIST opencv-3.3.0_contrib.tar.gz 54848519 BLAKE2B 53615af19426bf7a1540a6f23c7803276d6de594260b0d87b06b6b12c9e20326925a275e31e017784e8e876e30df7b8f326e192a75c5300252ae09f50d0d9a8b SHA512 ebe3dbe6c754c6fbaabbf6b0d2a4209964e625fd68e593f30ce043792740c8c1d4440d7870949b5b33f488fd7e2e05f3752287b7f50dd24c29202e268776520e
+DIST opencv-3.4.0-face_landmark_model.tar.gz 63299830 BLAKE2B 58f08cd8c030ee1c8b66e76a561fd625e112face427d001185f8d7c0eaace55adbd8474663021841a1382bfe393a210e64c51223441713cdb9156fac866a845c SHA512 2cd29ce42c08b2966db3ef4a2bc217ab3d07051819757ec6de8f3deea29e28f60abab39f101dba03f766f17018598e411bd687a7eaab0c681c113e10a2de2b23
+DIST opencv-3.4.0-res10_300x300-caffeemodel.tar.gz 10036604 BLAKE2B 2a2de48fc420f13e7be146ac88f311901c5b4e409c30e466152e33cae1f8afd87dcb6d758af447c268d90bd67989c8798cd80cab172b10499a6ad5224509dbdf SHA512 96fee9f447d5739bc01a5cab37c453cf7237457dfb5d2bf93ac37f8e5aa557ac222316f449cd58e37e856abe4d8e9d4a7820daaba32f0b22cbcde8e340287d4b
+DIST opencv-3.4.1.tar.gz 87051748 BLAKE2B 87c83ab9b3d7fb048263f047aa5d6e95b153e1a28f3e34cc885eff7eb080a2258cfa1aa494cd56b32f1098ab158c17c23fc8464fcbe70642a3a1842f2fd1b4ac SHA512 e1fc14285090c6fe9e26e721f2d67d7096650c523147e925567426ef76aa7f4c6f12035d6f6ce3ec7991a75a6828a810fd4f9b75f78ed5fcccecefbadd79944b
+DIST opencv-3.4.1_contrib.tar.gz 57126844 BLAKE2B 63d9d5cb088371754eb132607789c8f1d4820f3e0e486593d6f64ee8f918ea4362152f050baec16f17904c03a6cdc0abc6e5fb2510308dcbabebe97b29285fbc SHA512 431dfba0f413071d7faa18bc6e6f5e4f015285e2cc730c5dd69b2a4d6aa4250b7e0bcb1814ac6f06f5c76f103aea1f93f72f32aee6bc0cd7ddacdaf1f40075c1
DIST tiny-dnn-1.0.0a3.tar.gz 12885646 BLAKE2B 85c0715ab6c692b77522487775e70b0db645528baed1830c83c9f44d2b67a5207e4f7ea1709b35c6a4217d287199549304e9be19f4a5cec9a1183b0b5dccc562 SHA512 5f2c1a161771efa67e85b1fea395953b7744e29f61187ac5a6c54c912fb195b3aef9a5827135c3668bd0eeea5ae04a33cc433e1f6683e2b7955010a2632d168b
DIST vgg_boostdesc-3.2.0.tar.gz 1867770 BLAKE2B 1fa5b58e73b6fa56ecf8d19af22298f729942ee1369082e173445d09d3de767bf844bad3d2b462efc1199c392f37c88ba49a9996ba8bfd84b4abeba7de94db63 SHA512 4a046aedd639c8eb4b295b0f499e756deb66210ca083f0124c75531e540663367cb58f6d175f66c4713324177036cd89a8869bdab2de8d1736dafc7f00ef9f44
diff --git a/media-libs/opencv/files/opencv-3.4.0-disable-download.patch b/media-libs/opencv/files/opencv-3.4.0-disable-download.patch
new file mode 100644
index 00000000000..245ad3b3d02
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.0-disable-download.patch
@@ -0,0 +1,29 @@
+--- a/CMakeLists.txt 2018-05-13 20:47:11.635871328 +0200
++++ b/CMakeLists.txt 2018-05-13 20:47:49.289872617 +0200
+@@ -187,6 +187,7 @@
+ # ----------------------------------------------------------------------------
+
+ OCV_OPTION(OPENCV_ENABLE_NONFREE "Enable non-free algorithms" OFF)
++OCV_OPTION(ENABLE_DOWNLOAD "Enable download during configure" ON)
+
+ # 3rd party libs
+ OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE)
+
+--- a/cmake/OpenCVDownload.cmake 2018-05-13 21:22:14.966943336 +0200
++++ b/cmake/OpenCVDownload.cmake 2018-05-13 21:23:15.959945424 +0200
+@@ -32,6 +32,7 @@
+
+
+ function(ocv_download)
++ if(ENABLE_DOWNLOAD)
+ cmake_parse_arguments(DL "UNPACK;RELATIVE_URL" "FILENAME;HASH;DESTINATION_DIR;ID;STATUS" "URL" ${ARGN})
+
+ macro(ocv_download_log)
+@@ -236,4 +237,7 @@
+ if(OCV_DOWNLOAD_HASH_NAME)
+ set(${OCV_DOWNLOAD_HASH_NAME} "${DL_HASH}" CACHE INTERNAL "")
+ endif()
++ else()
++ message( "Download was disabled during configure phase by ENABLE_DOWNLOAD=OFF" )
++ endif()
+ endfunction()
diff --git a/media-libs/opencv/metadata.xml b/media-libs/opencv/metadata.xml
index 5e3541cd325..f87770fadaf 100644
--- a/media-libs/opencv/metadata.xml
+++ b/media-libs/opencv/metadata.xml
@@ -27,6 +27,7 @@ Face Recognition; Gesture Recognition; Motion Tracking, Ego Motion, Motion Under
<flag restrict=">=media-libs/opencv-3.3.0" name="contrib_dnn">DNN module contrib requires tiny dnn</flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_hdf">HDF module requires <pkg>sci-libs/hdf5</pkg></flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="contrib_sfm">SFM module requires eigen, gflags, and glog</flag>
+ <flag restrict=">=media-libs/opencv-3.4.0" name="dnn_samples">Download dnn caffeemodel samples</flag>
<flag name="opencl">Add support for OpenCL</flag>
<flag restrict=">=media-libs/opencv-3.1.0" name="tesseract">Use Google's OCR Engine</flag>
<flag name="testprograms">Build and install programs for testing OpenCV (performance)</flag>
diff --git a/media-libs/opencv/opencv-3.4.1.ebuild b/media-libs/opencv/opencv-3.4.1.ebuild
new file mode 100644
index 00000000000..0f07d45bf9b
--- /dev/null
+++ b/media-libs/opencv/opencv-3.4.1.ebuild
@@ -0,0 +1,495 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit java-pkg-opt-2 java-ant-2 python-r1 toolchain-funcs cmake-multilib
+
+DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
+HOMEPAGE="https://opencv.org"
+TINY_DNN_PV="1.0.0a3"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+ dnn_samples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
+ contrib? (
+ https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
+ contrib_dnn? ( https://github.com/tiny-dnn/tiny-dnn/archive/v${TINY_DNN_PV}.tar.gz -> tiny-dnn-${TINY_DNN_PV}.tar.gz
+ https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz
+ )
+ contrib_xfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
+ )"
+
+LICENSE="BSD"
+SLOT="0/3.4.1" # subslot = libopencv* soname version
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="contrib contrib_cvv contrib_dnn contrib_hdf contrib_sfm contrib_xfeatures2d cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_popcnt cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_fma3 cuda debug dnn_samples +eigen examples ffmpeg gdal gflags glog gphoto2 gstreamer gtk ieee1394 ipp jpeg jpeg2k lapack libav opencl openexr opengl openmp pch png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
+# OpenGL needs gtk or Qt installed to activate, otherwise build system
+# will silently disable it Wwithout the user knowing, which defeats the
+# purpose of the opengl use flag.
+REQUIRED_USE="
+ cpu_flags_x86_sse
+ cpu_flags_x86_sse2
+ cuda? ( tesseract? ( opencl ) )
+ dnn_samples? ( examples )
+ gflags? ( contrib )
+ glog? ( contrib )
+ contrib_cvv? ( contrib qt5 )
+ contrib_dnn? ( contrib )
+ contrib_hdf? ( contrib )
+ contrib_sfm? ( contrib eigen gflags glog )
+ contrib_xfeatures2d? ( contrib cuda )
+ java? ( python )
+ opengl? ( || ( gtk qt5 ) )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ tesseract? ( contrib )"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# gtk? ( !qt5 )
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2[${MULTILIB_USEDEP}]
+ dev-libs/protobuf:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ cuda? ( dev-util/nvidia-cuda-toolkit:0= )
+ contrib_hdf? ( sci-libs/hdf5 )
+ ffmpeg? (
+ libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
+ !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
+ )
+ gdal? ( sci-libs/gdal:= )
+ gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )
+ glog? ( dev-cpp/glog[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
+ )
+ gtk? (
+ dev-libs/glib:2[${MULTILIB_USEDEP}]
+ x11-libs/gtk+:2[${MULTILIB_USEDEP}]
+ opengl? ( x11-libs/gtkglext[${MULTILIB_USEDEP}] )
+ )
+ ieee1394? (
+ media-libs/libdc1394[${MULTILIB_USEDEP}]
+ sys-libs/libraw1394[${MULTILIB_USEDEP}]
+ )
+ ipp? ( sci-libs/ipp )
+ java? ( >=virtual/jre-1.6:* )
+ jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
+ jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
+ lapack? ( virtual/lapack )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/opengl[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
+ qt5? (
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qttest:5
+ dev-qt/qtconcurrent:5
+ opengl? ( dev-qt/qtopengl:5 )
+ )
+ tesseract? ( app-text/tesseract[opencl=] )
+ threads? ( dev-cpp/tbb[${MULTILIB_USEDEP}] )
+ tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
+ v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp[${MULTILIB_USEDEP}] )
+ xine? ( media-libs/xine-lib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig[${MULTILIB_USEDEP}]
+ contrib_dnn? ( dev-libs/cereal )
+ eigen? ( dev-cpp/eigen:3 )
+ java? ( >=virtual/jdk-1.6 )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/opencv2/cvconfig.h
+ /usr/include/opencv2/opencv_modules.hpp
+ # [contrib_cvv]
+ /usr/include/opencv2/cvv.hpp
+ /usr/include/opencv2/cvv/call_meta_data.hpp
+ /usr/include/opencv2/cvv/cvv.hpp
+ /usr/include/opencv2/cvv/debug_mode.hpp
+ /usr/include/opencv2/cvv/dmatch.hpp
+ /usr/include/opencv2/cvv/filter.hpp
+ /usr/include/opencv2/cvv/final_show.hpp
+ /usr/include/opencv2/cvv/show_image.hpp
+ # [contrib_hdf]
+ /usr/include/opencv2/hdf.hpp
+ /usr/include/opencv2/hdf/hdf5.hpp
+ # [vtk]
+ /usr/include/opencv2/viz.hpp
+ /usr/include/opencv2/viz/types.hpp
+ /usr/include/opencv2/viz/viz3d.hpp
+ /usr/include/opencv2/viz/vizcore.hpp
+ /usr/include/opencv2/viz/widget_accessor.hpp
+ /usr/include/opencv2/viz/widgets.hpp
+ # [cudev]
+ /usr/include/opencv2/cudaarithm.hpp
+ /usr/include/opencv2/cudabgsegm.hpp
+ /usr/include/opencv2/cudacodec.hpp
+ /usr/include/opencv2/cudafeatures2d.hpp
+ /usr/include/opencv2/cudafilters.hpp
+ /usr/include/opencv2/cudaimgproc.hpp
+ /usr/include/opencv2/cudalegacy.hpp
+ /usr/include/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
+ /usr/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
+ /usr/include/opencv2/cudalegacy/NCV.hpp
+ /usr/include/opencv2/cudalegacy/NCVPyramid.hpp
+ /usr/include/opencv2/cudalegacy/NPP_staging.hpp
+ /usr/include/opencv2/cudaobjdetect.hpp
+ /usr/include/opencv2/cudaoptflow.hpp
+ /usr/include/opencv2/cudastereo.hpp
+ /usr/include/opencv2/cudawarping.hpp
+ /usr/include/opencv2/cudev/block/block.hpp
+ /usr/include/opencv2/cudev/block/detail/reduce.hpp
+ /usr/include/opencv2/cudev/block/detail/reduce_key_val.hpp
+ /usr/include/opencv2/cudev/block/dynamic_smem.hpp
+ /usr/include/opencv2/cudev/block/reduce.hpp
+ /usr/include/opencv2/cudev/block/scan.hpp
+ /usr/include/opencv2/cudev/block/vec_distance.hpp
+ /usr/include/opencv2/cudev/common.hpp
+ /usr/include/opencv2/cudev/expr/binary_func.hpp
+ /usr/include/opencv2/cudev/expr/binary_op.hpp
+ /usr/include/opencv2/cudev/expr/color.hpp
+ /usr/include/opencv2/cudev/expr/deriv.hpp
+ /usr/include/opencv2/cudev/expr/expr.hpp
+ /usr/include/opencv2/cudev/expr/per_element_func.hpp
+ /usr/include/opencv2/cudev/expr/reduction.hpp
+ /usr/include/opencv2/cudev/expr/unary_func.hpp
+ /usr/include/opencv2/cudev/expr/unary_op.hpp
+ /usr/include/opencv2/cudev/expr/warping.hpp
+ /usr/include/opencv2/cudev/functional/color_cvt.hpp
+ /usr/include/opencv2/cudev/functional/detail/color_cvt.hpp
+ /usr/include/opencv2/cudev/functional/functional.hpp
+ /usr/include/opencv2/cudev/functional/tuple_adapter.hpp
+ /usr/include/opencv2/cudev/grid/copy.hpp
+ /usr/include/opencv2/cudev/grid/detail/copy.hpp
+ /usr/include/opencv2/cudev/grid/detail/histogram.hpp
+ /usr/include/opencv2/cudev/grid/detail/integral.hpp
+ /usr/include/opencv2/cudev/grid/detail/minmaxloc.hpp
+ /usr/include/opencv2/cudev/grid/detail/pyr_down.hpp
+ /usr/include/opencv2/cudev/grid/detail/pyr_up.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce_to_column.hpp
+ /usr/include/opencv2/cudev/grid/detail/reduce_to_row.hpp
+ /usr/include/opencv2/cudev/grid/detail/split_merge.hpp
+ /usr/include/opencv2/cudev/grid/detail/transform.hpp
+ /usr/include/opencv2/cudev/grid/detail/transpose.hpp
+ /usr/include/opencv2/cudev/grid/histogram.hpp
+ /usr/include/opencv2/cudev/grid/integral.hpp
+ /usr/include/opencv2/cudev/grid/pyramids.hpp
+ /usr/include/opencv2/cudev/grid/reduce.hpp
+ /usr/include/opencv2/cudev/grid/reduce_to_vec.hpp
+ /usr/include/opencv2/cudev/grid/split_merge.hpp
+ /usr/include/opencv2/cudev/grid/transform.hpp
+ /usr/include/opencv2/cudev/grid/transpose.hpp
+ /usr/include/opencv2/cudev.hpp
+ /usr/include/opencv2/cudev/ptr2d/constant.hpp
+ /usr/include/opencv2/cudev/ptr2d/deriv.hpp
+ /usr/include/opencv2/cudev/ptr2d/detail/gpumat.hpp
+ /usr/include/opencv2/cudev/ptr2d/extrapolation.hpp
+ /usr/include/opencv2/cudev/ptr2d/glob.hpp
+ /usr/include/opencv2/cudev/ptr2d/gpumat.hpp
+ /usr/include/opencv2/cudev/ptr2d/interpolation.hpp
+ /usr/include/opencv2/cudev/ptr2d/lut.hpp
+ /usr/include/opencv2/cudev/ptr2d/mask.hpp
+ /usr/include/opencv2/cudev/ptr2d/remap.hpp
+ /usr/include/opencv2/cudev/ptr2d/resize.hpp
+ /usr/include/opencv2/cudev/ptr2d/texture.hpp
+ /usr/include/opencv2/cudev/ptr2d/traits.hpp
+ /usr/include/opencv2/cudev/ptr2d/transform.hpp
+ /usr/include/opencv2/cudev/ptr2d/warping.hpp
+ /usr/include/opencv2/cudev/ptr2d/zip.hpp
+ /usr/include/opencv2/cudev/util/atomic.hpp
+ /usr/include/opencv2/cudev/util/detail/tuple.hpp
+ /usr/include/opencv2/cudev/util/detail/type_traits.hpp
+ /usr/include/opencv2/cudev/util/limits.hpp
+ /usr/include/opencv2/cudev/util/saturate_cast.hpp
+ /usr/include/opencv2/cudev/util/simd_functions.hpp
+ /usr/include/opencv2/cudev/util/tuple.hpp
+ /usr/include/opencv2/cudev/util/type_traits.hpp
+ /usr/include/opencv2/cudev/util/vec_math.hpp
+ /usr/include/opencv2/cudev/util/vec_traits.hpp
+ /usr/include/opencv2/cudev/warp/detail/reduce.hpp
+ /usr/include/opencv2/cudev/warp/detail/reduce_key_val.hpp
+ /usr/include/opencv2/cudev/warp/reduce.hpp
+ /usr/include/opencv2/cudev/warp/scan.hpp
+ /usr/include/opencv2/cudev/warp/shuffle.hpp
+ /usr/include/opencv2/cudev/warp/warp.hpp
+)
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0.0-gles.patch"
+ "${FILESDIR}/${PN}-3.4.0-disable-download.patch"
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # remove bundled stuff
+ rm -rf 3rdparty || die "Removing 3rd party components failed"
+ sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ -i CMakeLists.txt cmake/*cmake || die
+
+ if use dnn_samples; then
+ mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
+ fi
+
+ if use contrib; then
+ cd "${WORKDIR}/${PN}_contrib-${PV}" || die
+ eapply "${FILESDIR}/${PN}-3.3.0-remove-tiny-dnn-autodownload.patch"
+
+ if use contrib_xfeatures2d; then
+ mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
+ fi
+ fi
+
+ java-pkg-opt-2_src_prepare
+
+ # this really belongs in src_prepare() too
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+}
+
+multilib_src_configure() {
+ # please dont sort here, order is the same as in CMakeLists.txt
+ GLOBALCMAKEARGS=(
+ # Optional 3rd party components
+ # ===================================================
+ -DENABLE_DOWNLOAD=OFF
+ -DWITH_1394=$(usex ieee1394)
+ # -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_VTK=$(multilib_native_usex vtk)
+ -DWITH_EIGEN=$(usex eigen)
+ -DWITH_VFW=OFF # Video windows support
+ -DWITH_FFMPEG=$(usex ffmpeg)
+ -DWITH_GSTREAMER=$(usex gstreamer)
+ -DWITH_GSTREAMER_0_10=OFF # Don't want this
+ -DWITH_GTK=$(usex gtk)
+ -DWITH_GTK_2_X=$(usex gtk)
+ -DWITH_IPP=$(multilib_native_usex ipp)
+ -DWITH_JASPER=$(usex jpeg2k)
+ -DWITH_JPEG=$(usex jpeg)
+ -DWITH_WEBP=$(usex webp)
+ -DWITH_OPENEXR=$(usex openexr)
+ -DWITH_OPENGL=$(usex opengl)
+ -DWITH_OPENVX=OFF
+ -DWITH_OPENNI=OFF # Not packaged
+ -DWITH_OPENNI2=OFF # Not packaged
+ -DWITH_PNG=$(usex png)
+ -DWITH_GDCM=OFF
+ -DWITH_PVAPI=OFF
+ -DWITH_GIGEAPI=OFF
+ -DWITH_ARAVIS=OFF
+ -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
+ -DWITH_WIN32UI=OFF # Windows only
+ # -DWITH_QUICKTIME=OFF
+ # -DWITH_QTKIT=OFF
+ -DWITH_TBB=$(usex threads)
+ -DWITH_OPENMP=$(usex openmp)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ -DWITH_TIFF=$(usex tiff)
+ -DWITH_UNICAP=OFF # Not packaged
+ -DWITH_V4L=$(usex v4l)
+ -DWITH_LIBV4L=$(usex v4l)
+ -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_XIMEA=OFF # Windows only
+ -DWITH_XINE=$(multilib_native_usex xine)
+ -DWITH_CLP=OFF
+ -DWITH_OPENCL=$(usex opencl)
+ -DWITH_OPENCL_SVM=OFF
+ -DWITH_OPENCLAMDFFT=$(usex opencl)
+ -DWITH_OPENCLAMDBLAS=$(usex opencl)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=OFF
+ -DWITH_VA=$(usex vaapi)
+ -DWITH_VA_INTEL=$(usex vaapi)
+ -DWITH_GDAL=$(multilib_native_usex gdal)
+ -DWITH_GPHOTO2=$(usex gphoto2)
+ -DWITH_LAPACK=$(multilib_native_usex lapack)
+ -DWITH_ITT=OFF # 3dparty libs itt_notify
+ # ===================================================
+ # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
+ # ===================================================
+ -DWITH_CUDA=$(multilib_native_usex cuda)
+ -DWITH_CUBLAS=$(multilib_native_usex cuda)
+ -DWITH_CUFFT=$(multilib_native_usex cuda)
+ -DWITH_NVCUVID=OFF
+# -DWITH_NVCUVID=$(usex cuda)
+ -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
+ # ===================================================
+ # OpenCV build components
+ # ===================================================
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ -BUILD_opencv_apps=
+ -DBUILD_DOCS=OFF # Doesn't install anyways.
+ -DBUILD_EXAMPLES=$(multilib_native_usex examples)
+ -DBUILD_PERF_TESTS=OFF
+ -DBUILD_TESTS=$(multilib_native_usex testprograms)
+ -DBUILD_WITH_DEBUG_INFO=$(usex debug)
+ # -DBUILD_WITH_STATIC_CRT=OFF
+ -DBUILD_WITH_DYNAMIC_IPP=OFF
+ -DBUILD_FAT_JAVA_LIB=$(multilib_native_usex java)
+ # -DBUILD_ANDROID_SERVICE=OFF
+ -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
+ -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
+ # ===================================================
+ # OpenCV installation options
+ # ===================================================
+ -DINSTALL_CREATE_DISTRIB=OFF
+ -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
+ -DINSTALL_TESTS=$(multilib_native_usex testprograms)
+ -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
+ # -DINSTALL_ANDROID_EXAMPLES=OFF
+ -DINSTALL_TO_MANGLED_PATHS=OFF
+ # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
+ # to set its destination libdir
+ -DLIB_SUFFIX=
+ # ===================================================
+ # OpenCV build options
+ # ===================================================
+ -DENABLE_CCACHE=OFF
+ -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
+ -DENABLE_SOLUTION_FOLDERS=OFF
+ -DENABLE_PROFILING=OFF
+ -DENABLE_COVERAGE=OFF
+
+ -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
+ -DENABLE_NOISY_WARNINGS=OFF
+ -DOPENCV_WARNINGS_ARE_ERRORS=OFF
+ -DENABLE_IMPL_COLLECTION=OFF
+ -DENABLE_INSTRUMENTATION=OFF
+ -DGENERATE_ABI_DESCRIPTOR=OFF
+ -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
+ # ===================================================
+ # things we want to be hard off or not yet figured out
+ # ===================================================
+ -DBUILD_PACKAGE=OFF
+ # ===================================================
+ # Not building protobuf but update files bug #631418
+ # ===================================================
+ -DBUILD_PROTOBUF=OFF
+ -DPROTOBUF_UPDATE_FILES=ON
+ # ===================================================
+ # things we want to be hard enabled not worth useflag
+ # ===================================================
+ -DCMAKE_SKIP_RPATH=ON
+ -DOPENCV_DOC_INSTALL_PATH=
+ # ==================================================
+ # cpu flags, should solve 633900
+ #===================================================
+ -DCPU_DISPATCH=OFF
+ -DENABLE_SSE=$(usex cpu_flags_x86_sse)
+ -DENABLE_SSE2=$(usex cpu_flags_x86_sse2)
+ -DENABLE_SSE3=$(usex cpu_flags_x86_sse3)
+ -DENABLE_SSE41=$(usex cpu_flags_x86_sse4_1)
+ -DENABLE_SSE42=$(usex cpu_flags_x86_sse4_2)
+ -DENABLE_POPCNT=$(usex cpu_flags_x86_popcnt)
+ -DENABLE_AVX=$(usex cpu_flags_x86_avx)
+ -DENABLE_AVX2=$(usex cpu_flags_x86_avx2)
+ -DENABLE_FMA3=$(usex cpu_flags_x86_fma3)
+ )
+
+ # ===================================================
+ # OpenCV Contrib Modules
+ # ===================================================
+ if use contrib; then
+ GLOBALCMAKEARGS+=(
+ -DBUILD_opencv_dnn=$(usex contrib_dnn ON OFF)
+ -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
+ -DBUILD_opencv_dnns_easily_fooled=OFF
+ -DBUILD_opencv_xfeatures2d=$(usex contrib_xfeatures2d ON OFF)
+ -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF)
+ -DBUILD_opencv_hdf=$(multilib_native_usex contrib_hdf ON OFF)
+ -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF)
+ )
+
+ if multilib_is_native_abi; then
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
+ )
+ else
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
+ )
+ fi
+ fi
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
+ -DPYTHON_EXECUTABLE=OFF
+ -DINSTALL_PYTHON_EXAMPLES=OFF
+ )
+
+ cmake-utils_src_configure
+
+ # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
+ # TODO patch ocv_download to copy files into destination dirs
+ if use contrib_dnn; then
+ mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
+ cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
+ fi
+
+}
+
+python_module_compile() {
+ local BUILD_DIR=${orig_BUILD_DIR}
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
+
+ # Set all python variables to load the correct Gentoo paths
+ mycmakeargs+=(
+ # cheap trick: python_setup sets one of them as a symlink
+ # to the correct interpreter, and the other to fail-wrapper
+ -DPYTHON2_EXECUTABLE=$(type -P python2)
+ -DPYTHON3_EXECUTABLE=$(type -P python3)
+ -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
+ )
+
+ # Regenerate cache file. Can't use rebuild_cache as it won't
+ # have the Gentoo specific options.
+ rm -rf CMakeCache.txt || die "rm failed"
+ cmake-utils_src_configure
+ cmake-utils_src_compile
+ cmake-utils_src_install
+
+ # Remove compiled binary so new version compiles
+ # Avoid conflicts with new module builds as build system doesn't
+ # really support it.
+ rm -rf modules/python2 || die "rm failed"
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # Build and install the python modules for all targets
+ if multilib_is_native_abi && use python; then
+ local orig_BUILD_DIR=${BUILD_DIR}
+ python_foreach_impl python_module_compile
+ fi
+}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2018-05-31 17:24 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2018-05-31 17:24 UTC (permalink / raw
To: gentoo-commits
commit: fbadf5fc3cdc26df32995e2e1cad1ed47f40efad
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Thu May 31 17:15:58 2018 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Thu May 31 17:24:32 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbadf5fc
media-libs/opencv: workaround C compilation mode
- Add nvcc flags to fix compilation with cuda
- Fix issue with C compilation mode for vlc
- Fix python installation path
Closes: https://bugs.gentoo.org/656530
Closes: https://bugs.gentoo.org/656580
Package-Manager: Portage-2.3.24, Repoman-2.3.6
.../files/opencv-3.4.1-compilation-C-mode.patch | 56 ++++++++++++++++++++++
.../opencv-3.4.1-cuda-add-relaxed-constexpr.patch | 14 ++++++
.../opencv-3.4.1-python-lib-suffix-hack.patch | 13 +++++
...encv-3.4.1-r1.ebuild => opencv-3.4.1-r2.ebuild} | 6 ++-
4 files changed, 88 insertions(+), 1 deletion(-)
diff --git a/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch b/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch
new file mode 100644
index 00000000000..c94f206ed4f
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-compilation-C-mode.patch
@@ -0,0 +1,56 @@
+From 549b5df22520b60b91dd77096434d79425b31ac2 Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@intel.com>
+Date: Mon, 28 May 2018 18:07:23 +0300
+Subject: [PATCH] build: workaround issues with C compilation mode
+
+- cvdef.h + cvRound (double only)
+- highgui_c.h
+---
+ modules/core/include/opencv2/core/cvdef.h | 8 +++++++-
+ modules/highgui/include/opencv2/highgui/highgui_c.h | 2 ++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h
+index a87ced09d78..4ab72b34cc1 100644
+--- a/modules/core/include/opencv2/core/cvdef.h
++++ b/modules/core/include/opencv2/core/cvdef.h
+@@ -480,7 +480,7 @@ Cv64suf;
+ // Integer types portatibility
+ #ifdef OPENCV_STDINT_HEADER
+ #include OPENCV_STDINT_HEADER
+-#else
++#elif defined(__cplusplus)
+ #if defined(_MSC_VER) && _MSC_VER < 1600 /* MSVS 2010 */
+ namespace cv {
+ typedef signed char int8_t;
+@@ -517,9 +517,15 @@ typedef ::int64_t int64_t;
+ typedef ::uint64_t uint64_t;
+ }
+ #endif
++#else // pure C
++#include <stdint.h>
+ #endif
+
+
+ //! @}
+
++#ifndef __cplusplus
++#include "opencv2/core/fast_math.hpp" // define cvRound(double)
++#endif
++
+ #endif // OPENCV_CORE_CVDEF_H
+diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h
+index 1eb414a76ca..35413139c79 100644
+--- a/modules/highgui/include/opencv2/highgui/highgui_c.h
++++ b/modules/highgui/include/opencv2/highgui/highgui_c.h
+@@ -135,8 +135,10 @@ CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOS
+ CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value);
+ CVAPI(double) cvGetWindowProperty(const char* name, int prop_id);
+
++#ifdef __cplusplus // FIXIT remove in OpenCV 4.0
+ /* Get window image rectangle coordinates, width and height */
+ CVAPI(cv::Rect)cvGetWindowImageRect(const char* name);
++#endif
+
+ /* display image within window (highgui windows remember their content) */
+ CVAPI(void) cvShowImage( const char* name, const CvArr* image );
diff --git a/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch b/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch
new file mode 100644
index 00000000000..11ca6aa861e
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-cuda-add-relaxed-constexpr.patch
@@ -0,0 +1,14 @@
+diff -Naur a/cmake/FindCUDA.cmake b/cmake/FindCUDA.cmake
+--- a/cmake/FindCUDA.cmake 2018-05-26 12:57:45.698858052 +0100
++++ b/cmake/FindCUDA.cmake 2018-05-26 16:49:01.196390803 +0100
+@@ -447,8 +447,8 @@
+ # Parse HOST_COMPILATION mode.
+ option(CUDA_HOST_COMPILATION_CPP "Generated file extension" ON)
+
+-# Extra user settable flags
+-set(CUDA_NVCC_FLAGS "" CACHE STRING "Semi-colon delimit multiple arguments.")
++ #Extra user settable flags
++set(CUDA_NVCC_FLAGS "--expt-relaxed-constexpr;" CACHE STRING "Semi-colon delimit multiple arguments.")
+
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(_CUDA_MSVC_HOST_COMPILER "$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)")
diff --git a/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch b/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch
new file mode 100644
index 00000000000..248e5034a21
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-python-lib-suffix-hack.patch
@@ -0,0 +1,13 @@
+--- a/cmake/OpenCVDetectPython.cmake 2018-05-31 09:14:42.998873104 +0200
++++ b/cmake/OpenCVDetectPython.cmake 2018-05-31 09:26:08.444914001 +0200
+@@ -140,8 +140,8 @@
+ else() #debian based assumed, install to the dist-packages.
+ set(_packages_path "python${_version_major_minor}/dist-packages")
+ endif()
+- if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${${packages_path}}")
+- set(_packages_path "lib${LIB_SUFFIX}/${_packages_path}")
++ if(EXISTS "${CMAKE_INSTALL_PREFIX}/lib${LIBPY_SUFFIX}/${${packages_path}}")
++ set(_packages_path "lib${LIBPY_SUFFIX}/${_packages_path}")
+ else()
+ set(_packages_path "lib/${_packages_path}")
+ endif()
diff --git a/media-libs/opencv/opencv-3.4.1-r1.ebuild b/media-libs/opencv/opencv-3.4.1-r2.ebuild
similarity index 98%
rename from media-libs/opencv/opencv-3.4.1-r1.ebuild
rename to media-libs/opencv/opencv-3.4.1-r2.ebuild
index 578d147619a..34085a8db24 100644
--- a/media-libs/opencv/opencv-3.4.1-r1.ebuild
+++ b/media-libs/opencv/opencv-3.4.1-r2.ebuild
@@ -226,6 +226,9 @@ MULTILIB_WRAPPED_HEADERS=(
PATCHES=(
"${FILESDIR}/${PN}-3.0.0-gles.patch"
"${FILESDIR}/${PN}-3.4.0-disable-download.patch"
+ "${FILESDIR}/${P}-compilation-C-mode.patch" # https://bugs.gentoo.org/656530
+ "${FILESDIR}/${P}-python-lib-suffix-hack.patch"
+ "${FILESDIR}/${P}-cuda-add-relaxed-constexpr.patch"
)
pkg_pretend() {
@@ -400,7 +403,7 @@ multilib_src_configure() {
# ==================================================
# cpu flags, should solve 633900
#===================================================
- -DCPU_DISPATCH=OFF
+ -DCPU_DISPATCH=
-DENABLE_SSE=$(usex cpu_flags_x86_sse)
-DENABLE_SSE2=$(usex cpu_flags_x86_sse2)
-DENABLE_SSE3=$(usex cpu_flags_x86_sse3)
@@ -468,6 +471,7 @@ python_module_compile() {
-DPYTHON2_EXECUTABLE=$(type -P python2)
-DPYTHON3_EXECUTABLE=$(type -P python3)
-DINSTALL_PYTHON_EXAMPLES=$(usex examples)
+ -DLIBPY_SUFFIX=64
)
# Regenerate cache file. Can't use rebuild_cache as it won't
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2019-01-14 22:23 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2019-01-14 22:23 UTC (permalink / raw
To: gentoo-commits
commit: 9e7938189272bae00cd3da81d868cfe85748d08d
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 14 22:15:53 2019 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Mon Jan 14 22:20:23 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e793818
media-libs/opencv: patch to remove git autodetect
Closes: https://bugs.gentoo.org/672162
Signed-off-by: Amy Liffey <amynka <AT> gentoo.org>
Package-Manager: Portage-2.3.49, Repoman-2.3.11
.../files/opencv-3.4.1-remove-git-autodetect.patch | 42 ++++++++++++++++++++++
media-libs/opencv/opencv-3.4.1-r5.ebuild | 3 +-
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/media-libs/opencv/files/opencv-3.4.1-remove-git-autodetect.patch b/media-libs/opencv/files/opencv-3.4.1-remove-git-autodetect.patch
new file mode 100644
index 00000000000..94b221ab9a8
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-remove-git-autodetect.patch
@@ -0,0 +1,42 @@
+--- a/CMakeLists.txt 2019-01-10 19:29:06.831367707 +0100
++++ b/CMakeLists.txt 2019-01-10 19:30:11.125364384 +0100
+@@ -522,23 +522,23 @@
+ # ----------------------------------------------------------------------------
+ # Autodetect if we are in a GIT repository
+ # ----------------------------------------------------------------------------
+-find_host_package(Git QUIET)
++# find_host_package(Git QUIET)
+
+-if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
+- execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
+- WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
+- OUTPUT_VARIABLE OPENCV_VCSVERSION
+- RESULT_VARIABLE GIT_RESULT
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+- )
+- if(NOT GIT_RESULT EQUAL 0)
+- set(OPENCV_VCSVERSION "unknown")
+- endif()
+-elseif(NOT DEFINED OPENCV_VCSVERSION)
+- # We don't have git:
+- set(OPENCV_VCSVERSION "unknown")
+-endif()
++# if(NOT DEFINED OPENCV_VCSVERSION AND GIT_FOUND)
++# execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*"
++# WORKING_DIRECTORY "${OpenCV_SOURCE_DIR}"
++# OUTPUT_VARIABLE OPENCV_VCSVERSION
++# RESULT_VARIABLE GIT_RESULT
++# ERROR_QUIET
++# OUTPUT_STRIP_TRAILING_WHITESPACE
++# )
++# if(NOT GIT_RESULT EQUAL 0)
++# set(OPENCV_VCSVERSION "unknown")
++# endif()
++# elseif(NOT DEFINED OPENCV_VCSVERSION)
++# # We don't have git:
++# set(OPENCV_VCSVERSION "unknown")
++#endif()
+
+
+ # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/opencv-3.4.1-r5.ebuild b/media-libs/opencv/opencv-3.4.1-r5.ebuild
index b03f24a8491..569397d8555 100644
--- a/media-libs/opencv/opencv-3.4.1-r5.ebuild
+++ b/media-libs/opencv/opencv-3.4.1-r5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -230,6 +230,7 @@ PATCHES=(
"${FILESDIR}/${P}-compilation-C-mode.patch" # https://bugs.gentoo.org/656530
"${FILESDIR}/${P}-python-lib-suffix-hack.patch"
"${FILESDIR}/${P}-cuda-add-relaxed-constexpr.patch"
+ "${FILESDIR}/${P}-remove-git-autodetect.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2019-01-16 19:46 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2019-01-16 19:46 UTC (permalink / raw
To: gentoo-commits
commit: 488d9073c92dd15c8b67506993c90c595d039bee
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 16 19:30:15 2019 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Wed Jan 16 19:42:14 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=488d9073
media-libs/opencv: remove old versions 3.2.0, 3.3.0, 3.4.1-r2
Closes: https://bugs.gentoo.org/630438
Closes: https://bugs.gentoo.org/637080
Closes: https://bugs.gentoo.org/657076
Closes: https://bugs.gentoo.org/636030
Closes: https://bugs.gentoo.org/661674
Closes: https://bugs.gentoo.org/658568
Signed-off-by: Amy Liffey <amynka <AT> gentoo.org>
Package-Manager: Portage-2.3.49, Repoman-2.3.11
media-libs/opencv/Manifest | 5 -
.../files/opencv-3.1.0-find-libraries-fix.patch | 48 --
.../opencv/files/opencv-3.1.0-java-magic.patch | 47 --
...cv-3.2.0-contrib_xfeatures2d-autodownload.patch | 10 -
.../opencv/files/opencv-3.2.0-cpu-mno-sse2.patch | 11 -
.../opencv-3.2.0-fix_ussage_cpu_instructions.patch | 64 ---
media-libs/opencv/files/opencv-3.2.0-gcc-6.0.patch | 11 -
media-libs/opencv/files/opencv-3.2.0-vtk.patch | 11 -
.../files/opencv-3.3.0-contrib-xfeatures2d.patch | 19 -
.../opencv/files/opencv-3.3.0-cuda9-cmake.patch | 87 ----
.../files/opencv-3.3.0-cuda9-compute20.patch | 21 -
.../opencv/files/opencv-3.3.0-cuda9-saturate.patch | 41 --
media-libs/opencv/opencv-3.2.0-r4.ebuild | 369 ---------------
media-libs/opencv/opencv-3.3.0-r6.ebuild | 465 -------------------
media-libs/opencv/opencv-3.4.1-r2.ebuild | 497 ---------------------
15 files changed, 1706 deletions(-)
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index 9b52583151c..4cfab222a0a 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -1,9 +1,4 @@
-DIST imgcodecs-opencv-3.3.0.tar.gz 7724 BLAKE2B 0e1c931a6dd796a7fa8e4a958f9a959d3bbba9bfa636a74a22d839b2919a8e1d0843765bcb69c5fbff7156efad0db2e5b3b70a2fc6e1911c0317ba46142cc130 SHA512 9c6fc31830e299e3d15da1cfc3468fe23eecda970a02e5826e0a7cfba34200c557c0e46f940154a26e9916da05859a83376217cbe7452ec8d14e99bc76f63d37
DIST opencv-2.4.13.tar.gz 91669572 BLAKE2B 7f6be39e29c0db5d005cb14215fdf5955fa69c34d72c4f1e1fa8bf8de1e748a0d2fe5febb43296ef529c57e4dec8d1b6739c0c4df9e64657b9550ed382fbc4b9 SHA512 efdc4340fdf557dae44ac604c8c20f61ced89f99274264b61c2640f28741504462c6b57076e207040ca2513e3921275bdfbe6c22fc123bd50df78745e6b7bcd6
-DIST opencv-3.2.0.tar.gz 78861546 BLAKE2B 6d44263792b9cd2d009c7eeaddc2ef87acb01482cc9d36f2fe7717f981ff85a4e5007e4018d3ae15f383f6c3b1a0e009049f319bde0bce98575f04ccd6062cd8 SHA512 a338f4b4cdebfc2dcd763427b9c9632b3a3b0d072117b8e6367c73ea1ac21f7148553a23c7afbb44b01a48be3be95520789c2de1d6ae230b7b414ee713d3606d
-DIST opencv-3.2.0_contrib.tar.gz 54765210 BLAKE2B 6c5bcb1c18da937751f234cc1edaae58416ab9ab5a3407a2ab2c22f4e174ffeb800396d34fe489f424b288fbd608e106cd5f5b458a06a509cea5f7d8e23a67a7 SHA512 eadb6a8a3625235b0c71e29c36d15d9342278aaf9148ef6a7e1aa80f4db0491aaf30b6df16bfd0cd358402b2a3059b6acbce23fb5fe2c0c57150a733ffbbff5a
-DIST opencv-3.3.0.tar.gz 81238534 BLAKE2B 9eac7de8eefbcc9981a249343052c2dcada4e73c3406d545a89b9e6a054a7c7153933537d123f227caf51f23196fcaaed4135229db195e9c4139f2977e034e34 SHA512 13dee5c1c5fec1dccdbb05879d299b93ef8ddeb87f561a6c4178e33a4cf5ae919765119068d0387a3efea0e09a625ca993cffac60a772159690fcbee4e8d70fb
-DIST opencv-3.3.0_contrib.tar.gz 54848519 BLAKE2B 53615af19426bf7a1540a6f23c7803276d6de594260b0d87b06b6b12c9e20326925a275e31e017784e8e876e30df7b8f326e192a75c5300252ae09f50d0d9a8b SHA512 ebe3dbe6c754c6fbaabbf6b0d2a4209964e625fd68e593f30ce043792740c8c1d4440d7870949b5b33f488fd7e2e05f3752287b7f50dd24c29202e268776520e
DIST opencv-3.4.0-face_landmark_model.tar.gz 63299830 BLAKE2B 58f08cd8c030ee1c8b66e76a561fd625e112face427d001185f8d7c0eaace55adbd8474663021841a1382bfe393a210e64c51223441713cdb9156fac866a845c SHA512 2cd29ce42c08b2966db3ef4a2bc217ab3d07051819757ec6de8f3deea29e28f60abab39f101dba03f766f17018598e411bd687a7eaab0c681c113e10a2de2b23
DIST opencv-3.4.0-res10_300x300-caffeemodel.tar.gz 10036604 BLAKE2B 2a2de48fc420f13e7be146ac88f311901c5b4e409c30e466152e33cae1f8afd87dcb6d758af447c268d90bd67989c8798cd80cab172b10499a6ad5224509dbdf SHA512 96fee9f447d5739bc01a5cab37c453cf7237457dfb5d2bf93ac37f8e5aa557ac222316f449cd58e37e856abe4d8e9d4a7820daaba32f0b22cbcde8e340287d4b
DIST opencv-3.4.1.tar.gz 87051748 BLAKE2B 87c83ab9b3d7fb048263f047aa5d6e95b153e1a28f3e34cc885eff7eb080a2258cfa1aa494cd56b32f1098ab158c17c23fc8464fcbe70642a3a1842f2fd1b4ac SHA512 e1fc14285090c6fe9e26e721f2d67d7096650c523147e925567426ef76aa7f4c6f12035d6f6ce3ec7991a75a6828a810fd4f9b75f78ed5fcccecefbadd79944b
diff --git a/media-libs/opencv/files/opencv-3.1.0-find-libraries-fix.patch b/media-libs/opencv/files/opencv-3.1.0-find-libraries-fix.patch
deleted file mode 100644
index 52f4db6b311..00000000000
--- a/media-libs/opencv/files/opencv-3.1.0-find-libraries-fix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-diff -purN a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
---- a/cmake/OpenCVFindLibsGrfmt.cmake 2015-12-18 15:02:16.000000000 +0000
-+++ b/cmake/OpenCVFindLibsGrfmt.cmake 2016-11-07 13:18:04.567340791 +0000
-@@ -18,7 +18,7 @@ endif()
- if(NOT ZLIB_FOUND)
- ocv_clear_vars(ZLIB_LIBRARY ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS)
-
-- set(ZLIB_LIBRARY zlib)
-+ set(ZLIB_LIBRARY z)
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/zlib")
- set(ZLIB_INCLUDE_DIRS "${${ZLIB_LIBRARY}_SOURCE_DIR}" "${${ZLIB_LIBRARY}_BINARY_DIR}")
- set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
-@@ -40,7 +40,7 @@ if(WITH_TIFF)
- if(NOT TIFF_FOUND)
- ocv_clear_vars(TIFF_LIBRARY TIFF_LIBRARIES TIFF_INCLUDE_DIR)
-
-- set(TIFF_LIBRARY libtiff)
-+ set(TIFF_LIBRARY tiff)
- set(TIFF_LIBRARIES ${TIFF_LIBRARY})
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libtiff")
- set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}" "${${TIFF_LIBRARY}_BINARY_DIR}")
-@@ -79,7 +79,7 @@ if(WITH_JPEG)
- if(NOT JPEG_FOUND)
- ocv_clear_vars(JPEG_LIBRARY JPEG_LIBRARIES JPEG_INCLUDE_DIR)
-
-- set(JPEG_LIBRARY libjpeg)
-+ set(JPEG_LIBRARY jpeg)
- set(JPEG_LIBRARIES ${JPEG_LIBRARY})
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjpeg")
- set(JPEG_INCLUDE_DIR "${${JPEG_LIBRARY}_SOURCE_DIR}")
-@@ -136,7 +136,7 @@ if(WITH_JASPER)
- if(NOT JASPER_FOUND)
- ocv_clear_vars(JASPER_LIBRARY JASPER_LIBRARIES JASPER_INCLUDE_DIR)
-
-- set(JASPER_LIBRARY libjasper)
-+ set(JASPER_LIBRARY jasper)
- set(JASPER_LIBRARIES ${JASPER_LIBRARY})
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libjasper")
- set(JASPER_INCLUDE_DIR "${${JASPER_LIBRARY}_SOURCE_DIR}")
-@@ -169,7 +169,7 @@ if(WITH_PNG)
- if(NOT PNG_FOUND)
- ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_PNG_INCLUDE_DIR HAVE_LIBPNG_PNG_H PNG_DEFINITIONS)
-
-- set(PNG_LIBRARY libpng)
-+ set(PNG_LIBRARY png)
- set(PNG_LIBRARIES ${PNG_LIBRARY})
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libpng")
- set(PNG_INCLUDE_DIR "${${PNG_LIBRARY}_SOURCE_DIR}")
diff --git a/media-libs/opencv/files/opencv-3.1.0-java-magic.patch b/media-libs/opencv/files/opencv-3.1.0-java-magic.patch
deleted file mode 100644
index 96a0e7e7053..00000000000
--- a/media-libs/opencv/files/opencv-3.1.0-java-magic.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -purN a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt 2015-12-18 15:02:16.000000000 +0000
-+++ b/CMakeLists.txt 2016-06-06 17:15:48.006020666 +0100
-@@ -209,6 +209,7 @@ OCV_OPTION(WITH_OPENCLAMDFFT "Include
- OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT) )
- OCV_OPTION(WITH_DIRECTX "Include DirectX support" ON IF (WIN32 AND NOT WINRT) )
- OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF (WIN32 AND NOT WINRT) )
-+OCV_OPTION(WITH_JAVA "Include Java support" ON)
- OCV_OPTION(WITH_IPP_A "Include Intel IPP_A support" OFF IF (MSVC OR X86 OR X86_64) )
- OCV_OPTION(WITH_MATLAB "Include Matlab support" ON IF (NOT ANDROID AND NOT IOS AND NOT WINRT))
- OCV_OPTION(WITH_VA "Include VA support" OFF IF (UNIX AND NOT ANDROID) )
-@@ -562,20 +563,25 @@ endif(BUILD_DOCS)
- include(cmake/OpenCVDetectPython.cmake)
-
- # --- Java Support ---
--include(cmake/OpenCVDetectApacheAnt.cmake)
--if(ANDROID)
-- include(cmake/OpenCVDetectAndroidSDK.cmake)
-+If(WITH_JAVA)
-+ include(cmake/OpenCVDetectApacheAnt.cmake)
-+ if(ANDROID)
-+ include(cmake/OpenCVDetectAndroidSDK.cmake)
-
-- if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
-- message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
-+ if(NOT ANDROID_TOOLS_Pkg_Revision GREATER 13)
-+ message(WARNING "OpenCV requires Android SDK tools revision 14 or newer. Otherwise tests and samples will no be compiled.")
-+ endif()
-+ else()
-+ find_package(JNI)
- endif()
--else()
-- find_package(JNI)
--endif()
-
--if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
-- SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
-+ if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
-+ SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
-+ else()
-+ SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
-+ endif()
- else()
-+ SET(ANT_EXECUTABLE "")
- SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
- endif()
-
diff --git a/media-libs/opencv/files/opencv-3.2.0-contrib_xfeatures2d-autodownload.patch b/media-libs/opencv/files/opencv-3.2.0-contrib_xfeatures2d-autodownload.patch
deleted file mode 100644
index f03c57d425c..00000000000
--- a/media-libs/opencv/files/opencv-3.2.0-contrib_xfeatures2d-autodownload.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/modules/xfeatures2d/CMakeLists.txt 2017-02-28 13:10:56.470000000 +0100
-+++ b/modules/xfeatures2d/CMakeLists.txt 2017-02-28 13:11:03.970000000 +0100
-@@ -1,5 +1,5 @@
- set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection")
- ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml
- OPTIONAL opencv_cudaarithm WRAP python java)
--include(cmake/download_vgg.cmake)
--include(cmake/download_boostdesc.cmake)
-+#include(cmake/download_vgg.cmake)
-+#include(cmake/download_boostdesc.cmake)
diff --git a/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch b/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch
deleted file mode 100644
index a73456411f2..00000000000
--- a/media-libs/opencv/files/opencv-3.2.0-cpu-mno-sse2.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/cmake/OpenCVCompilerOptions.cmake 2017-07-22 13:26:51.178960091 +0200
-+++ b/cmake/OpenCVCompilerOptions.cmake 2017-07-22 13:27:47.238961469 +0200
-@@ -176,8 +176,6 @@
- endif()
- if(ENABLE_SSE2)
- add_extra_compiler_option(-msse2)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-sse2)
- endif()
- if(ARM)
- add_extra_compiler_option("-mfp16-format=ieee")
diff --git a/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch b/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch
deleted file mode 100644
index 7b88216f329..00000000000
--- a/media-libs/opencv/files/opencv-3.2.0-fix_ussage_cpu_instructions.patch
+++ /dev/null
@@ -1,64 +0,0 @@
---- a/cmake/OpenCVCompilerOptions.cmake
-+++ b/cmake/OpenCVCompilerOptions.cmake
-@@ -164,8 +164,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
- # Other optimizations
- if(ENABLE_OMIT_FRAME_POINTER)
- add_extra_compiler_option(-fomit-frame-pointer)
-- else()
-- add_extra_compiler_option(-fno-omit-frame-pointer)
- endif()
- if(ENABLE_FAST_MATH)
- add_extra_compiler_option(-ffast-math)
-@@ -195,8 +193,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
- if(NOT MINGW)
- if(ENABLE_AVX)
- add_extra_compiler_option(-mavx)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-avx)
- endif()
- if(ENABLE_AVX2)
- add_extra_compiler_option(-mavx2)
-@@ -210,26 +206,18 @@ if(CMAKE_COMPILER_IS_GNUCXX)
- if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
- if(ENABLE_SSE3)
- add_extra_compiler_option(-msse3)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-sse3)
- endif()
-
- if(ENABLE_SSSE3)
- add_extra_compiler_option(-mssse3)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-ssse3)
- endif()
-
- if(ENABLE_SSE41)
- add_extra_compiler_option(-msse4.1)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-sse4.1)
- endif()
-
- if(ENABLE_SSE42)
- add_extra_compiler_option(-msse4.2)
-- elseif(X86 OR X86_64)
-- add_extra_compiler_option(-mno-sse4.2)
- endif()
-
- if(ENABLE_POPCNT)
-@@ -238,16 +226,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
- endif()
- endif(NOT MINGW)
-
-- if(X86 OR X86_64)
-- if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
-- if(OPENCV_EXTRA_CXX_FLAGS MATCHES "-m(sse2|avx)")
-- add_extra_compiler_option(-mfpmath=sse)# !! important - be on the same wave with x64 compilers
-- else()
-- add_extra_compiler_option(-mfpmath=387)
-- endif()
-- endif()
-- endif()
--
- # Profiling?
- if(ENABLE_PROFILING)
- add_extra_compiler_option("-pg -g"
diff --git a/media-libs/opencv/files/opencv-3.2.0-gcc-6.0.patch b/media-libs/opencv/files/opencv-3.2.0-gcc-6.0.patch
deleted file mode 100644
index 457d3595e49..00000000000
--- a/media-libs/opencv/files/opencv-3.2.0-gcc-6.0.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/cmake/OpenCVPCHSupport.cmake 2017-06-06 15:05:09.180022719 +0200
-+++ b/cmake/OpenCVPCHSupport.cmake 2017-06-06 15:05:50.775022684 +0200
-@@ -14,7 +14,7 @@
-
- IF(CMAKE_COMPILER_IS_GNUCXX)
-
-- IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2.0")
-+ IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
- SET(PCHSupport_FOUND TRUE)
- ENDIF()
-
diff --git a/media-libs/opencv/files/opencv-3.2.0-vtk.patch b/media-libs/opencv/files/opencv-3.2.0-vtk.patch
deleted file mode 100644
index 1e3daec8aa3..00000000000
--- a/media-libs/opencv/files/opencv-3.2.0-vtk.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/cmake/OpenCVDetectVTK.cmake 2017-03-20 10:43:28.401962910 +0100
-+++ b/cmake/OpenCVDetectVTK.cmake 2017-03-20 10:43:09.127963906 +0100
-@@ -8,7 +8,7 @@
- IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var.
- find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE)
- ELSE(VTK_RENDERING_BACKEND)
-- find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
-+ find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL2 vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE)
- ENDIF(VTK_RENDERING_BACKEND)
- ENDIF(VTK_FOUND)
-
diff --git a/media-libs/opencv/files/opencv-3.3.0-contrib-xfeatures2d.patch b/media-libs/opencv/files/opencv-3.3.0-contrib-xfeatures2d.patch
deleted file mode 100644
index 26e4ac767c3..00000000000
--- a/media-libs/opencv/files/opencv-3.3.0-contrib-xfeatures2d.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/modules/xfeatures2d/CMakeLists.txt 2017-09-16 14:28:38.440000000 +0200
-+++ b/modules/xfeatures2d/CMakeLists.txt 2017-09-16 14:27:21.350000000 +0200
-@@ -2,11 +2,11 @@
-
- ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_shape opencv_cudaarithm WRAP python java)
-
-+#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_vgg.cmake)
-+#include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_boostdesc.cmake)
-+#set(DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/downloads/xfeatures2d")
-+#download_boost_descriptors("${DOWNLOAD_DIR}" boost_status)
-+#download_vgg_descriptors("${DOWNLOAD_DIR}" vgg_status)
--include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_vgg.cmake)
--include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_boostdesc.cmake)
--set(DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/downloads/xfeatures2d")
--download_boost_descriptors("${DOWNLOAD_DIR}" boost_status)
--download_vgg_descriptors("${DOWNLOAD_DIR}" vgg_status)
- if(NOT boost_status OR NOT vgg_status)
- ocv_module_disable(xfeatures2d)
- endif()
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch
deleted file mode 100644
index 270c599d708..00000000000
--- a/media-libs/opencv/files/opencv-3.3.0-cuda9-cmake.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-diff --git a/cmake/FindCUDA.cmake b/cmake/FindCUDA.cmake
-index 678b450ab..c2a58bd00 100644
---- a/cmake/FindCUDA.cmake
-+++ b/cmake/FindCUDA.cmake
-@@ -283,7 +283,38 @@
- # CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
- # Only available for CUDA version 5.5+.
- # CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
--# Only available for CUDA version 5.5+.
-+# Only available for CUDA version 5.5+ and was split up
-+# in CUDA version 8.0+ and doesn't exist in combined
-+# form in CUDA version 9.0+.
-+# CUDA_nppial_LIBRARY -- NVIDIA Performance Primatives library (arithmetic and
-+# logical operation functions). Only available for CUDA
-+# version 8.0+.
-+# CUDA_nppicc_LIBRARY -- NVIDIA Performance Primatives library (color conversion
-+# and sampling functions). Only available for CUDA version
-+# 8.0+.
-+# CUDA_nppicom_LIBRARY -- NVIDIA Performance Primatives library (JPEG compression
-+# and decompression functions). Only available for CUDA
-+# version 8.0+.
-+# CUDA_nppidei_LIBRARY -- NVIDIA Performance Primatives library (data exchange and
-+# initialization functions). Only available for CUDA
-+# version 8.0+.
-+# CUDA_nppif_LIBRARY -- NVIDIA Performance Primatives library (filtering and
-+# computer vision functions). Only available for CUDA
-+# version 8.0+.
-+# CUDA_nppig_LIBRARY -- NVIDIA Performance Primatives library (geometry
-+# transformation functions). Only available for CUDA
-+# version 8.0+.
-+# CUDA_nppim_LIBRARY -- NVIDIA Performance Primatives library (morphological
-+# operation functions). Only available for CUDA version
-+# 8.0+.
-+# CUDA_nppist_LIBRARY -- NVIDIA Performance Primatives library (statistics and
-+# linear transform). Only available for CUDA version
-+# 8.0+.
-+# CUDA_nppisu_LIBRARY -- NVIDIA Performance Primatives library (memory support
-+# functions). Only available for CUDA version 8.0+.
-+# CUDA_nppitc_LIBRARY -- NVIDIA Performance Primatives library (threshold and
-+# compare operation functions). Only available for CUDA
-+# version 8.0+.
- # CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
- # Only available for CUDA version 5.5+.
- # CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
-@@ -522,6 +553,16 @@ macro(cuda_unset_include_and_libraries)
- unset(CUDA_npp_LIBRARY CACHE)
- unset(CUDA_nppc_LIBRARY CACHE)
- unset(CUDA_nppi_LIBRARY CACHE)
-+ unset(CUDA_nppial_LIBRARY CACHE)
-+ unset(CUDA_nppicc_LIBRARY CACHE)
-+ unset(CUDA_nppicom_LIBRARY CACHE)
-+ unset(CUDA_nppidei_LIBRARY CACHE)
-+ unset(CUDA_nppif_LIBRARY CACHE)
-+ unset(CUDA_nppig_LIBRARY CACHE)
-+ unset(CUDA_nppim_LIBRARY CACHE)
-+ unset(CUDA_nppist_LIBRARY CACHE)
-+ unset(CUDA_nppisu_LIBRARY CACHE)
-+ unset(CUDA_nppitc_LIBRARY CACHE)
- unset(CUDA_npps_LIBRARY CACHE)
- unset(CUDA_nvcuvenc_LIBRARY CACHE)
- unset(CUDA_nvcuvid_LIBRARY CACHE)
-@@ -787,7 +828,22 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2")
- find_cuda_helper_libs(nvcuvid)
- endif()
- endif()
--if(CUDA_VERSION VERSION_GREATER "5.0")
-+if(CUDA_VERSION VERSION_GREATER "7.5")
-+ # In CUDA 8.0 NPP was splitted onto 12 separate libraries.
-+ find_cuda_helper_libs(nppc)
-+ find_cuda_helper_libs(nppial)
-+ find_cuda_helper_libs(nppicc)
-+ find_cuda_helper_libs(nppicom)
-+ find_cuda_helper_libs(nppidei)
-+ find_cuda_helper_libs(nppif)
-+ find_cuda_helper_libs(nppig)
-+ find_cuda_helper_libs(nppim)
-+ find_cuda_helper_libs(nppist)
-+ find_cuda_helper_libs(nppisu)
-+ find_cuda_helper_libs(nppitc)
-+ find_cuda_helper_libs(npps)
-+ set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}")
-+elseif(CUDA_VERSION VERSION_GREATER "5.0")
- # In CUDA 5.5 NPP was splitted onto 3 separate libraries.
- find_cuda_helper_libs(nppc)
- find_cuda_helper_libs(nppi)
-
-
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch
deleted file mode 100644
index 384630002d9..00000000000
--- a/media-libs/opencv/files/opencv-3.3.0-cuda9-compute20.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/cmake/OpenCVDetectCUDA.cmake 2018-01-02 11:57:50.358147518 -0500
-+++ b/cmake/OpenCVDetectCUDA.cmake 2018-01-02 12:48:44.108965500 -0500
-@@ -104,7 +104,7 @@
- if(${CUDA_VERSION} VERSION_LESS "8.0")
- set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2")
- else()
-- set(__cuda_arch_bin "2.0 3.0 3.5 3.7 5.0 5.2 6.0 6.1")
-+ set(__cuda_arch_bin "3.0 3.5 3.7 5.0 5.2 6.0 6.1")
- endif()
- endif()
- endif()
-@@ -209,7 +209,7 @@ if(CUDA_FOUND)
- endif()
-
- if(UNIX OR APPLE)
-- set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC)
-+ set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fPIC --expt-relaxed-constexpr)
- endif()
- if(APPLE)
- set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -Xcompiler -fno-finite-math-only)
-
diff --git a/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch b/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch
deleted file mode 100644
index 43e2a0833ca..00000000000
--- a/media-libs/opencv/files/opencv-3.3.0-cuda9-saturate.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/var/tmp/portage/media-libs/opencv-3.3.0-r4/work/opencv-3.3.0/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp b/./saturate_cast.hpp
-index ec9804c..4359d18 100644
---- a/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
-+++ b/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp
-@@ -47,6 +47,9 @@
- #define OPENCV_CUDEV_UTIL_SATURATE_CAST_HPP
-
- #include "../common.hpp"
-+#if __CUDACC_VER_MAJOR__ >= 9
-+#include <cuda_fp16.h>
-+#endif
-
- namespace cv { namespace cudev {
-
-@@ -274,15 +277,25 @@ template <typename T, typename D> __device__ __forceinline__ D cast_fp16(T v);
-
- template <> __device__ __forceinline__ float cast_fp16<short, float>(short v)
- {
-+#if __CUDACC_VER_MAJOR__ >= 9
-+ return float(*(__half*)&v);
-+#else
- return __half2float(v);
-+#endif
- }
-
- template <> __device__ __forceinline__ short cast_fp16<float, short>(float v)
- {
-- return (short)__float2half_rn(v);
-+#if __CUDACC_VER_MAJOR__ >= 9
-+ __half h(v);
-+ return *(short*)&v;
-+#else
-+ return (short)__float2half_rn(v);
-+#endif
- }
- //! @}
-
- }}
-
- #endif
-+
diff --git a/media-libs/opencv/opencv-3.2.0-r4.ebuild b/media-libs/opencv/opencv-3.2.0-r4.ebuild
deleted file mode 100644
index 31102b464ab..00000000000
--- a/media-libs/opencv/opencv-3.2.0-r4.ebuild
+++ /dev/null
@@ -1,369 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python{2_7,3_4,3_5} )
-
-inherit toolchain-funcs python-r1 java-pkg-opt-2 java-ant-2 \
- cmake-multilib
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- contrib? ( https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contrib_xfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-${PV}.tar.gz ) )"
-LICENSE="BSD"
-SLOT="0/3.2" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux"
-IUSE="contrib cuda debug +eigen examples ffmpeg gdal gflags glog gphoto2 gstreamer gtk ieee1394 jpeg jpeg2k lapack libav opencl openexr opengl openmp pch png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine contrib_cvv contrib_hdf contrib_sfm contrib_xfeatures2d"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it without the user knowing, which defeats the
-# purpose of the opengl use flag.
-REQUIRED_USE="
- cuda? ( tesseract? ( opencl ) )
- gflags? ( contrib )
- glog? ( contrib )
- contrib_cvv? ( contrib qt5 )
- contrib_hdf? ( contrib )
- contrib_sfm? ( contrib eigen gflags glog )
- opengl? ( || ( gtk qt5 ) )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# gtk? ( !qt5 )
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contrib_hdf? ( sci-libs/hdf5 )
- ffmpeg? (
- libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
- !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:2[${MULTILIB_USEDEP}]
- opengl? ( x11-libs/gtkglext[${MULTILIB_USEDEP}] )
- )
- ieee1394? (
- media-libs/libdc1394[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.6:* )
- jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
- lapack? ( virtual/lapack )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
- qt5? (
- dev-qt/qtgui:5
- dev-qt/qtwidgets:5
- dev-qt/qttest:5
- dev-qt/qtconcurrent:5
- opengl? ( dev-qt/qtopengl:5 )
- )
- tesseract? ( app-text/tesseract[opencl=] )
- threads? ( dev-cpp/tbb[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig[${MULTILIB_USEDEP}]
- eigen? ( dev-cpp/eigen:3 )
- java? ( >=virtual/jdk-1.6 )"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/opencv2/cvconfig.h
- /usr/include/opencv2/opencv_modules.hpp
- # [contrib_cvv]
- /usr/include/opencv2/cvv.hpp
- /usr/include/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv2/cvv/cvv.hpp
- /usr/include/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv2/cvv/dmatch.hpp
- /usr/include/opencv2/cvv/filter.hpp
- /usr/include/opencv2/cvv/final_show.hpp
- /usr/include/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv2/hdf.hpp
- /usr/include/opencv2/hdf/hdf5.hpp
- # [vtk]
- /usr/include/opencv2/viz.hpp
- /usr/include/opencv2/viz/types.hpp
- /usr/include/opencv2/viz/viz3d.hpp
- /usr/include/opencv2/viz/vizcore.hpp
- /usr/include/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv2/viz/widgets.hpp
-)
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.0.0-gles.patch"
- "${FILESDIR}/${PN}-3.1.0-java-magic.patch"
- "${FILESDIR}/${PN}-3.1.0-find-libraries-fix.patch"
- "${FILESDIR}/${P}-vtk.patch"
- "${FILESDIR}/${P}-gcc-6.0.patch"
- "${FILESDIR}/${PN}-3.2.0-fix_ussage_cpu_instructions.patch"
- "${FILESDIR}/${P}-cpu-mno-sse2.patch"
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- # remove bundled stuff
- rm -rf 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use contrib && use contrib_xfeatures2d; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- eapply "${FILESDIR}/${P}-contrib_xfeatures2d-autodownload.patch"
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # Optional 3rd party components
- # ===================================================
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk)
- -DWITH_GTK_2_X=$(usex gtk)
- -DWITH_IPP=OFF
- -DWITH_JASPER=$(usex jpeg2k)
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
-# -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=$(multilib_native_usex java)
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
- -DENABLE_OMIT_FRAME_POINTER=OFF
- -DENABLE_FAST_MATH=OFF
- -DENABLE_SSE=OFF
- -DENABLE_SSE2=OFF
- -DENABLE_SSE3=OFF
- -DENABLE_SSSE3=OFF
- -DENABLE_SSE41=OFF
- -DENABLE_SSE42=OFF
- -DENABLE_POPCNT=OFF
- -DENABLE_AVX=OFF
- -DENABLE_AVX=OFF
- -DENABLE_AVX2=OFF
- -DENABLE_FMA3=OFF
- -DENABLE_NEON=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- -DENABLE_PROFILING=OFF
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=OFF
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contrib_xfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contrib_hdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- )
-
- cmake-utils_src_configure
-}
-
-python_module_compile() {
- local BUILD_DIR=${orig_BUILD_DIR}
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # cheap trick: python_setup sets one of them as a symlink
- # to the correct interpreter, and the other to fail-wrapper
- -DPYTHON2_EXECUTABLE=$(type -P python2)
- -DPYTHON3_EXECUTABLE=$(type -P python3)
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm -rf CMakeCache.txt || die "rm failed"
- cmake-utils_src_configure
- cmake-utils_src_compile
- cmake-utils_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -rf modules/python2 || die "rm failed"
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR=${BUILD_DIR}
- python_foreach_impl python_module_compile
- fi
-}
diff --git a/media-libs/opencv/opencv-3.3.0-r6.ebuild b/media-libs/opencv/opencv-3.3.0-r6.ebuild
deleted file mode 100644
index f911f83e57e..00000000000
--- a/media-libs/opencv/opencv-3.3.0-r6.ebuild
+++ /dev/null
@@ -1,465 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
-
-inherit toolchain-funcs python-r1 java-pkg-opt-2 java-ant-2 cmake-multilib
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- https://dev.gentoo.org/~amynka/snap/imgcodecs-${P}.tar.gz
- contrib? ( https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contrib_dnn? ( https://github.com/tiny-dnn/tiny-dnn/archive/v${TINY_DNN_PV}.tar.gz -> tiny-dnn-${TINY_DNN_PV}.tar.gz )
- contrib_xfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz ) ) "
-LICENSE="BSD"
-SLOT="0/3.3" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux"
-IUSE="contrib cuda debug +eigen examples ffmpeg gdal gflags glog gphoto2 gstreamer gtk ieee1394 jpeg jpeg2k lapack libav opencl openexr opengl openmp pch png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine contrib_cvv contrib_dnn contrib_hdf contrib_sfm contrib_xfeatures2d"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it without the user knowing, which defeats the
-# purpose of the opengl use flag.
-REQUIRED_USE="
- cuda? ( tesseract? ( opencl ) )
- gflags? ( contrib )
- glog? ( contrib )
- contrib_cvv? ( contrib qt5 )
- contrib_dnn? ( contrib )
- contrib_hdf? ( contrib )
- contrib_sfm? ( contrib eigen gflags glog )
- contrib_xfeatures2d? ( contrib cuda )
- java? ( python )
- opengl? ( || ( gtk qt5 ) )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# gtk? ( !qt5 )
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contrib_hdf? ( sci-libs/hdf5 )
- ffmpeg? (
- libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
- !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:2[${MULTILIB_USEDEP}]
- opengl? ( x11-libs/gtkglext[${MULTILIB_USEDEP}] )
- )
- ieee1394? (
- media-libs/libdc1394[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.6:* )
- jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
- lapack? ( virtual/lapack )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
- qt5? (
- dev-qt/qtgui:5
- dev-qt/qtwidgets:5
- dev-qt/qttest:5
- dev-qt/qtconcurrent:5
- opengl? ( dev-qt/qtopengl:5 )
- )
- tesseract? ( app-text/tesseract[opencl=] )
- threads? ( dev-cpp/tbb[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig[${MULTILIB_USEDEP}]
- contrib_dnn? ( dev-libs/cereal )
- eigen? ( dev-cpp/eigen:3 )
- java? ( >=virtual/jdk-1.6 )"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/opencv2/cvconfig.h
- /usr/include/opencv2/opencv_modules.hpp
- # [contrib_cvv]
- /usr/include/opencv2/cvv.hpp
- /usr/include/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv2/cvv/cvv.hpp
- /usr/include/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv2/cvv/dmatch.hpp
- /usr/include/opencv2/cvv/filter.hpp
- /usr/include/opencv2/cvv/final_show.hpp
- /usr/include/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv2/hdf.hpp
- /usr/include/opencv2/hdf/hdf5.hpp
- # [vtk]
- /usr/include/opencv2/viz.hpp
- /usr/include/opencv2/viz/types.hpp
- /usr/include/opencv2/viz/viz3d.hpp
- /usr/include/opencv2/viz/vizcore.hpp
- /usr/include/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv2/viz/widgets.hpp
- # [cudev]
- /usr/include/opencv2/cudaarithm.hpp
- /usr/include/opencv2/cudabgsegm.hpp
- /usr/include/opencv2/cudacodec.hpp
- /usr/include/opencv2/cudafeatures2d.hpp
- /usr/include/opencv2/cudafilters.hpp
- /usr/include/opencv2/cudaimgproc.hpp
- /usr/include/opencv2/cudalegacy.hpp
- /usr/include/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv2/cudaobjdetect.hpp
- /usr/include/opencv2/cudaoptflow.hpp
- /usr/include/opencv2/cudastereo.hpp
- /usr/include/opencv2/cudawarping.hpp
- /usr/include/opencv2/cudev/block/block.hpp
- /usr/include/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv2/cudev/block/scan.hpp
- /usr/include/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv2/cudev/common.hpp
- /usr/include/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv2/cudev/expr/color.hpp
- /usr/include/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv2/cudev.hpp
- /usr/include/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv2/cudev/util/limits.hpp
- /usr/include/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv2/cudev/warp/warp.hpp
-)
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.0.0-gles.patch"
- "${FILESDIR}/${PN}-3.1.0-java-magic.patch"
- "${FILESDIR}/${PN}-3.1.0-find-libraries-fix.patch"
- "${WORKDIR}/${P}-imgcodecs-gcc.patch" # bug 627958 and https://github.com/opencv/opencv/pull/9376
- "${FILESDIR}/${P}-cuda9-cmake.patch"
- "${FILESDIR}/${P}-cuda9-saturate.patch"
- "${FILESDIR}/${P}-cuda9-compute20.patch"
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- # remove bundled stuff
- rm -rf 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use contrib && use contrib_dnn; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- eapply "${FILESDIR}/${P}-remove-tiny-dnn-autodownload.patch"
- fi
-
- if use contrib && use contrib_xfeatures2d; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- eapply "${FILESDIR}/${P}-contrib-xfeatures2d.patch"
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # Optional 3rd party components
- # ===================================================
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk)
- -DWITH_GTK_2_X=$(usex gtk)
- -DWITH_IPP=OFF
- -DWITH_JASPER=$(usex jpeg2k)
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
-# -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=$(multilib_native_usex java)
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contrib_dnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contrib_xfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contrib_hdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- )
-
- cmake-utils_src_configure
-}
-
-python_module_compile() {
- local BUILD_DIR=${orig_BUILD_DIR}
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # cheap trick: python_setup sets one of them as a symlink
- # to the correct interpreter, and the other to fail-wrapper
- -DPYTHON2_EXECUTABLE=$(type -P python2)
- -DPYTHON3_EXECUTABLE=$(type -P python3)
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm -rf CMakeCache.txt || die "rm failed"
- cmake-utils_src_configure
- cmake-utils_src_compile
- cmake-utils_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -rf modules/python2 || die "rm failed"
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR=${BUILD_DIR}
- python_foreach_impl python_module_compile
- fi
-}
diff --git a/media-libs/opencv/opencv-3.4.1-r2.ebuild b/media-libs/opencv/opencv-3.4.1-r2.ebuild
deleted file mode 100644
index 5da1df041fd..00000000000
--- a/media-libs/opencv/opencv-3.4.1-r2.ebuild
+++ /dev/null
@@ -1,497 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
-
-inherit java-pkg-opt-2 java-ant-2 python-r1 toolchain-funcs cmake-multilib
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- dnn_samples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
- contrib? (
- https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contrib_dnn? ( https://github.com/tiny-dnn/tiny-dnn/archive/v${TINY_DNN_PV}.tar.gz -> tiny-dnn-${TINY_DNN_PV}.tar.gz
- https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz
- )
- contrib_xfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
- )"
-
-LICENSE="BSD"
-SLOT="0/3.4.1" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux"
-IUSE="contrib contrib_cvv contrib_dnn contrib_hdf contrib_sfm contrib_xfeatures2d cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_popcnt cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_fma3 cuda debug dnn_samples +eigen examples ffmpeg gdal gflags glog gphoto2 gstreamer gtk ieee1394 jpeg jpeg2k lapack libav opencl openexr opengl openmp pch png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it Wwithout the user knowing, which defeats the
-# purpose of the opengl use flag.
-REQUIRED_USE="
- cuda? ( tesseract? ( opencl ) )
- dnn_samples? ( examples )
- gflags? ( contrib )
- glog? ( contrib )
- contrib_cvv? ( contrib qt5 )
- contrib_dnn? ( contrib )
- contrib_hdf? ( contrib )
- contrib_sfm? ( contrib eigen gflags glog )
- contrib_xfeatures2d? ( contrib cuda )
- java? ( python )
- opengl? ( || ( gtk qt5 ) )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# gtk? ( !qt5 )
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contrib_hdf? ( sci-libs/hdf5 )
- ffmpeg? (
- libav? ( media-video/libav:0=[${MULTILIB_USEDEP}] )
- !libav? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:2[${MULTILIB_USEDEP}]
- opengl? ( x11-libs/gtkglext[${MULTILIB_USEDEP}] )
- )
- ieee1394? (
- media-libs/libdc1394[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.6:* )
- jpeg? ( virtual/jpeg:0[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/jasper:=[${MULTILIB_USEDEP}] )
- lapack? ( virtual/lapack )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? ( media-libs/openexr[${MULTILIB_USEDEP}] )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? ( ${PYTHON_DEPS} dev-python/numpy[${PYTHON_USEDEP}] )
- qt5? (
- dev-qt/qtgui:5
- dev-qt/qtwidgets:5
- dev-qt/qttest:5
- dev-qt/qtconcurrent:5
- opengl? ( dev-qt/qtopengl:5 )
- )
- tesseract? ( app-text/tesseract[opencl=] )
- threads? ( dev-cpp/tbb[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:0[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- virtual/pkgconfig[${MULTILIB_USEDEP}]
- contrib_dnn? ( dev-libs/cereal )
- eigen? ( dev-cpp/eigen:3 )
- java? ( >=virtual/jdk-1.6 )"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/opencv2/cvconfig.h
- /usr/include/opencv2/opencv_modules.hpp
- # [contrib_cvv]
- /usr/include/opencv2/cvv.hpp
- /usr/include/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv2/cvv/cvv.hpp
- /usr/include/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv2/cvv/dmatch.hpp
- /usr/include/opencv2/cvv/filter.hpp
- /usr/include/opencv2/cvv/final_show.hpp
- /usr/include/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv2/hdf.hpp
- /usr/include/opencv2/hdf/hdf5.hpp
- # [vtk]
- /usr/include/opencv2/viz.hpp
- /usr/include/opencv2/viz/types.hpp
- /usr/include/opencv2/viz/viz3d.hpp
- /usr/include/opencv2/viz/vizcore.hpp
- /usr/include/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv2/viz/widgets.hpp
- # [cudev]
- /usr/include/opencv2/cudaarithm.hpp
- /usr/include/opencv2/cudabgsegm.hpp
- /usr/include/opencv2/cudacodec.hpp
- /usr/include/opencv2/cudafeatures2d.hpp
- /usr/include/opencv2/cudafilters.hpp
- /usr/include/opencv2/cudaimgproc.hpp
- /usr/include/opencv2/cudalegacy.hpp
- /usr/include/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv2/cudaobjdetect.hpp
- /usr/include/opencv2/cudaoptflow.hpp
- /usr/include/opencv2/cudastereo.hpp
- /usr/include/opencv2/cudawarping.hpp
- /usr/include/opencv2/cudev/block/block.hpp
- /usr/include/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv2/cudev/block/scan.hpp
- /usr/include/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv2/cudev/common.hpp
- /usr/include/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv2/cudev/expr/color.hpp
- /usr/include/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv2/cudev.hpp
- /usr/include/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv2/cudev/util/limits.hpp
- /usr/include/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv2/cudev/warp/warp.hpp
-)
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.0.0-gles.patch"
- "${FILESDIR}/${PN}-3.4.0-disable-download.patch"
- "${FILESDIR}/${P}-compilation-C-mode.patch" # https://bugs.gentoo.org/656530
- "${FILESDIR}/${P}-python-lib-suffix-hack.patch"
- "${FILESDIR}/${P}-cuda-add-relaxed-constexpr.patch"
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- # remove bundled stuff
- rm -rf 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use dnn_samples; then
- mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
- fi
-
- if use contrib; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.3.0-remove-tiny-dnn-autodownload.patch"
-
- if use contrib_xfeatures2d; then
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # Optional 3rd party components
- # ===================================================
- -DENABLE_DOWNLOAD=OFF
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk)
- -DWITH_GTK_2_X=$(usex gtk)
- -DWITH_IPP=OFF
- -DWITH_JASPER=$(usex jpeg2k)
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
-# -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=$(multilib_native_usex java)
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
- # to set its destination libdir
- -DLIB_SUFFIX=
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- # ==================================================
- # cpu flags, should solve 633900
- #===================================================
- -DCPU_DISPATCH=
- -DENABLE_SSE=$(usex cpu_flags_x86_sse)
- -DENABLE_SSE2=$(usex cpu_flags_x86_sse2)
- -DENABLE_SSE3=$(usex cpu_flags_x86_sse3)
- -DENABLE_SSSE3=$(usex cpu_flags_x86_ssse3)
- -DENABLE_SSE41=$(usex cpu_flags_x86_sse4_1)
- -DENABLE_SSE42=$(usex cpu_flags_x86_sse4_2)
- -DENABLE_POPCNT=$(usex cpu_flags_x86_popcnt)
- -DENABLE_AVX=$(usex cpu_flags_x86_avx)
- -DENABLE_AVX2=$(usex cpu_flags_x86_avx2)
- -DENABLE_FMA3=$(usex cpu_flags_x86_fma3)
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contrib_dnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contrib_xfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contrib_hdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- )
-
- cmake-utils_src_configure
-
- # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
- # TODO patch ocv_download to copy files into destination dirs
- if use contrib_dnn; then
- mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- fi
-
-}
-
-python_module_compile() {
- local BUILD_DIR=${orig_BUILD_DIR}
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # cheap trick: python_setup sets one of them as a symlink
- # to the correct interpreter, and the other to fail-wrapper
- -DPYTHON2_EXECUTABLE=$(type -P python2)
- -DPYTHON3_EXECUTABLE=$(type -P python3)
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- -DLIBPY_SUFFIX=64
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm -rf CMakeCache.txt || die "rm failed"
- cmake-utils_src_configure
- cmake-utils_src_compile
- cmake-utils_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -rf modules/python2 || die "rm failed"
-}
-
-multilib_src_install() {
- cmake-utils_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR=${BUILD_DIR}
- python_foreach_impl python_module_compile
- fi
-}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2019-08-10 20:15 Alexey Shvetsov
0 siblings, 0 replies; 20+ messages in thread
From: Alexey Shvetsov @ 2019-08-10 20:15 UTC (permalink / raw
To: gentoo-commits
commit: f94b3d13ae8e6a49cea026ee62d70f2b07f9d2d7
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 10 20:13:38 2019 +0000
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
CommitDate: Sat Aug 10 20:14:51 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f94b3d13
media-libs/opencv: Fix py3.7 build
Follwoup to ac064acc48d43d7bfbf12c0985c5b0667454600b
Closes: https://bugs.gentoo.org/691480
Package-Manager: Portage-2.3.71, Repoman-2.3.17
Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org>
media-libs/opencv/files/opencv-3.4.1-python37.patch | 12 ++++++++++++
media-libs/opencv/opencv-3.4.1-r6.ebuild | 1 +
2 files changed, 13 insertions(+)
diff --git a/media-libs/opencv/files/opencv-3.4.1-python37.patch b/media-libs/opencv/files/opencv-3.4.1-python37.patch
new file mode 100644
index 00000000000..94d307b748c
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-python37.patch
@@ -0,0 +1,12 @@
+diff -urN a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp
+--- a/modules/python/src2/cv2.cpp 2018-02-23 11:38:33.000000000 +0300
++++ b/modules/python/src2/cv2.cpp 2019-08-10 22:28:03.337071791 +0300
+@@ -886,7 +886,7 @@
+ (void)name;
+ if(!obj || obj == Py_None)
+ return true;
+- char* str = PyString_AsString(obj);
++ const char* str = PyString_AsString(obj);
+ if(!str)
+ return false;
+ value = String(str);
diff --git a/media-libs/opencv/opencv-3.4.1-r6.ebuild b/media-libs/opencv/opencv-3.4.1-r6.ebuild
index 2fdf2cd1f98..1f5783f9621 100644
--- a/media-libs/opencv/opencv-3.4.1-r6.ebuild
+++ b/media-libs/opencv/opencv-3.4.1-r6.ebuild
@@ -236,6 +236,7 @@ PATCHES=(
"${FILESDIR}/${P}-fix-build-with-va.patch" # bug https://bugs.gentoo.org/656576
"${FILESDIR}/${P}-popcnt.patch" # https://bugs.gentoo.org/633900
"${FILESDIR}/${P}-fix-on-x86.patch" # https://bugs.gentoo.org/682104
+ "${FILESDIR}/${P}-python37.patch" # https://bugs.gentoo.org/691480
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2019-12-07 19:39 Amy Liffey
0 siblings, 0 replies; 20+ messages in thread
From: Amy Liffey @ 2019-12-07 19:39 UTC (permalink / raw
To: gentoo-commits
commit: 432d7ed8116713d109521ea4f5ec0a9e2310feb6
Author: Amy Liffey <amynka <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 7 19:38:29 2019 +0000
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Sat Dec 7 19:38:59 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=432d7ed8
media-libs/opencv: dont try to install LICENSE.txt
Submitted-by: Helmut Jarausch <jarausch <AT> igpm.rwth-aachen.de>
Closes: https://bugs.gentoo.org/701448
Package-Manager: Portage-2.3.76, Repoman-2.3.16
Signed-off-by: Amy Liffey <amynka <AT> gentoo.org>
media-libs/opencv/files/opencv-4.1.2-opencl-license.patch | 10 ++++++++++
media-libs/opencv/opencv-4.1.2-r2.ebuild | 1 +
2 files changed, 11 insertions(+)
diff --git a/media-libs/opencv/files/opencv-4.1.2-opencl-license.patch b/media-libs/opencv/files/opencv-4.1.2-opencl-license.patch
new file mode 100644
index 00000000000..f69a88db0a4
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.1.2-opencl-license.patch
@@ -0,0 +1,10 @@
+--- a/cmake/OpenCVDetectOpenCL.cmake.ORIG 2019-11-29 11:29:00.642852106 +0100
++++ b/cmake/OpenCVDetectOpenCL.cmake 2019-11-29 11:37:57.088822546 +0100
+@@ -5,7 +5,6 @@
+ else()
+ set(OPENCL_LIBRARY "" CACHE STRING "OpenCL library")
+ set(OPENCL_INCLUDE_DIR "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/1.2" CACHE PATH "OpenCL include directory")
+- ocv_install_3rdparty_licenses(opencl-headers "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/LICENSE.txt")
+ endif()
+ mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
+
diff --git a/media-libs/opencv/opencv-4.1.2-r2.ebuild b/media-libs/opencv/opencv-4.1.2-r2.ebuild
index 5f9efaf9134..c97e2fcb3f4 100644
--- a/media-libs/opencv/opencv-4.1.2-r2.ebuild
+++ b/media-libs/opencv/opencv-4.1.2-r2.ebuild
@@ -235,6 +235,7 @@ PATCHES=(
"${FILESDIR}/${PN}-3.4.0-disable-download.patch"
"${FILESDIR}/${PN}-3.4.1-cuda-add-relaxed-constexpr.patch"
"${FILESDIR}/${P}-pkg-config-file.patch"
+ "${FILESDIR}/${P}-opencl-license.patch"
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2020-06-25 17:08 Andreas Sturmlechner
0 siblings, 0 replies; 20+ messages in thread
From: Andreas Sturmlechner @ 2020-06-25 17:08 UTC (permalink / raw
To: gentoo-commits
commit: b9d85c6578126c3592dbae8a8fc6ff6b27995e34
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 07:53:25 2020 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 17:07:43 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9d85c65
media-libs/opencv: Drop vulnerable 2.4.13-r4
Bug: https://bugs.gentoo.org/647802
Bug: https://bugs.gentoo.org/729504
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
media-libs/opencv/Manifest | 1 -
.../opencv/files/opencv-2.3.1a-libav-0.7.patch | 10 -
.../opencv/files/opencv-2.4.13-gcc-6.0.patch | 23 -
.../opencv-2.4.13-imgcodecs-refactoring.patch | 580 ---------------------
media-libs/opencv/files/opencv-2.4.2-cflags.patch | 21 -
media-libs/opencv/files/opencv-2.4.3-gcc47.patch | 22 -
.../opencv/files/opencv-2.4.8-javamagic.patch | 32 --
.../files/opencv-2.4.9-cuda-pkg-config.patch | 12 -
media-libs/opencv/opencv-2.4.13-r4.ebuild | 230 --------
9 files changed, 931 deletions(-)
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index f7ec8ef1be8..079529c915c 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -1,4 +1,3 @@
-DIST opencv-2.4.13.tar.gz 91669572 BLAKE2B 7f6be39e29c0db5d005cb14215fdf5955fa69c34d72c4f1e1fa8bf8de1e748a0d2fe5febb43296ef529c57e4dec8d1b6739c0c4df9e64657b9550ed382fbc4b9 SHA512 efdc4340fdf557dae44ac604c8c20f61ced89f99274264b61c2640f28741504462c6b57076e207040ca2513e3921275bdfbe6c22fc123bd50df78745e6b7bcd6
DIST opencv-3.4.0-face_landmark_model.tar.gz 63299830 BLAKE2B 58f08cd8c030ee1c8b66e76a561fd625e112face427d001185f8d7c0eaace55adbd8474663021841a1382bfe393a210e64c51223441713cdb9156fac866a845c SHA512 2cd29ce42c08b2966db3ef4a2bc217ab3d07051819757ec6de8f3deea29e28f60abab39f101dba03f766f17018598e411bd687a7eaab0c681c113e10a2de2b23
DIST opencv-3.4.0-res10_300x300-caffeemodel.tar.gz 10036604 BLAKE2B 2a2de48fc420f13e7be146ac88f311901c5b4e409c30e466152e33cae1f8afd87dcb6d758af447c268d90bd67989c8798cd80cab172b10499a6ad5224509dbdf SHA512 96fee9f447d5739bc01a5cab37c453cf7237457dfb5d2bf93ac37f8e5aa557ac222316f449cd58e37e856abe4d8e9d4a7820daaba32f0b22cbcde8e340287d4b
DIST opencv-3.4.1.tar.gz 87051748 BLAKE2B 87c83ab9b3d7fb048263f047aa5d6e95b153e1a28f3e34cc885eff7eb080a2258cfa1aa494cd56b32f1098ab158c17c23fc8464fcbe70642a3a1842f2fd1b4ac SHA512 e1fc14285090c6fe9e26e721f2d67d7096650c523147e925567426ef76aa7f4c6f12035d6f6ce3ec7991a75a6828a810fd4f9b75f78ed5fcccecefbadd79944b
diff --git a/media-libs/opencv/files/opencv-2.3.1a-libav-0.7.patch b/media-libs/opencv/files/opencv-2.3.1a-libav-0.7.patch
deleted file mode 100644
index 59090703d14..00000000000
--- a/media-libs/opencv/files/opencv-2.3.1a-libav-0.7.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- OpenCV-2.3.1.orig/modules/highgui/src/cap_ffmpeg_impl.hpp 2011-11-14 05:33:37.000000000 +0100
-+++ OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp 2011-11-14 05:33:18.000000000 +0100
-@@ -104,6 +104,7 @@
- #endif
- #if defined(HAVE_LIBAVCODEC_AVCODEC_H)
- #include <libavcodec/avcodec.h>
-+ #include <libavutil/mathematics.h>
- #endif
- #if defined(HAVE_LIBSWSCALE_SWSCALE_H)
- #include <libswscale/swscale.h>
diff --git a/media-libs/opencv/files/opencv-2.4.13-gcc-6.0.patch b/media-libs/opencv/files/opencv-2.4.13-gcc-6.0.patch
deleted file mode 100644
index b0a5084752c..00000000000
--- a/media-libs/opencv/files/opencv-2.4.13-gcc-6.0.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From fb598bb76a0431aa3a880ecfa45054c996a070fb Mon Sep 17 00:00:00 2001
-From: Maksim Shabunin <maksim.shabunin@itseez.com>
-Date: Fri, 13 May 2016 13:28:09 +0300
-Subject: [PATCH] Disabled PCH support for gcc >= 6.0.0
-
-Command line generation routine uses "-isystem" to include headers outside of "<opencv>/modules" folder, but GCC 6 does not work when passed "-isystem /usr/include" option.
----
- cmake/OpenCVPCHSupport.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
-index 13619daf27e..e6585cae020 100644
---- a/cmake/OpenCVPCHSupport.cmake
-+++ b/cmake/OpenCVPCHSupport.cmake
-@@ -19,7 +19,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
- ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
- OUTPUT_VARIABLE gcc_compiler_version)
- #MESSAGE("GCC Version: ${gcc_compiler_version}")
-- IF(gcc_compiler_version VERSION_GREATER "4.2.-1")
-+ IF(gcc_compiler_version VERSION_GREATER "4.2.-1" AND gcc_compiler_version VERSION_LESS "6.0.0")
- SET(PCHSupport_FOUND TRUE)
- ENDIF()
-
diff --git a/media-libs/opencv/files/opencv-2.4.13-imgcodecs-refactoring.patch b/media-libs/opencv/files/opencv-2.4.13-imgcodecs-refactoring.patch
deleted file mode 100644
index d1bea36580f..00000000000
--- a/media-libs/opencv/files/opencv-2.4.13-imgcodecs-refactoring.patch
+++ /dev/null
@@ -1,580 +0,0 @@
-From 72d29259ca741950527c8cca7fb649030c01f658 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
-Date: Tue, 15 Aug 2017 22:04:55 +0000
-Subject: [PATCH] imgcodecs: refactoring, improve code quality
-
----
- modules/core/include/opencv2/core/core.hpp | 3 +
- modules/core/include/opencv2/core/operations.hpp | 3 +
- modules/highgui/src/bitstrm.cpp | 2 +
- modules/highgui/src/bitstrm.hpp | 19 ++--
- modules/highgui/src/grfmt_bmp.cpp | 13 ++-
- modules/highgui/src/grfmt_pxm.cpp | 119 +++++++++++++---------
- modules/highgui/src/loadsave.cpp | 120 +++++++++++++++++++----
- 7 files changed, 207 insertions(+), 72 deletions(-)
-
-diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp
-index 6bb295f5c73..86f4eb182b2 100644
---- a/modules/core/include/opencv2/core/core.hpp
-+++ b/modules/core/include/opencv2/core/core.hpp
-@@ -3248,6 +3248,9 @@ template<typename _Tp, size_t fixed_size=4096/sizeof(_Tp)+8> class AutoBuffer
- //! returns read-only pointer to the real buffer, stack-allocated or head-allocated
- operator const _Tp* () const;
-
-+ //! returns number of allocated elements
-+ size_t getSize() const;
-+
- protected:
- //! pointer to the real buffer, can point to buf if the buffer is small enough
- _Tp* ptr;
-diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp
-index 1b7484aded2..37fd3d97c7a 100644
---- a/modules/core/include/opencv2/core/operations.hpp
-+++ b/modules/core/include/opencv2/core/operations.hpp
-@@ -2581,6 +2581,9 @@ template<typename _Tp, size_t fixed_size> inline AutoBuffer<_Tp, fixed_size>::op
- template<typename _Tp, size_t fixed_size> inline AutoBuffer<_Tp, fixed_size>::operator const _Tp* () const
- { return ptr; }
-
-+template<typename _Tp, size_t fixed_size> inline size_t AutoBuffer<_Tp, fixed_size>::getSize() const
-+{ return size; }
-+
-
- /////////////////////////////////// Ptr ////////////////////////////////////////
-
-diff --git a/modules/highgui/src/bitstrm.cpp b/modules/highgui/src/bitstrm.cpp
-index dd8bec87cca..67792a27f28 100644
---- a/modules/highgui/src/bitstrm.cpp
-+++ b/modules/highgui/src/bitstrm.cpp
-@@ -208,6 +208,8 @@ int RLByteStream::getByte()
- current = m_current;
- }
-
-+ CV_Assert(current < m_end);
-+
- val = *((uchar*)current);
- m_current = current + 1;
- return val;
-diff --git a/modules/highgui/src/bitstrm.hpp b/modules/highgui/src/bitstrm.hpp
-index 57956beb539..b22987bc911 100644
---- a/modules/highgui/src/bitstrm.hpp
-+++ b/modules/highgui/src/bitstrm.hpp
-@@ -48,13 +48,20 @@
- namespace cv
- {
-
--enum
--{
-- RBS_THROW_EOS=-123, // <end of stream> exception code
-- RBS_THROW_FORB=-124, // <forrbidden huffman code> exception code
-- RBS_HUFF_FORB=2047, // forrbidden huffman code "value"
-- RBS_BAD_HEADER=-125 // invalid header
-+#define DECLARE_RBS_EXCEPTION(name) \
-+class RBS_ ## name ## _Exception : public cv::Exception \
-+{ \
-+public: \
-+ RBS_ ## name ## _Exception(int code_, const String& err_, const String& func_, const String& file_, int line_) : \
-+ cv::Exception(code_, err_, func_, file_, line_) \
-+ {} \
- };
-+DECLARE_RBS_EXCEPTION(THROW_EOS)
-+#define RBS_THROW_EOS RBS_THROW_EOS_Exception(CV_StsError, "Unexpected end of input stream", CV_Func, __FILE__, __LINE__)
-+DECLARE_RBS_EXCEPTION(THROW_FORB)
-+#define RBS_THROW_FORB RBS_THROW_FORB_Exception(CV_StsError, "Forrbidden huffman code", CV_Func, __FILE__, __LINE__)
-+DECLARE_RBS_EXCEPTION(BAD_HEADER)
-+#define RBS_BAD_HEADER RBS_BAD_HEADER_Exception(CV_StsError, "Invalid header", CV_Func, __FILE__, __LINE__)
-
- typedef unsigned long ulong;
-
-diff --git a/modules/highgui/src/grfmt_bmp.cpp b/modules/highgui/src/grfmt_bmp.cpp
-index c8f8218cd3b..026b317467d 100644
---- a/modules/highgui/src/grfmt_bmp.cpp
-+++ b/modules/highgui/src/grfmt_bmp.cpp
-@@ -115,8 +115,9 @@ bool BmpDecoder::readHeader()
-
- if( m_bpp <= 8 )
- {
-- memset( m_palette, 0, sizeof(m_palette));
-- m_strm.getBytes( m_palette, (clrused == 0? 1<<m_bpp : clrused)*4 );
-+ CV_Assert(clrused < 256);
-+ memset(m_palette, 0, sizeof(m_palette));
-+ m_strm.getBytes(m_palette, (clrused == 0? 1<<m_bpp : clrused)*4 );
- iscolor = IsColorPalette( m_palette, m_bpp );
- }
- else if( m_bpp == 16 && m_rle_code == BMP_BITFIELDS )
-@@ -282,7 +283,9 @@ bool BmpDecoder::readData( Mat& img )
- else if( code > 2 ) // absolute mode
- {
- if( data + code*nch > line_end ) goto decode_rle4_bad;
-- m_strm.getBytes( src, (((code + 1)>>1) + 1) & -2 );
-+ int sz = (((code + 1)>>1) + 1) & (~1);
-+ CV_Assert((size_t)sz < _src.getSize());
-+ m_strm.getBytes(src, sz);
- if( color )
- data = FillColorRow4( data, src, code, m_palette );
- else
-@@ -371,7 +374,9 @@ decode_rle4_bad: ;
-
- if( data + code3 > line_end )
- goto decode_rle8_bad;
-- m_strm.getBytes( src, (code + 1) & -2 );
-+ int sz = (code + 1) & (~1);
-+ CV_Assert((size_t)sz < _src.getSize());
-+ m_strm.getBytes(src, sz);
- if( color )
- data = FillColorRow8( data, src, code, m_palette );
- else
-diff --git a/modules/highgui/src/grfmt_pxm.cpp b/modules/highgui/src/grfmt_pxm.cpp
-index f73bbb1bf6b..e609d165966 100644
---- a/modules/highgui/src/grfmt_pxm.cpp
-+++ b/modules/highgui/src/grfmt_pxm.cpp
-@@ -43,50 +43,58 @@
- #include "precomp.hpp"
- #include "utils.hpp"
- #include "grfmt_pxm.hpp"
-+#include <iostream>
-
- namespace cv
- {
-
- ///////////////////////// P?M reader //////////////////////////////
-
--static int ReadNumber( RLByteStream& strm, int maxdigits )
-+static int ReadNumber(RLByteStream& strm, int maxdigits = 0)
- {
- int code;
-- int val = 0;
-+ int64 val = 0;
- int digits = 0;
-
- code = strm.getByte();
-
-- if( !isdigit(code))
-+ while (!isdigit(code))
- {
-- do
-+ if (code == '#' )
- {
-- if( code == '#' )
-+ do
- {
-- do
-- {
-- code = strm.getByte();
-- }
-- while( code != '\n' && code != '\r' );
-+ code = strm.getByte();
- }
--
-+ while (code != '\n' && code != '\r');
- code = strm.getByte();
--
-- while( isspace(code))
-+ }
-+ else if (isspace(code))
-+ {
-+ while (isspace(code))
- code = strm.getByte();
- }
-- while( !isdigit( code ));
-+ else
-+ {
-+#if 1
-+ CV_Error_(CV_StsError, ("PXM: Unexpected code in ReadNumber(): 0x%x (%d)", code, code));
-+#else
-+ code = strm.getByte();
-+#endif
-+ }
- }
-
- do
- {
-- val = val*10 + code - '0';
-- if( ++digits >= maxdigits ) break;
-+ val = val*10 + (code - '0');
-+ CV_Assert(val <= INT_MAX && "PXM: ReadNumber(): result is too large");
-+ digits++;
-+ if (maxdigits != 0 && digits >= maxdigits) break;
- code = strm.getByte();
- }
-- while( isdigit(code));
-+ while (isdigit(code));
-
-- return val;
-+ return (int)val;
- }
-
-
-@@ -119,13 +127,13 @@ ImageDecoder PxMDecoder::newDecoder() const
- return new PxMDecoder;
- }
-
--void PxMDecoder::close()
-+void PxMDecoder::close()
- {
- m_strm.close();
- }
-
-
--bool PxMDecoder::readHeader()
-+bool PxMDecoder::readHeader()
- {
- bool result = false;
-
-@@ -155,10 +163,10 @@ bool PxMDecoder::readHeader()
- m_binary = code >= '4';
- m_type = m_bpp > 8 ? CV_8UC3 : CV_8UC1;
-
-- m_width = ReadNumber( m_strm, INT_MAX );
-- m_height = ReadNumber( m_strm, INT_MAX );
-+ m_width = ReadNumber(m_strm);
-+ m_height = ReadNumber(m_strm);
-
-- m_maxval = m_bpp == 1 ? 1 : ReadNumber( m_strm, INT_MAX );
-+ m_maxval = m_bpp == 1 ? 1 : ReadNumber(m_strm);
- if( m_maxval > 65535 )
- throw RBS_BAD_HEADER;
-
-@@ -172,8 +180,14 @@ bool PxMDecoder::readHeader()
- result = true;
- }
- }
-- catch(...)
-+ catch (const cv::Exception&)
- {
-+ throw;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "PXM::readHeader(): unknown C++ exception" << std::endl << std::flush;
-+ throw;
- }
-
- if( !result )
-@@ -193,27 +207,23 @@ bool PxMDecoder::readData( Mat& img )
- int step = (int)img.step;
- PaletteEntry palette[256];
- bool result = false;
-- int bit_depth = CV_ELEM_SIZE1(m_type)*8;
-- int src_pitch = (m_width*m_bpp*bit_depth/8 + 7)/8;
-+ const int bit_depth = CV_ELEM_SIZE1(m_type)*8;
-+ const int src_pitch = (m_width*m_bpp*(bit_depth/8) + 7) / 8;
-+
- int nch = CV_MAT_CN(m_type);
- int width3 = m_width*nch;
-- int i, x, y;
-
- if( m_offset < 0 || !m_strm.isOpened())
- return false;
-
-- AutoBuffer<uchar,1024> _src(src_pitch + 32);
-- uchar* src = _src;
-- AutoBuffer<uchar,1024> _gray_palette;
-- uchar* gray_palette = _gray_palette;
-+ uchar gray_palette[256] = {0};
-
- // create LUT for converting colors
- if( bit_depth == 8 )
- {
-- _gray_palette.allocate(m_maxval + 1);
-- gray_palette = _gray_palette;
-+ CV_Assert(m_maxval < 256);
-
-- for( i = 0; i <= m_maxval; i++ )
-+ for (int i = 0; i <= m_maxval; i++)
- gray_palette[i] = (uchar)((i*255/m_maxval)^(m_bpp == 1 ? 255 : 0));
-
- FillGrayPalette( palette, m_bpp==1 ? 1 : 8 , m_bpp == 1 );
-@@ -227,12 +237,16 @@ bool PxMDecoder::readData( Mat& img )
- {
- ////////////////////////// 1 BPP /////////////////////////
- case 1:
-+ CV_Assert(CV_MAT_DEPTH(m_type) == CV_8U);
- if( !m_binary )
- {
-- for( y = 0; y < m_height; y++, data += step )
-+ AutoBuffer<uchar> _src(m_width);
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += step)
- {
-- for( x = 0; x < m_width; x++ )
-- src[x] = ReadNumber( m_strm, 1 ) != 0;
-+ for (int x = 0; x < m_width; x++)
-+ src[x] = ReadNumber(m_strm, 1) != 0;
-
- if( color )
- FillColorRow8( data, src, m_width, palette );
-@@ -242,7 +256,10 @@ bool PxMDecoder::readData( Mat& img )
- }
- else
- {
-- for( y = 0; y < m_height; y++, data += step )
-+ AutoBuffer<uchar> _src(src_pitch);
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += step)
- {
- m_strm.getBytes( src, src_pitch );
-
-@@ -258,11 +275,15 @@ bool PxMDecoder::readData( Mat& img )
- ////////////////////////// 8 BPP /////////////////////////
- case 8:
- case 24:
-- for( y = 0; y < m_height; y++, data += step )
-+ {
-+ AutoBuffer<uchar> _src(std::max<size_t>(width3*2, src_pitch));
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += step)
- {
- if( !m_binary )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
- int code = ReadNumber( m_strm, INT_MAX );
- if( (unsigned)code > (unsigned)m_maxval ) code = m_maxval;
-@@ -277,7 +298,7 @@ bool PxMDecoder::readData( Mat& img )
- m_strm.getBytes( src, src_pitch );
- if( bit_depth == 16 && !isBigEndian() )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
- uchar v = src[x * 2];
- src[x * 2] = src[x * 2 + 1];
-@@ -288,7 +309,7 @@ bool PxMDecoder::readData( Mat& img )
-
- if( img.depth() == CV_8U && bit_depth == 16 )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
- int v = ((ushort *)src)[x];
- src[x] = (uchar)(v >> 8);
-@@ -329,12 +350,19 @@ bool PxMDecoder::readData( Mat& img )
- }
- result = true;
- break;
-+ }
- default:
-- assert(0);
-+ CV_Error(CV_StsError, "m_bpp is not supported");
- }
- }
-- catch(...)
-+ catch (const cv::Exception&)
-+ {
-+ throw;
-+ }
-+ catch (...)
- {
-+ std::cerr << "PXM::readData(): unknown exception" << std::endl << std::flush;
-+ throw;
- }
-
- return result;
-@@ -410,8 +438,9 @@ bool PxMEncoder::write( const Mat& img, const vector<int>& params )
- char* buffer = _buffer;
-
- // write header;
-- sprintf( buffer, "P%c\n%d %d\n%d\n",
-+ sprintf( buffer, "P%c\n# Generated by OpenCV %s\n%d %d\n%d\n",
- '2' + (channels > 1 ? 1 : 0) + (isBinary ? 3 : 0),
-+ CV_VERSION,
- width, height, (1 << depth) - 1 );
-
- strm.putBytes( buffer, (int)strlen(buffer) );
-diff --git a/modules/highgui/src/loadsave.cpp b/modules/highgui/src/loadsave.cpp
-index 81c708acdd4..9b270c900f7 100644
---- a/modules/highgui/src/loadsave.cpp
-+++ b/modules/highgui/src/loadsave.cpp
-@@ -48,12 +48,32 @@
- #undef min
- #undef max
-
-+#include <iostream>
-+
- /****************************************************************************************\
- * Image Codecs *
- \****************************************************************************************/
- namespace cv
- {
-
-+// TODO Add runtime configuration
-+#define CV_IO_MAX_IMAGE_PARAMS (50)
-+#define CV_IO_MAX_IMAGE_WIDTH (1<<20)
-+#define CV_IO_MAX_IMAGE_HEIGHT (1<<20)
-+#define CV_IO_MAX_IMAGE_PIXELS (1<<30) // 1 Gigapixel
-+
-+static Size validateInputImageSize(const Size& size)
-+{
-+ CV_Assert(size.width > 0);
-+ CV_Assert(size.width <= CV_IO_MAX_IMAGE_WIDTH);
-+ CV_Assert(size.height > 0);
-+ CV_Assert(size.height <= CV_IO_MAX_IMAGE_HEIGHT);
-+ uint64 pixels = (uint64)size.width * (uint64)size.height;
-+ CV_Assert(pixels <= CV_IO_MAX_IMAGE_PIXELS);
-+ return size;
-+}
-+
-+
- struct ImageCodecInitializer
- {
- ImageCodecInitializer()
-@@ -203,12 +223,26 @@ imread_( const string& filename, int flags, int hdrtype, Mat* mat=0 )
- if( decoder.empty() )
- return 0;
- decoder->setSource(filename);
-- if( !decoder->readHeader() )
-+
-+ try
-+ {
-+ // read the header to make sure it succeeds
-+ if (!decoder->readHeader())
-+ return 0;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
- return 0;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
-+ return 0;
-+ }
-
-- CvSize size;
-- size.width = decoder->width();
-- size.height = decoder->height();
-+
-+ Size size = validateInputImageSize(Size(decoder->width(), decoder->height()));
-
- int type = decoder->type();
- if( flags != -1 )
-@@ -242,7 +276,21 @@ imread_( const string& filename, int flags, int hdrtype, Mat* mat=0 )
- temp = cvarrToMat(image);
- }
-
-- if( !decoder->readData( *data ))
-+ bool success = false;
-+ try
-+ {
-+ if (decoder->readData(*data))
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
-+ }
-+ if (!success)
- {
- cvReleaseImage( &image );
- cvReleaseMat( &matrix );
-@@ -288,6 +336,7 @@ static bool imwrite_( const string& filename, const Mat& image,
- }
-
- encoder->setDestination( filename );
-+ CV_Assert(params.size() <= CV_IO_MAX_IMAGE_PARAMS*2);
- bool code = encoder->write( *pimage, params );
-
- // CV_Assert( code );
-@@ -326,16 +375,34 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
- decoder->setSource(filename);
- }
-
-- if( !decoder->readHeader() )
-+ bool success = false;
-+ try
- {
-- if( !filename.empty() )
-- remove(filename.c_str());
-+ if (decoder->readHeader())
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
-+ }
-+ if (!success)
-+ {
-+ if (!filename.empty())
-+ {
-+ if (0 != remove(filename.c_str()))
-+ {
-+ std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush;
-+ }
-+ }
- return 0;
- }
-
-- CvSize size;
-- size.width = decoder->width();
-- size.height = decoder->height();
-+ // established the required input image size
-+ Size size = validateInputImageSize(Size(decoder->width(), decoder->height()));
-
- int type = decoder->type();
- if( flags != -1 )
-@@ -369,11 +436,30 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
- temp = cvarrToMat(image);
- }
-
-- bool code = decoder->readData( *data );
-- if( !filename.empty() )
-- remove(filename.c_str());
-+ success = false;
-+ try
-+ {
-+ if (decoder->readData(*data))
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
-+ }
-
-- if( !code )
-+ if (!filename.empty())
-+ {
-+ if (0 != remove(filename.c_str()))
-+ {
-+ std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush;
-+ }
-+ }
-+
-+ if (!success)
- {
- cvReleaseImage( &image );
- cvReleaseMat( &matrix );
-@@ -490,7 +576,7 @@ cvSaveImage( const char* filename, const CvArr* arr, const int* _params )
- if( _params )
- {
- for( ; _params[i] > 0; i += 2 )
-- ;
-+ CV_Assert(i < CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons
- }
- return cv::imwrite_(filename, cv::cvarrToMat(arr),
- i > 0 ? cv::vector<int>(_params, _params+i) : cv::vector<int>(),
-@@ -521,7 +607,7 @@ cvEncodeImage( const char* ext, const CvArr* arr, const int* _params )
- if( _params )
- {
- for( ; _params[i] > 0; i += 2 )
-- ;
-+ CV_Assert(i < CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons
- }
- cv::Mat img = cv::cvarrToMat(arr);
- if( CV_IS_IMAGE(arr) && ((const IplImage*)arr)->origin == IPL_ORIGIN_BL )
diff --git a/media-libs/opencv/files/opencv-2.4.2-cflags.patch b/media-libs/opencv/files/opencv-2.4.2-cflags.patch
deleted file mode 100644
index d52e6b6a39f..00000000000
--- a/media-libs/opencv/files/opencv-2.4.2-cflags.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ruN OpenCV-2.4.2.orig/cmake/OpenCVCompilerOptions.cmake OpenCV-2.4.2/cmake/OpenCVCompilerOptions.cmake
---- OpenCV-2.4.2.orig/cmake/OpenCVCompilerOptions.cmake 2012-06-29 00:55:15.000000000 +0200
-+++ OpenCV-2.4.2/cmake/OpenCVCompilerOptions.cmake 2012-07-16 23:51:24.244907235 +0200
-@@ -110,17 +110,6 @@
- endif()
-
- # Other optimizations
-- if(ENABLE_OMIT_FRAME_POINTER)
-- add_extra_compiler_option(-fomit-frame-pointer)
-- else()
-- add_extra_compiler_option(-fno-omit-frame-pointer)
-- endif()
-- if(ENABLE_FAST_MATH)
-- add_extra_compiler_option(-ffast-math)
-- endif()
-- if(ENABLE_POWERPC)
-- add_extra_compiler_option("-mcpu=G3 -mtune=G5")
-- endif()
- if(ENABLE_SSE)
- add_extra_compiler_option(-msse)
- endif()
diff --git a/media-libs/opencv/files/opencv-2.4.3-gcc47.patch b/media-libs/opencv/files/opencv-2.4.3-gcc47.patch
deleted file mode 100644
index 13ac8f8fb58..00000000000
--- a/media-libs/opencv/files/opencv-2.4.3-gcc47.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -ruN OpenCV-2.4.3.orig/modules/highgui/src/grfmt_tiff.cpp OpenCV-2.4.3/modules/highgui/src/grfmt_tiff.cpp
---- OpenCV-2.4.3.orig/modules/highgui/src/grfmt_tiff.cpp 2012-10-12 00:55:12.000000000 +0200
-+++ OpenCV-2.4.3/modules/highgui/src/grfmt_tiff.cpp 2012-11-05 21:37:40.000000000 +0100
-@@ -47,6 +47,7 @@
-
- #include "precomp.hpp"
- #include "grfmt_tiff.hpp"
-+#include "unistd.h"
-
- namespace cv
- {
-diff -ruN OpenCV-2.4.3.orig/modules/highgui/src/window_QT.h OpenCV-2.4.3/modules/highgui/src/window_QT.h
---- OpenCV-2.4.3.orig/modules/highgui/src/window_QT.h 2012-10-18 00:55:38.000000000 +0200
-+++ OpenCV-2.4.3/modules/highgui/src/window_QT.h 2012-11-05 21:38:41.000000000 +0100
-@@ -41,6 +41,7 @@
- #define __OPENCV_HIGHGUI_QT_H__
-
- #include "precomp.hpp"
-+#include "unistd.h"
-
- #if defined( HAVE_QT_OPENGL )
- #include <QtOpenGL>
diff --git a/media-libs/opencv/files/opencv-2.4.8-javamagic.patch b/media-libs/opencv/files/opencv-2.4.8-javamagic.patch
deleted file mode 100644
index 766abc1e094..00000000000
--- a/media-libs/opencv/files/opencv-2.4.8-javamagic.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -ruN opencv-2.4.8.orig/CMakeLists.txt opencv-2.4.8/CMakeLists.txt
---- opencv-2.4.8.orig/CMakeLists.txt 2013-12-27 18:09:18.000000000 +0100
-+++ opencv-2.4.8/CMakeLists.txt 2014-01-24 22:06:12.000000000 +0100
-@@ -164,6 +164,7 @@
- OCV_OPTION(WITH_OPENCLAMDFFT "Include AMD OpenCL FFT library support" ON IF (NOT ANDROID AND NOT IOS) )
- OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" ON IF (NOT ANDROID AND NOT IOS) )
- OCV_OPTION(WITH_INTELPERC "Include Intel Perceptual Computing support" OFF IF WIN32 )
-+OCV_OPTION(WITH_JAVA "Include Java support" ON)
-
- # OpenCV build components
- # ===================================================
-@@ -449,6 +450,8 @@
- include(cmake/OpenCVDetectPython.cmake)
-
- # --- Java Support ---
-+if(WITH_JAVA)
-+
- include(cmake/OpenCVDetectApacheAnt.cmake)
- if(ANDROID)
- include(cmake/OpenCVDetectAndroidSDK.cmake)
-@@ -466,6 +469,11 @@
- SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
- endif()
-
-+else()
-+ SET(ANT_EXECUTABLE "")
-+ SET(CAN_BUILD_ANDROID_PROJECTS FALSE)
-+endif()
-+
- # --- OpenCL ---
- if(WITH_OPENCL)
- include(cmake/OpenCVDetectOpenCL.cmake)
diff --git a/media-libs/opencv/files/opencv-2.4.9-cuda-pkg-config.patch b/media-libs/opencv/files/opencv-2.4.9-cuda-pkg-config.patch
deleted file mode 100644
index d7ff3c7eaf6..00000000000
--- a/media-libs/opencv/files/opencv-2.4.9-cuda-pkg-config.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -528,6 +528,9 @@
- if(HAVE_CUFFT)
- set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${CUDA_cufft_LIBRARY})
- endif()
-+ foreach(p ${CUDA_LIBS_PATH})
-+ set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} -L${p})
-+ endforeach()
- endif()
-
- # ----------------------------------------------------------------------------
diff --git a/media-libs/opencv/opencv-2.4.13-r4.ebuild b/media-libs/opencv/opencv-2.4.13-r4.ebuild
deleted file mode 100644
index 1e5584759aa..00000000000
--- a/media-libs/opencv/opencv-2.4.13-r4.ebuild
+++ /dev/null
@@ -1,230 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-
-inherit toolchain-funcs cmake-utils python-single-r1 java-pkg-opt-2 java-ant-2
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-
-SRC_URI="https://github.com/Itseez/opencv/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0/2.4"
-KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86 ~amd64-linux"
-IUSE="cuda +eigen examples ffmpeg gstreamer gtk ieee1394 jpeg opencl openexr opengl openmp pch png +python qt5 testprograms threads tiff v4l vtk xine"
-
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# gtk? ( !qt4 )
-# opengl? ( || ( gtk qt4 ) )
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2
- sys-libs/zlib
- cuda? ( >=dev-util/nvidia-cuda-toolkit-5.5 )
- ffmpeg? ( media-video/ffmpeg:0= )
- gstreamer? (
- media-libs/gstreamer:1.0
- media-libs/gst-plugins-base:1.0
- )
- gtk? (
- dev-libs/glib:2
- x11-libs/gtk+:2
- opengl? ( x11-libs/gtkglext )
- )
- java? ( >=virtual/jre-1.6:* )
- jpeg? ( virtual/jpeg:0 )
- ieee1394? (
- media-libs/libdc1394
- sys-libs/libraw1394
- )
- opencl? ( virtual/opencl )
- openexr? ( media-libs/openexr )
- opengl? ( virtual/opengl virtual/glu )
- png? ( media-libs/libpng:0= )
- python? (
- ${PYTHON_DEPS}
- $(python_gen_cond_dep '
- || (
- dev-python/numpy-python2[${PYTHON_MULTI_USEDEP}]
- dev-python/numpy[${PYTHON_MULTI_USEDEP}]
- )
- ')
- )
- qt5? (
- dev-qt/qtconcurrent:5
- dev-qt/qtcore:5
- dev-qt/qtgui:5
- dev-qt/qttest:5
- opengl? ( dev-qt/qtopengl:5 )
- )
- threads? ( dev-cpp/tbb )
- tiff? ( media-libs/tiff:0 )
- v4l? ( >=media-libs/libv4l-0.8.3 )
- vtk? ( sci-libs/vtk[rendering] )
- xine? ( media-libs/xine-lib )
-"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- eigen? ( dev-cpp/eigen:3 )
- java? ( >=virtual/jdk-1.6 )
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-2.3.1a-libav-0.7.patch"
- "${FILESDIR}/${PN}-2.4.3-gcc47.patch"
- "${FILESDIR}/${PN}-2.4.2-cflags.patch"
- "${FILESDIR}/${PN}-2.4.8-javamagic.patch"
- "${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch"
- "${FILESDIR}/${PN}-3.0.0-gles.patch"
- "${FILESDIR}/${P}-gcc-6.0.patch"
- "${FILESDIR}/${P}-imgcodecs-refactoring.patch" #bug 627958
-)
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- use python && python-single-r1_pkg_setup
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- cmake-utils_src_prepare
-
- # remove bundled stuff
- rm -rf 3rdparty || die "Removing 3rd party components failed"
- sed -i \
- -e '/add_subdirectory(3rdparty)/ d' \
- CMakeLists.txt || die
-
- java-pkg-opt-2_src_prepare
-}
-
-src_configure() {
-
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-
- # please dont sort here, order is the same as in CMakeLists.txt
- local mycmakeargs=(
- # the optinal dependency libraries
- -DWITH_1394=$(usex ieee1394)
- -DWITH_AVFOUNDATION=OFF
- -DWITH_VTK=$(usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF
- -DWITH_GTK=$(usex gtk)
- -DWITH_IMAGEIO=OFF
- -DWITH_IPP=OFF
- -DWITH_JASPER=OFF
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_OPENEXR=$(usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENNI=OFF
- -DWITH_PNG=$(usex png)
- -DWITH_PVAPI=OFF
- -DWITH_QT=$(usex qt5 5 OFF)
- -DWITH_GIGEAPI=OFF
- -DWITH_WIN32UI=OFF
- -DWITH_QUICKTIME=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- -DWITH_DSHOW=ON
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF
- -DWITH_XINE=$(usex xine)
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_INTELPERC=OFF
- -DWITH_JAVA=$(usex java)
-
- # the build components
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_DOCS=OFF #too much dark magic in cmakelists
- -DBUILD_EXAMPLES=$(usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(usex testprograms)
-
- # install examples
- -DINSTALL_C_EXAMPLES=$(usex examples)
- -DINSTALL_TESTS=$(usex testprograms)
-
- # build options
- -DENABLE_PRECOMPILED_HEADERS=$(usex pch)
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
- -DENABLE_OMIT_FRAME_POINTER=OFF
- -DENABLE_FAST_MATH=OFF #
- -DENABLE_SSE=OFF # these options do nothing but
- -DENABLE_SSE2=OFF # add params to CFLAGS
- -DENABLE_SSE3=OFF
- -DENABLE_SSSE3=OFF
- -DENABLE_SSE41=OFF
- -DENABLE_SSE42=OFF
-
- -DOPENCV_EXTRA_FLAGS_RELEASE="" # black magic
- )
-
- if use cuda; then
- if [[ "$(gcc-version)" > "4.8" ]]; then
- # bug 577410
- # #error -- unsupported GNU version! gcc 4.9 and up are not supported!
- ewarn "CUDA and >=sys-devel/gcc-4.9 do not play well together. Disabling CUDA support."
- mycmakeargs+=( -DWITH_CUDA=OFF )
- mycmakeargs+=( -DWITH_CUBLAS=OFF )
- mycmakeargs+=( -DWITH_CUFFT=OFF )
-
- else
- mycmakeargs+=( -DWITH_CUDA=ON )
- mycmakeargs+=( -DWITH_CUBLAS=ON )
- mycmakeargs+=( -DWITH_CUFFT=ON )
- mycmakeargs+=( -DCUDA_NPP_LIBRARY_ROOT_DIR=/opt/cuda )
- fi
- else
- mycmakeargs+=( -DWITH_CUDA=OFF )
- mycmakeargs+=( -DWITH_CUBLAS=OFF )
- mycmakeargs+=( -DWITH_CUFFT=OFF )
- fi
-
- if use examples && use python; then
- mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=ON )
- else
- mycmakeargs+=( -DINSTALL_PYTHON_EXAMPLES=OFF )
- fi
-
- # things we want to be hard off or not yet figured out
- mycmakeargs+=(
- -DOPENCV_BUILD_3RDPARTY_LIBS=OFF
- -DBUILD_PACKAGE=OFF
- )
-
- # things we want to be hard enabled not worth useflag
- mycmakeargs+=(
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- )
-
- # workaround for bug 413429
- tc-export CC CXX
-
- cmake-utils_src_configure
-}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2021-12-03 0:54 Sam James
0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2021-12-03 0:54 UTC (permalink / raw
To: gentoo-commits
commit: c6f83216c443b41bcb26be6e8f139005310ce42b
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 3 00:46:42 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 3 00:53:41 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6f83216
media-libs/opencv: add lapack patch
Closes: https://bugs.gentoo.org/800539
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../opencv/files/opencv-4.5.2-lapack-3.10.patch | 123 +++++++++++++++++++++
media-libs/opencv/opencv-4.5.2-r5.ebuild | 3 +-
media-libs/opencv/opencv-4.5.4.ebuild | 3 +-
3 files changed, 127 insertions(+), 2 deletions(-)
diff --git a/media-libs/opencv/files/opencv-4.5.2-lapack-3.10.patch b/media-libs/opencv/files/opencv-4.5.2-lapack-3.10.patch
new file mode 100644
index 000000000000..31e2fc60d121
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.5.2-lapack-3.10.patch
@@ -0,0 +1,123 @@
+https://bugs.gentoo.org/800539
+
+--- a/modules/core/src/hal_internal.cpp
++++ b/modules/core/src/hal_internal.cpp
+@@ -163,9 +163,9 @@
+ if(n == 1 && b_step == sizeof(fptype))
+ {
+ if(typeid(fptype) == typeid(float))
+- sposv_(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
++ LAPACK_sposv_(L, &m, &n, (float*)a, &lda, (float*)b, &m, &lapackStatus);
+ else if(typeid(fptype) == typeid(double))
+- dposv_(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
++ LAPACK_dposv_(L, &m, &n, (double*)a, &lda, (double*)b, &m, &lapackStatus);
+ }
+ else
+ {
+@@ -174,9 +174,9 @@
+ transpose(b, ldb, tmpB, m, m, n);
+
+ if(typeid(fptype) == typeid(float))
+- sposv_(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
++ LAPACK_sposv_(L, &m, &n, (float*)a, &lda, (float*)tmpB, &m, &lapackStatus);
+ else if(typeid(fptype) == typeid(double))
+- dposv_(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);
++ LAPACK_dposv_(L, &m, &n, (double*)a, &lda, (double*)tmpB, &m, &lapackStatus);
+
+ transpose(tmpB, m, b, ldb, n, m);
+ delete[] tmpB;
+@@ -185,9 +185,9 @@
+ else
+ {
+ if(typeid(fptype) == typeid(float))
+- spotrf_(L, &m, (float*)a, &lda, &lapackStatus);
++ LAPACK_spotrf_(L, &m, (float*)a, &lda, &lapackStatus);
+ else if(typeid(fptype) == typeid(double))
+- dpotrf_(L, &m, (double*)a, &lda, &lapackStatus);
++ LAPACK_dpotrf_(L, &m, (double*)a, &lda, &lapackStatus);
+ }
+
+ if(lapackStatus == 0) *info = true;
+@@ -227,17 +227,17 @@
+ }
+
+ if(typeid(fptype) == typeid(float))
+- sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
++ LAPACK_sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)&work1, &lwork, iworkBuf, info);
+ else if(typeid(fptype) == typeid(double))
+- dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);
++ LAPACK_dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)&work1, &lwork, iworkBuf, info);
+
+ lwork = (int)round(work1); //optimal buffer size
+ fptype* buffer = new fptype[lwork + 1];
+
+ if(typeid(fptype) == typeid(float))
+- sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
++ LAPACK_sgesdd_(mode, &m, &n, (float*)a, &lda, (float*)w, (float*)u, &ldu, (float*)vt, &ldv, (float*)buffer, &lwork, iworkBuf, info);
+ else if(typeid(fptype) == typeid(double))
+- dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);
++ LAPACK_dgesdd_(mode, &m, &n, (double*)a, &lda, (double*)w, (double*)u, &ldu, (double*)vt, &ldv, (double*)buffer, &lwork, iworkBuf, info);
+
+ if(!(flags & CV_HAL_SVD_NO_UV))
+ transpose_square_inplace(vt, ldv, n);
+@@ -288,18 +288,18 @@
+ if (k == 1 && b_step == sizeof(fptype))
+ {
+ if (typeid(fptype) == typeid(float))
+- sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
++ LAPACK_sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)&work1, &lwork, info);
+ else if (typeid(fptype) == typeid(double))
+- dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);
++ LAPACK_dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)&work1, &lwork, info);
+
+ lwork = cvRound(work1); //optimal buffer size
+ std::vector<fptype> workBufMemHolder(lwork + 1);
+ fptype* buffer = &workBufMemHolder.front();
+
+ if (typeid(fptype) == typeid(float))
+- sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
++ LAPACK_sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)b, &m, (float*)buffer, &lwork, info);
+ else if (typeid(fptype) == typeid(double))
+- dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
++ LAPACK_dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)b, &m, (double*)buffer, &lwork, info);
+ }
+ else
+ {
+@@ -309,18 +309,18 @@
+ transpose(b, ldb, tmpB, m, m, k);
+
+ if (typeid(fptype) == typeid(float))
+- sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
++ LAPACK_sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)&work1, &lwork, info);
+ else if (typeid(fptype) == typeid(double))
+- dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);
++ LAPACK_dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)&work1, &lwork, info);
+
+ lwork = cvRound(work1); //optimal buffer size
+ std::vector<fptype> workBufMemHolder(lwork + 1);
+ fptype* buffer = &workBufMemHolder.front();
+
+ if (typeid(fptype) == typeid(float))
+- sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
++ LAPACK_sgels_(mode, &m, &n, &k, (float*)tmpA, &ldtmpA, (float*)tmpB, &m, (float*)buffer, &lwork, info);
+ else if (typeid(fptype) == typeid(double))
+- dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);
++ LAPACK_dgels_(mode, &m, &n, &k, (double*)tmpA, &ldtmpA, (double*)tmpB, &m, (double*)buffer, &lwork, info);
+
+ transpose(tmpB, m, b, ldb, k, m);
+ }
+--- a/cmake/checks/lapack_check.cpp
++++ b/cmake/checks/lapack_check.cpp
+@@ -2,9 +2,9 @@
+ #include "opencv_lapack.h"
+
+ static char* check_fn1 = (char*)sgesv_;
+-static char* check_fn2 = (char*)sposv_;
+-static char* check_fn3 = (char*)spotrf_;
+-static char* check_fn4 = (char*)sgesdd_;
++static char* check_fn2 = (char*)LAPACK_sposv_;
++static char* check_fn3 = (char*)LAPACK_spotrf_;
++static char* check_fn4 = (char*)LAPACK_sgesdd_;
+
+ int main(int argc, char* argv[])
+ {
diff --git a/media-libs/opencv/opencv-4.5.2-r5.ebuild b/media-libs/opencv/opencv-4.5.2-r5.ebuild
index 773e61c6fb4a..12f8c7f34e77 100644
--- a/media-libs/opencv/opencv-4.5.2-r5.ebuild
+++ b/media-libs/opencv/opencv-4.5.2-r5.ebuild
@@ -118,7 +118,7 @@ RDEPEND="
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
lapack? (
virtual/cblas
- virtual/lapack
+ >=virtual/lapack-3.10
)
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
openexr? ( <media-libs/openexr-3.0.0:0=[${MULTILIB_USEDEP}] )
@@ -283,6 +283,7 @@ PATCHES=(
"${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
+ "${FILESDIR}"/${PN}-4.5.2-lapack-3.10.patch
)
pkg_pretend() {
diff --git a/media-libs/opencv/opencv-4.5.4.ebuild b/media-libs/opencv/opencv-4.5.4.ebuild
index c4bd53d72d71..ca4d84d5a815 100644
--- a/media-libs/opencv/opencv-4.5.4.ebuild
+++ b/media-libs/opencv/opencv-4.5.4.ebuild
@@ -118,7 +118,7 @@ RDEPEND="
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
lapack? (
virtual/cblas
- virtual/lapack
+ >=virtual/lapack-3.10
)
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
openexr? ( <media-libs/openexr-3.0.0:0=[${MULTILIB_USEDEP}] )
@@ -283,6 +283,7 @@ PATCHES=(
"${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
+ "${FILESDIR}"/${PN}-4.5.2-lapack-3.10.patch
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2022-10-15 0:44 Sam James
0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2022-10-15 0:44 UTC (permalink / raw
To: gentoo-commits
commit: 2df30a8bd2f70b44639ed94b5ff8b1680944dae1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 15 00:44:35 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Oct 15 00:44:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2df30a8b
media-libs/opencv: fix build with ffmpeg 5
Closes: https://bugs.gentoo.org/876748
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch | 19 +++++++++++++++++++
media-libs/opencv/opencv-4.6.0-r2.ebuild | 1 +
2 files changed, 20 insertions(+)
diff --git a/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch b/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch
new file mode 100644
index 000000000000..557576a8747a
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch
@@ -0,0 +1,19 @@
+https://github.com/opencv/opencv/issues/22418
+https://github.com/opencv/opencv/commit/496eed950f6d0e7fd92619d47e3cec8f06e96ace
+https://bugs.gentoo.org/876748
+
+From: Jochen Sprickerhof <jspricke@debian.org>
+Date: Mon, 8 Aug 2022 21:10:13 +0200
+Subject: [PATCH] Add missing header for LIBAVCODEC_VERSION_INT
+
+--- a/modules/videoio/src/ffmpeg_codecs.hpp
++++ b/modules/videoio/src/ffmpeg_codecs.hpp
+@@ -60,6 +60,7 @@ extern "C" {
+ #include <errno.h>
+ #endif
+
++#include <libavcodec/version.h>
+ #include <libavformat/avformat.h>
+
+ #ifdef __cplusplus
+
diff --git a/media-libs/opencv/opencv-4.6.0-r2.ebuild b/media-libs/opencv/opencv-4.6.0-r2.ebuild
index a02ff7760364..4f475dc6f45e 100644
--- a/media-libs/opencv/opencv-4.6.0-r2.ebuild
+++ b/media-libs/opencv/opencv-4.6.0-r2.ebuild
@@ -291,6 +291,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-4.4.0-disable-native-cpuflag-detect.patch
"${FILESDIR}"/${PN}-4.5.0-link-with-cblas-for-lapack.patch
"${FILESDIR}"/${P}-fix-build-examples.patch # bug 830163, pending upstream PR #22245
+ "${FILESDIR}"/${P}-fix-ffmpeg-5.patch
)
pkg_pretend() {
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2023-08-24 22:37 Sam James
0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2023-08-24 22:37 UTC (permalink / raw
To: gentoo-commits
commit: 83451b512b473dd0484daaa6c7eff4a4f26c15b9
Author: Huang Rui <vowstar <AT> gmail <DOT> com>
AuthorDate: Thu Aug 24 08:01:27 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 24 22:35:40 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83451b51
media-libs/opencv: fix build problem with contribdnn
- support tflite import with contribdnn
- add dev-libs/flatbuffers RDEPEND and fix build problem
- fix protobuf 23.3 build problem with contribdnn
Closes: https://bugs.gentoo.org/912788
Signed-off-by: Huang Rui <vowstar <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32429
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../opencv/files/opencv-4.8.0-fix-flatbuffer.patch | 31 ++
.../opencv/files/opencv-4.8.0-fix-protobuf.patch | 20 +
media-libs/opencv/opencv-4.8.0-r1.ebuild | 588 +++++++++++++++++++++
3 files changed, 639 insertions(+)
diff --git a/media-libs/opencv/files/opencv-4.8.0-fix-flatbuffer.patch b/media-libs/opencv/files/opencv-4.8.0-fix-flatbuffer.patch
new file mode 100644
index 000000000000..395f0998a3b9
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.8.0-fix-flatbuffer.patch
@@ -0,0 +1,31 @@
+--- a/modules/dnn/misc/tflite/schema_generated.h 2023-06-28 19:53:33.000000000 +0800
++++ b/modules/dnn/misc/tflite/schema_generated.h 2023-08-24 15:17:19.594480034 +0800
+@@ -8,9 +8,9 @@
+
+ // Ensure the included flatbuffers.h is the same version as when this file was
+ // generated, otherwise it may not be compatible.
+-static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
+- FLATBUFFERS_VERSION_MINOR == 5 &&
+- FLATBUFFERS_VERSION_REVISION == 9,
++static_assert(FLATBUFFERS_VERSION_MAJOR == FLATBUFFERS_VERSION_MAJOR &&
++ FLATBUFFERS_VERSION_MINOR == FLATBUFFERS_VERSION_MINOR &&
++ FLATBUFFERS_VERSION_REVISION == FLATBUFFERS_VERSION_REVISION,
+ "Non-compatible flatbuffers version included");
+
+ namespace opencv_tflite {
+--- a/cmake/OpenCVDetectFlatbuffers.cmake 2023-08-24 15:31:50.129947159 +0800
++++ b/cmake/OpenCVDetectFlatbuffers.cmake 2023-08-24 15:36:15.176705845 +0800
+@@ -1,9 +1,9 @@
+ if(WITH_FLATBUFFERS)
+ set(HAVE_FLATBUFFERS 1)
+- set(flatbuffers_VERSION "23.5.9")
+- ocv_install_3rdparty_licenses(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/LICENSE.txt")
+- ocv_add_external_target(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/include" "" "HAVE_FLATBUFFERS=1")
+- set(CUSTOM_STATUS_flatbuffers " Flatbuffers:" "builtin/3rdparty (${flatbuffers_VERSION})")
++ #set(flatbuffers_VERSION "23.5.9")
++ #ocv_install_3rdparty_licenses(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/LICENSE.txt")
++ #ocv_add_external_target(flatbuffers "${OpenCV_SOURCE_DIR}/3rdparty/flatbuffers/include" "" "HAVE_FLATBUFFERS=1")
++ #set(CUSTOM_STATUS_flatbuffers " Flatbuffers:" "builtin/3rdparty (${flatbuffers_VERSION})")
+ endif()
+
+ if(WITH_FLATBUFFERS OR HAVE_FLATBUFFERS)
diff --git a/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch b/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch
new file mode 100644
index 000000000000..937e00e0c024
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch
@@ -0,0 +1,20 @@
+--- a/cmake/OpenCVFindProtobuf.cmake
++++ b/cmake/OpenCVFindProtobuf.cmake
+@@ -31,7 +31,7 @@ if(BUILD_PROTOBUF)
+ set(HAVE_PROTOBUF TRUE)
+ else()
+ unset(Protobuf_VERSION CACHE)
+- find_package(Protobuf QUIET)
++ find_package(protobuf)
+
+ # Backwards compatibility
+ # Define camel case versions of input variables
+@@ -50,7 +50,7 @@ else()
+ endforeach()
+ # end of compatibility block
+
+- if(Protobuf_FOUND)
++ if(protobuf_FOUND)
+ if(TARGET protobuf::libprotobuf)
+ set(Protobuf_LIBRARIES "protobuf::libprotobuf")
+ else()
diff --git a/media-libs/opencv/opencv-4.8.0-r1.ebuild b/media-libs/opencv/opencv-4.8.0-r1.ebuild
new file mode 100644
index 000000000000..e4cc0a689fed
--- /dev/null
+++ b/media-libs/opencv/opencv-4.8.0-r1.ebuild
@@ -0,0 +1,588 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+inherit flag-o-matic java-pkg-opt-2 java-ant-2 cmake-multilib python-r1 toolchain-funcs
+
+DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
+HOMEPAGE="https://opencv.org"
+TINY_DNN_PV="1.0.0a3"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+ dnnsamples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
+ download? ( https://github.com/rossbridger/opencv-extdep/archive/4.4.0.tar.gz -> ${PN}-4.4.0_extdep.tar.gz )
+ contrib? (
+ https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
+ contribdnn? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz )
+ contribxfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
+ )"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}" # subslot = libopencv* soname version
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d cuda debug dnnsamples download +eigen examples +features2d ffmpeg gdal gflags glog gphoto2 gstreamer gtk3 ieee1394 jpeg jpeg2k lapack lto opencl openexr opengl openmp opencvapps png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
+
+# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications
+ARM_CPU_FEATURES=(
+ cpu_flags_arm_neon:NEON
+ cpu_flags_arm_vfpv3:VFPV3
+)
+PPC_CPU_FEATURES=(
+ cpu_flags_ppc_vsx:VSX
+ cpu_flags_ppc_vsx3:VSX3
+)
+X86_CPU_FEATURES_RAW=(
+ avx:AVX
+ avx2:AVX2
+ avx512f:AVX_512F
+ f16c:FP16
+ fma3:FMA3
+ popcnt:POPCNT
+ sse:SSE
+ sse2:SSE2
+ sse3:SSE3
+ ssse3:SSSE3
+ sse4_1:SSE4_1
+ sse4_2:SSE4_2
+)
+X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
+CPU_FEATURES_MAP=(
+ ${ARM_CPU_FEATURES[@]}
+ ${PPC_CPU_FEATURES[@]}
+ ${X86_CPU_FEATURES[@]}
+)
+IUSE="${IUSE} ${CPU_FEATURES_MAP[@]%:*}"
+
+# OpenGL needs gtk or Qt installed to activate, otherwise build system
+# will silently disable it Wwithout the user knowing, which defeats the
+# purpose of the opengl use flag.
+# cuda needs contrib, bug #701712
+REQUIRED_USE="
+ cpu_flags_x86_avx2? ( cpu_flags_x86_f16c )
+ cpu_flags_x86_f16c? ( cpu_flags_x86_avx )
+ cuda? ( contrib
+ tesseract? ( opencl ) )
+ dnnsamples? ( examples )
+ gflags? ( contrib )
+ glog? ( contrib )
+ contribcvv? ( contrib qt5 )
+ contribdnn? ( contrib )
+ contribfreetype? ( contrib )
+ contribhdf? ( contrib )
+ contribovis? ( contrib )
+ contribsfm? ( contrib eigen gflags glog )
+ contribxfeatures2d? ( contrib download )
+ examples? ( contribdnn )
+ java? ( python )
+ opengl? ( qt5 )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ tesseract? ( contrib )
+ ?? ( gtk3 qt5 )"
+
+# The following logic is intrinsic in the build system, but we do not enforce
+# it on the useflags since this just blocks emerging pointlessly:
+# openmp? ( !threads )
+
+RDEPEND="
+ app-arch/bzip2[${MULTILIB_USEDEP}]
+ dev-libs/protobuf:=[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ cuda? ( dev-util/nvidia-cuda-toolkit:0= )
+ contribdnn? ( dev-libs/flatbuffers:= )
+ contribhdf? ( sci-libs/hdf5:= )
+ contribfreetype? (
+ media-libs/freetype:2[${MULTILIB_USEDEP}]
+ media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
+ )
+ contribovis? ( dev-games/ogre:0/1.12 )
+ ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
+ gdal? ( sci-libs/gdal:= )
+ gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
+ glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+ media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
+ )
+ gtk3? (
+ dev-libs/glib:2[${MULTILIB_USEDEP}]
+ x11-libs/gtk+:3[${MULTILIB_USEDEP}]
+ )
+ ieee1394? (
+ media-libs/libdc1394:=[${MULTILIB_USEDEP}]
+ sys-libs/libraw1394[${MULTILIB_USEDEP}]
+ )
+ java? ( >=virtual/jre-1.8:* )
+ jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
+ jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
+ lapack? (
+ virtual/cblas
+ >=virtual/lapack-3.10
+ )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ openexr? (
+ dev-libs/imath:=
+ media-libs/openexr:=
+ )
+ opengl? (
+ virtual/opengl[${MULTILIB_USEDEP}]
+ virtual/glu[${MULTILIB_USEDEP}]
+ )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ python? (
+ ${PYTHON_DEPS}
+ dev-python/numpy[${PYTHON_USEDEP}]
+ )
+ qt5? (
+ dev-qt/qtgui:5=
+ dev-qt/qtwidgets:5=
+ dev-qt/qttest:5=
+ dev-qt/qtconcurrent:5=
+ opengl? ( dev-qt/qtopengl:5= )
+ )
+ tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
+ threads? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
+ tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
+ v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
+ vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] )
+ vtk? ( sci-libs/vtk[rendering] )
+ webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
+ xine? ( media-libs/xine-lib )"
+DEPEND="${RDEPEND}
+ eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 )
+ java? ( >=virtual/jdk-1.8:* )"
+BDEPEND="virtual/pkgconfig"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # [opencv4]
+ /usr/include/opencv4/opencv2/cvconfig.h
+ /usr/include/opencv4/opencv2/opencv_modules.hpp
+ # [cudev]
+ /usr/include/opencv4/opencv2/cudaarithm.hpp
+ /usr/include/opencv4/opencv2/cudabgsegm.hpp
+ /usr/include/opencv4/opencv2/cudacodec.hpp
+ /usr/include/opencv4/opencv2/cudafeatures2d.hpp
+ /usr/include/opencv4/opencv2/cudafilters.hpp
+ /usr/include/opencv4/opencv2/cudaimgproc.hpp
+ /usr/include/opencv4/opencv2/cudalegacy.hpp
+ /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
+ /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
+ /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp
+ /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp
+ /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp
+ /usr/include/opencv4/opencv2/cudaobjdetect.hpp
+ /usr/include/opencv4/opencv2/cudaoptflow.hpp
+ /usr/include/opencv4/opencv2/cudastereo.hpp
+ /usr/include/opencv4/opencv2/cudawarping.hpp
+ /usr/include/opencv4/opencv2/cudev/block/block.hpp
+ /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp
+ /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp
+ /usr/include/opencv4/opencv2/cudev/block/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/block/scan.hpp
+ /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp
+ /usr/include/opencv4/opencv2/cudev/common.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/color.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/expr.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp
+ /usr/include/opencv4/opencv2/cudev/expr/warping.hpp
+ /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp
+ /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp
+ /usr/include/opencv4/opencv2/cudev/functional/functional.hpp
+ /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/copy.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/integral.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/transform.hpp
+ /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp
+ /usr/include/opencv4/opencv2/cudev.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp
+ /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp
+ /usr/include/opencv4/opencv2/cudev/util/atomic.hpp
+ /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp
+ /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp
+ /usr/include/opencv4/opencv2/cudev/util/limits.hpp
+ /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp
+ /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp
+ /usr/include/opencv4/opencv2/cudev/util/tuple.hpp
+ /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp
+ /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp
+ /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/scan.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp
+ /usr/include/opencv4/opencv2/cudev/warp/warp.hpp
+ # [contrib_cvv]
+ /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp
+ /usr/include/opencv4/opencv2/cvv/cvv.hpp
+ /usr/include/opencv4/opencv2/cvv/debug_mode.hpp
+ /usr/include/opencv4/opencv2/cvv/dmatch.hpp
+ /usr/include/opencv4/opencv2/cvv/filter.hpp
+ /usr/include/opencv4/opencv2/cvv/final_show.hpp
+ /usr/include/opencv4/opencv2/cvv.hpp
+ /usr/include/opencv4/opencv2/cvv/show_image.hpp
+ # [contrib_hdf]
+ /usr/include/opencv4/opencv2/hdf/hdf5.hpp
+ /usr/include/opencv4/opencv2/hdf.hpp
+ # [contrib_ovis]
+ /usr/include/opencv4/opencv2/ovis.hpp
+ # [contrib_sfm]
+ /usr/include/opencv4/opencv2/sfm.hpp
+ /usr/include/opencv4/opencv2/sfm/conditioning.hpp
+ /usr/include/opencv4/opencv2/sfm/fundamental.hpp
+ /usr/include/opencv4/opencv2/sfm/io.hpp
+ /usr/include/opencv4/opencv2/sfm/numeric.hpp
+ /usr/include/opencv4/opencv2/sfm/projection.hpp
+ /usr/include/opencv4/opencv2/sfm/reconstruct.hpp
+ /usr/include/opencv4/opencv2/sfm/robust.hpp
+ /usr/include/opencv4/opencv2/sfm/simple_pipeline.hpp
+ /usr/include/opencv4/opencv2/sfm/triangulation.hpp
+ # [vtk]
+ /usr/include/opencv4/opencv2/viz.hpp
+ /usr/include/opencv4/opencv2/viz/types.hpp
+ /usr/include/opencv4/opencv2/viz/viz3d.hpp
+ /usr/include/opencv4/opencv2/viz/vizcore.hpp
+ /usr/include/opencv4/opencv2/viz/widget_accessor.hpp
+ /usr/include/opencv4/opencv2/viz/widgets.hpp
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.4.0-disable-download.patch
+ "${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
+ "${FILESDIR}"/${PN}-4.8.0-fix-protobuf.patch
+ "${FILESDIR}"/${PN}-4.8.0-fix-flatbuffer.patch
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ # https://bugs.gentoo.org/838274
+ replace-flags -O3 -O2
+
+ cmake_src_prepare
+
+ # remove bundled stuff
+ rm -r 3rdparty || die "Removing 3rd party components failed"
+ sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
+ -i CMakeLists.txt cmake/*cmake || die
+
+ if use dnnsamples; then
+ mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
+ fi
+
+ if use contrib; then
+ cd "${WORKDIR}/${PN}_contrib-${PV}" || die
+ if use contribxfeatures2d; then
+ mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
+ fi
+ fi
+
+ if use download; then
+ mv "${WORKDIR}/${PN}-extdep-4.4.0" "${WORKDIR}/${P}/.cache/" || die
+ fi
+
+ java-pkg-opt-2_src_prepare
+
+ # this really belongs in src_prepare() too
+ JAVA_ANT_ENCODING="iso-8859-1"
+ # set encoding so even this cmake build will pick it up.
+ export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
+ java-ant-2_src_configure
+}
+
+multilib_src_configure() {
+ # please dont sort here, order is the same as in CMakeLists.txt
+ GLOBALCMAKEARGS=(
+ # for protobuf
+ -DCMAKE_CXX_STANDARD=14
+
+ # Optional 3rd party components
+ # ===================================================
+ -DENABLE_DOWNLOAD=$(usex download)
+ -DWITH_QUIRC=OFF # Do not have dependencies
+ -DWITH_1394=$(usex ieee1394)
+ # -DWITH_AVFOUNDATION=OFF # IOS
+ -DWITH_VTK=$(multilib_native_usex vtk)
+ -DWITH_EIGEN=$(usex eigen)
+ -DWITH_VFW=OFF # Video windows support
+ -DWITH_FFMPEG=$(usex ffmpeg)
+ -DWITH_GSTREAMER=$(usex gstreamer)
+ -DWITH_GSTREAMER_0_10=OFF # Don't want this
+ -DWITH_GTK=$(usex gtk3)
+ -DWITH_GTK_2_X=OFF # only want gtk3 nowadays
+ -DWITH_IPP=OFF
+ # Jasper was removed from tree because of security problems.
+ # Upstream were/are making progress. We use openjpeg instead.
+ # bug 734284
+ -DWITH_JASPER=OFF
+ -DWITH_JPEG=$(usex jpeg)
+ -DWITH_OPENJPEG=$(usex jpeg2k)
+ -DWITH_WEBP=$(usex webp)
+ -DWITH_OPENEXR=$(multilib_native_usex openexr)
+ -DWITH_OPENGL=$(usex opengl)
+ -DWITH_OPENVX=OFF
+ -DWITH_OPENNI=OFF # Not packaged
+ -DWITH_OPENNI2=OFF # Not packaged
+ -DWITH_PNG=$(usex png)
+ -DWITH_GDCM=OFF
+ -DWITH_PVAPI=OFF
+ -DWITH_GIGEAPI=OFF
+ -DWITH_ARAVIS=OFF
+ -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
+ -DWITH_WIN32UI=OFF # Windows only
+ # -DWITH_QUICKTIME=OFF
+ # -DWITH_QTKIT=OFF
+ -DWITH_TBB=$(usex threads)
+ -DWITH_OPENMP=$(usex openmp)
+ -DWITH_CSTRIPES=OFF
+ -DWITH_PTHREADS_PF=ON
+ -DWITH_TIFF=$(usex tiff)
+ -DWITH_UNICAP=OFF # Not packaged
+ -DWITH_V4L=$(usex v4l)
+ -DWITH_LIBV4L=$(usex v4l)
+ # -DWITH_DSHOW=ON # direct show supp
+ -DWITH_MSMF=OFF
+ -DWITH_XIMEA=OFF # Windows only
+ -DWITH_XINE=$(multilib_native_usex xine)
+ -DWITH_CLP=OFF
+ -DWITH_OPENCL=$(usex opencl)
+ -DWITH_OPENCL_SVM=OFF
+ -DWITH_OPENCLAMDFFT=$(usex opencl)
+ -DWITH_OPENCLAMDBLAS=$(usex opencl)
+ -DWITH_DIRECTX=OFF
+ -DWITH_INTELPERC=OFF
+ -DWITH_IPP_A=OFF
+ -DWITH_MATLAB=OFF
+ -DWITH_VA=$(usex vaapi)
+ -DWITH_VA_INTEL=$(usex vaapi)
+ -DWITH_GDAL=$(multilib_native_usex gdal)
+ -DWITH_GPHOTO2=$(usex gphoto2)
+ -DWITH_LAPACK=$(multilib_native_usex lapack)
+ -DWITH_ITT=OFF # 3dparty libs itt_notify
+ # ===================================================
+ # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
+ # ===================================================
+ -DWITH_CUDA=$(multilib_native_usex cuda)
+ -DWITH_CUBLAS=$(multilib_native_usex cuda)
+ -DWITH_CUFFT=$(multilib_native_usex cuda)
+ -DWITH_NVCUVID=OFF
+ # -DWITH_NVCUVID=$(usex cuda)
+ -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
+ # ===================================================
+ # OpenCV build components
+ # ===================================================
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
+ -DBUILD_ANDROID_EXAMPLES=OFF
+ -DBUILD_opencv_apps=$(usex opencvapps ON OFF)
+ -DBUILD_DOCS=OFF # Doesn't install anyways.
+ -DBUILD_EXAMPLES=$(multilib_native_usex examples)
+ -DBUILD_PERF_TESTS=OFF
+ -DBUILD_TESTS=$(multilib_native_usex testprograms)
+ -DBUILD_WITH_DEBUG_INFO=$(usex debug)
+ # -DBUILD_WITH_STATIC_CRT=OFF
+ -DBUILD_WITH_DYNAMIC_IPP=OFF
+ -DBUILD_FAT_JAVA_LIB=OFF
+ # -DBUILD_ANDROID_SERVICE=OFF
+ -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
+ -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
+ # ===================================================
+ # OpenCV installation options
+ # ===================================================
+ -DINSTALL_CREATE_DISTRIB=OFF
+ -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
+ -DINSTALL_TESTS=$(multilib_native_usex testprograms)
+ -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
+ # -DINSTALL_ANDROID_EXAMPLES=OFF
+ -DINSTALL_TO_MANGLED_PATHS=OFF
+ -DOPENCV_GENERATE_PKGCONFIG=ON
+ # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
+ # to set its destination libdir
+ -DLIB_SUFFIX=
+ # ===================================================
+ # OpenCV build options
+ # ===================================================
+ -DENABLE_CCACHE=OFF
+ # bug 733796, but PCH is a risky game in CMake anyway
+ -DENABLE_PRECOMPILED_HEADERS=OFF
+ -DENABLE_SOLUTION_FOLDERS=OFF
+ -DENABLE_PROFILING=OFF
+ -DENABLE_COVERAGE=OFF
+
+ -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
+ -DENABLE_NOISY_WARNINGS=OFF
+ -DOPENCV_WARNINGS_ARE_ERRORS=OFF
+ -DENABLE_IMPL_COLLECTION=OFF
+ -DENABLE_INSTRUMENTATION=OFF
+ -DGENERATE_ABI_DESCRIPTOR=OFF
+ -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
+ -DENABLE_LTO=$(usex lto)
+ # ===================================================
+ # things we want to be hard off or not yet figured out
+ # ===================================================
+ -DBUILD_PACKAGE=OFF
+ # ===================================================
+ # Not building protobuf but update files bug #631418
+ # ===================================================
+ -DWITH_PROTOBUF=ON
+ -DBUILD_PROTOBUF=OFF
+ -DPROTOBUF_UPDATE_FILES=ON
+ -Dprotobuf_MODULE_COMPATIBLE=ON
+ # ===================================================
+ # things we want to be hard enabled not worth useflag
+ # ===================================================
+ -DCMAKE_SKIP_RPATH=ON
+ -DOPENCV_DOC_INSTALL_PATH=
+ -DBUILD_opencv_features2d=$(usex features2d ON OFF)
+ )
+
+ # ==================================================
+ # cpu flags, should solve 633900
+ #===================================================
+ local CPU_BASELINE=""
+ for i in "${CPU_FEATURES_MAP[@]}" ; do
+ if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163
+ use ${i%:*} && CPU_BASELINE="${CPU_BASELINE}${i#*:};"
+ fi
+ done
+
+ GLOBALCMAKEARGS+=(
+ -DOPENCV_CPU_OPT_IMPLIES_IGNORE=ON
+ -DCPU_BASELINE=${CPU_BASELINE}
+ -DCPU_DISPATCH=
+ )
+
+ # ===================================================
+ # OpenCV Contrib Modules
+ # ===================================================
+ if use contrib; then
+ GLOBALCMAKEARGS+=(
+ -DBUILD_opencv_dnn=$(usex contribdnn ON OFF)
+ -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
+ -DBUILD_opencv_dnns_easily_fooled=OFF
+ -DBUILD_opencv_xfeatures2d=$(usex contribxfeatures2d ON OFF)
+ -DBUILD_opencv_cvv=$(usex contribcvv ON OFF)
+ -DBUILD_opencv_hdf=$(multilib_native_usex contribhdf ON OFF)
+ -DBUILD_opencv_sfm=$(usex contribsfm ON OFF)
+ -DBUILD_opencv_freetype=$(usex contribfreetype ON OFF)
+ -DBUILD_opencv_ovis=$(usex contribovis ON OFF)
+ )
+
+ if multilib_is_native_abi; then
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
+ )
+ else
+ GLOBALCMAKEARGS+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
+ )
+ fi
+ fi
+
+ # workaround for bug 413429
+ tc-export CC CXX
+
+ local mycmakeargs=(
+ ${GLOBALCMAKEARGS[@]}
+ -DPYTHON_EXECUTABLE=OFF
+ -DINSTALL_PYTHON_EXAMPLES=OFF
+ -DBUILD_opencv_python2=OFF
+ -DBUILD_opencv_python3=OFF
+ )
+
+ cmake_src_configure
+
+ # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
+ # TODO patch ocv_download to copy files into destination dirs
+ if use contribdnn; then
+ mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
+ cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
+ fi
+
+}
+
+python_module_compile() {
+ local BUILD_DIR="${orig_BUILD_DIR}"
+ local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
+
+ # Set all python variables to load the correct Gentoo paths
+ mycmakeargs+=(
+ # python_setup alters PATH and sets this as wrapper
+ # to the correct interpreter we are building for
+ -DPYTHON_DEFAULT_EXECUTABLE=${EPYTHON}
+ -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
+ )
+
+ # Regenerate cache file. Can't use rebuild_cache as it won't
+ # have the Gentoo specific options.
+ rm CMakeCache.txt || die "rm failed"
+ cmake_src_configure
+ cmake_src_compile
+ cmake_src_install
+
+ # Remove compiled binary so new version compiles
+ # Avoid conflicts with new module builds as build system doesn't
+ # really support it.
+ rm -r modules/python3 || die "rm failed"
+
+ python_optimize "${ED}"/$(python_get_sitedir)
+}
+
+multilib_src_install() {
+ cmake_src_install
+
+ # Build and install the python modules for all targets
+ if multilib_is_native_abi && use python; then
+ local orig_BUILD_DIR="${BUILD_DIR}"
+ python_foreach_impl python_module_compile
+ fi
+}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2024-01-03 21:28 Andreas Sturmlechner
0 siblings, 0 replies; 20+ messages in thread
From: Andreas Sturmlechner @ 2024-01-03 21:28 UTC (permalink / raw
To: gentoo-commits
commit: ea50a5c540e7e8730230b9a54521173c4ea0d521
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 3 20:58:50 2024 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Jan 3 21:28:37 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea50a5c5
media-libs/opencv: Cleanup vulnerable <4.8.0 and overshadowed 4.8.0
Bug: https://bugs.gentoo.org/906106
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
media-libs/opencv/Manifest | 4 -
.../files/opencv-4.6.0-fix-build-examples.patch | 21 -
.../opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch | 19 -
media-libs/opencv/opencv-4.6.0-r4.ebuild | 582 --------------------
media-libs/opencv/opencv-4.7.0-r1.ebuild | 584 --------------------
media-libs/opencv/opencv-4.7.0.ebuild | 581 --------------------
media-libs/opencv/opencv-4.8.0.ebuild | 585 ---------------------
7 files changed, 2376 deletions(-)
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest
index eb95310084f5..4c83059fb2d5 100644
--- a/media-libs/opencv/Manifest
+++ b/media-libs/opencv/Manifest
@@ -1,10 +1,6 @@
DIST opencv-3.4.0-face_landmark_model.tar.gz 63299830 BLAKE2B 58f08cd8c030ee1c8b66e76a561fd625e112face427d001185f8d7c0eaace55adbd8474663021841a1382bfe393a210e64c51223441713cdb9156fac866a845c SHA512 2cd29ce42c08b2966db3ef4a2bc217ab3d07051819757ec6de8f3deea29e28f60abab39f101dba03f766f17018598e411bd687a7eaab0c681c113e10a2de2b23
DIST opencv-3.4.0-res10_300x300-caffeemodel.tar.gz 10036604 BLAKE2B 2a2de48fc420f13e7be146ac88f311901c5b4e409c30e466152e33cae1f8afd87dcb6d758af447c268d90bd67989c8798cd80cab172b10499a6ad5224509dbdf SHA512 96fee9f447d5739bc01a5cab37c453cf7237457dfb5d2bf93ac37f8e5aa557ac222316f449cd58e37e856abe4d8e9d4a7820daaba32f0b22cbcde8e340287d4b
DIST opencv-4.4.0_extdep.tar.gz 65334871 BLAKE2B 89fa0083da428e986bb4287295bdbff626d0f84866377413649c1d7ca77338288141f22d2a3c0b64d6d0fc1db98f918c8b33a665274cee4c4aefb44359e4333d SHA512 7b758099ce4abef151051e3e9e1e45b73e4054669d3aa53051e4d4c5f43d9373c9bda5ecbce51f6b024562cb566bd1117505af29ab5f3c36a493f185111a3b4e
-DIST opencv-4.6.0.tar.gz 90208971 BLAKE2B f01a907eb4a54fc0795293f1a28bbf3af5a3d237293293f6ef5275646207d48b3d634b2d91e7011407176405b60c7e4383076e520ceb56f92b09c36e97333148 SHA512 93d7807794682990b6a1d1de1851986ae3c5d1afe6605f3f8cace03ba5e3390bee2568bc0f335af34d3fc974df64cbce0ce685261ec2abd693d259b97b15bc46
-DIST opencv-4.6.0_contrib.tar.gz 59667769 BLAKE2B 26b454436d943d7955194fd21ad29efc417d5c873fa19a6a200beb319cd75c6ec5766734c478fcd55745a7c200ffdaa92e7b1821f13810bb9d181d263f8fc6da SHA512 2e9cc9632774babf59cd186cd7b7edbd35a816bdda2acb51339c514a33fc6d8c3f1687eb3b0f6827304e3fcb0f9f3e81d47e8ab08239175750ac1240cc99dc5d
-DIST opencv-4.7.0.tar.gz 91027497 BLAKE2B c76ae37a79e48f818b83383f35b4fe518d959e4e34651dc16346438eeba31cbfd5c970c27e30cad359c8ad91435e9bdb61cad147f08e671d4c844cb8c5b525f9 SHA512 f799e1eb4ef1eb81212319cf908d0a64d2d5179c8da86b919b06e96a6870a9f3ed33251223a841b71711349018ea6782c174179fa59958a1573e22d11cc9347d
-DIST opencv-4.7.0_contrib.tar.gz 59421940 BLAKE2B d427743c45d7430f3a6dd5712ad46bb7c2b9e88a48a3e924fb32c6a10cdb1f4205941453cc3e1340f02cd53ba5a13061f0da9a7e413072a6bd4a6529507b0939 SHA512 f0d878180655de4255cb72cf358a5949dfcf53a386e74f9a743902ac1bae12b2e812a1fc4ecc56a6afdc6adbffec867883a3245ce0b527614cc76e3710e23230
DIST opencv-4.8.0.tar.gz 91992565 BLAKE2B eede5479acdcef7dfb49d260b696ed14e85a27b8cd7211934d3fa9df9a46072daca9e1b7c50d1d56633d5e7bdf96e4a5731c8ea0e04886dc381e7864357ed8de SHA512 48738c3e7460a361274357aef1dd427082ccd59f749d6317d92a414b3741ce6116ea15ed4fedd2d47a25e456c705f3ba114357558646097bfc0e6dba9b3b865c
DIST opencv-4.8.0_contrib.tar.gz 59201076 BLAKE2B e30c4f17e1e89c8b0821bbf8ea44b6b4ce505ad2761222a8b119c5aee5ae4ef50e06a73f41fee3b2fa60b71c736989904f6d1fb31a16abfe39e605e2d32d851b SHA512 81cc41cfe1ea03e60b0657edeaa76a90926e5e79a9f93a482e17bc9edbf1b5ce36b13d108fd8fb097f2fb3d6381fbeb102811f44bfc761c2de7f69bf3c5298a1
DIST opencv-4.8.1.tar.gz 92006711 BLAKE2B 54728a37e3e8a528bd8d2e6df5963a996820a51160d05ac72b350234ce5372f99c037af96e13c55de1452e517fffb478c2335b9e1cbc07a36c78f99351eabd58 SHA512 b98d89b8e7b8ae8138bce00c5226816b761b53fbeb8f28ca516e08c5d130f216f9388a81785cd6684034530f768e097cbe12f19a9361f362b7d2048bfc427a65
diff --git a/media-libs/opencv/files/opencv-4.6.0-fix-build-examples.patch b/media-libs/opencv/files/opencv-4.6.0-fix-build-examples.patch
deleted file mode 100644
index 3cc6328a2323..000000000000
--- a/media-libs/opencv/files/opencv-4.6.0-fix-build-examples.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From 5acf351e4b9d099d446f401df690d559ed5dfdad Mon Sep 17 00:00:00 2001
-From: Prasanth R <prasanth.r@timesys.com>
-Date: Thu, 14 Jul 2022 13:34:54 +0530
-Subject: [PATCH] #21804 Add opencv_gapi as dep to samples/cpp
-
----
- samples/cpp/CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt
-index c9c4440f22c7..f23b333ca93a 100644
---- a/samples/cpp/CMakeLists.txt
-+++ b/samples/cpp/CMakeLists.txt
-@@ -15,6 +15,7 @@ set(OPENCV_CPP_SAMPLES_REQUIRED_DEPS
- opencv_calib3d
- opencv_stitching
- opencv_dnn
-+ opencv_gapi
- ${OPENCV_MODULES_PUBLIC}
- ${OpenCV_LIB_COMPONENTS})
- ocv_check_dependencies(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
diff --git a/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch b/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch
deleted file mode 100644
index 557576a8747a..000000000000
--- a/media-libs/opencv/files/opencv-4.6.0-fix-ffmpeg-5.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-https://github.com/opencv/opencv/issues/22418
-https://github.com/opencv/opencv/commit/496eed950f6d0e7fd92619d47e3cec8f06e96ace
-https://bugs.gentoo.org/876748
-
-From: Jochen Sprickerhof <jspricke@debian.org>
-Date: Mon, 8 Aug 2022 21:10:13 +0200
-Subject: [PATCH] Add missing header for LIBAVCODEC_VERSION_INT
-
---- a/modules/videoio/src/ffmpeg_codecs.hpp
-+++ b/modules/videoio/src/ffmpeg_codecs.hpp
-@@ -60,6 +60,7 @@ extern "C" {
- #include <errno.h>
- #endif
-
-+#include <libavcodec/version.h>
- #include <libavformat/avformat.h>
-
- #ifdef __cplusplus
-
diff --git a/media-libs/opencv/opencv-4.6.0-r4.ebuild b/media-libs/opencv/opencv-4.6.0-r4.ebuild
deleted file mode 100644
index 11596eede91e..000000000000
--- a/media-libs/opencv/opencv-4.6.0-r4.ebuild
+++ /dev/null
@@ -1,582 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-inherit flag-o-matic java-pkg-opt-2 java-ant-2 cmake-multilib python-r1 toolchain-funcs
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- dnnsamples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
- download? ( https://github.com/rossbridger/opencv-extdep/archive/4.4.0.tar.gz -> ${PN}-4.4.0_extdep.tar.gz )
- contrib? (
- https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contribdnn? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz )
- contribxfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
- )"
-
-LICENSE="Apache-2.0"
-SLOT="0/${PV}" # subslot = libopencv* soname version
-KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv x86"
-IUSE="contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d cuda debug dnnsamples download +eigen examples +features2d ffmpeg gdal gflags glog gphoto2 gstreamer gtk3 ieee1394 jpeg jpeg2k lapack lto opencl openexr opengl openmp opencvapps png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
-
-# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications
-ARM_CPU_FEATURES=(
- cpu_flags_arm_neon:NEON
- cpu_flags_arm_vfpv3:VFPV3
-)
-PPC_CPU_FEATURES=(
- cpu_flags_ppc_vsx:VSX
- cpu_flags_ppc_vsx3:VSX3
-)
-X86_CPU_FEATURES_RAW=(
- avx:AVX
- avx2:AVX2
- avx512f:AVX_512F
- f16c:FP16
- fma3:FMA3
- popcnt:POPCNT
- sse:SSE
- sse2:SSE2
- sse3:SSE3
- ssse3:SSSE3
- sse4_1:SSE4_1
- sse4_2:SSE4_2
-)
-X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
-CPU_FEATURES_MAP=(
- ${ARM_CPU_FEATURES[@]}
- ${PPC_CPU_FEATURES[@]}
- ${X86_CPU_FEATURES[@]}
-)
-IUSE="${IUSE} ${CPU_FEATURES_MAP[@]%:*}"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it Wwithout the user knowing, which defeats the
-# purpose of the opengl use flag.
-# cuda needs contrib, bug #701712
-REQUIRED_USE="
- cpu_flags_x86_avx2? ( cpu_flags_x86_f16c )
- cpu_flags_x86_f16c? ( cpu_flags_x86_avx )
- cuda? ( contrib
- tesseract? ( opencl ) )
- dnnsamples? ( examples )
- gflags? ( contrib )
- glog? ( contrib )
- contribcvv? ( contrib qt5 )
- contribdnn? ( contrib )
- contribfreetype? ( contrib )
- contribhdf? ( contrib )
- contribovis? ( contrib )
- contribsfm? ( contrib eigen gflags glog )
- contribxfeatures2d? ( contrib download )
- examples? ( contribdnn )
- java? ( python )
- opengl? ( qt5 )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )
- ?? ( gtk3 qt5 )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( <dev-util/nvidia-cuda-toolkit-12:= )
- contribhdf? ( sci-libs/hdf5:= )
- contribfreetype? (
- media-libs/freetype:2[${MULTILIB_USEDEP}]
- media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
- )
- contribovis? ( dev-games/ogre:0/1.12 )
- ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk3? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:3[${MULTILIB_USEDEP}]
- )
- ieee1394? (
- media-libs/libdc1394:=[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.8:* )
- jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
- lapack? (
- virtual/cblas
- >=virtual/lapack-3.10
- )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? (
- dev-libs/imath:=
- media-libs/openexr:=
- )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? (
- ${PYTHON_DEPS}
- dev-python/numpy[${PYTHON_USEDEP}]
- )
- qt5? (
- dev-qt/qtgui:5=
- dev-qt/qtwidgets:5=
- dev-qt/qttest:5=
- dev-qt/qtconcurrent:5=
- opengl? ( dev-qt/qtopengl:5= )
- )
- tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
- threads? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 )
- java? ( >=virtual/jdk-1.8:* )"
-BDEPEND="virtual/pkgconfig"
-
-MULTILIB_WRAPPED_HEADERS=(
- # [opencv4]
- /usr/include/opencv4/opencv2/cvconfig.h
- /usr/include/opencv4/opencv2/opencv_modules.hpp
- # [cudev]
- /usr/include/opencv4/opencv2/cudaarithm.hpp
- /usr/include/opencv4/opencv2/cudabgsegm.hpp
- /usr/include/opencv4/opencv2/cudacodec.hpp
- /usr/include/opencv4/opencv2/cudafeatures2d.hpp
- /usr/include/opencv4/opencv2/cudafilters.hpp
- /usr/include/opencv4/opencv2/cudaimgproc.hpp
- /usr/include/opencv4/opencv2/cudalegacy.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv4/opencv2/cudaobjdetect.hpp
- /usr/include/opencv4/opencv2/cudaoptflow.hpp
- /usr/include/opencv4/opencv2/cudastereo.hpp
- /usr/include/opencv4/opencv2/cudawarping.hpp
- /usr/include/opencv4/opencv2/cudev/block/block.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv4/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/scan.hpp
- /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv4/opencv2/cudev/common.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/color.hpp
- /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv4/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv4/opencv2/cudev.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv4/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/limits.hpp
- /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv4/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv4/opencv2/cudev/warp/warp.hpp
- # [contrib_cvv]
- /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv4/opencv2/cvv/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv4/opencv2/cvv/dmatch.hpp
- /usr/include/opencv4/opencv2/cvv/filter.hpp
- /usr/include/opencv4/opencv2/cvv/final_show.hpp
- /usr/include/opencv4/opencv2/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv4/opencv2/hdf/hdf5.hpp
- /usr/include/opencv4/opencv2/hdf.hpp
- # [contrib_ovis]
- /usr/include/opencv4/opencv2/ovis.hpp
- # [contrib_sfm]
- /usr/include/opencv4/opencv2/sfm.hpp
- /usr/include/opencv4/opencv2/sfm/conditioning.hpp
- /usr/include/opencv4/opencv2/sfm/fundamental.hpp
- /usr/include/opencv4/opencv2/sfm/io.hpp
- /usr/include/opencv4/opencv2/sfm/numeric.hpp
- /usr/include/opencv4/opencv2/sfm/projection.hpp
- /usr/include/opencv4/opencv2/sfm/reconstruct.hpp
- /usr/include/opencv4/opencv2/sfm/robust.hpp
- /usr/include/opencv4/opencv2/sfm/simple_pipeline.hpp
- /usr/include/opencv4/opencv2/sfm/triangulation.hpp
- # [vtk]
- /usr/include/opencv4/opencv2/viz.hpp
- /usr/include/opencv4/opencv2/viz/types.hpp
- /usr/include/opencv4/opencv2/viz/viz3d.hpp
- /usr/include/opencv4/opencv2/viz/vizcore.hpp
- /usr/include/opencv4/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv4/opencv2/viz/widgets.hpp
-)
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.4.0-disable-download.patch
- "${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
- "${FILESDIR}"/${P}-fix-build-examples.patch # bug 830163, pending upstream PR #22245
- "${FILESDIR}"/${P}-fix-ffmpeg-5.patch
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- # https://bugs.gentoo.org/838274
- replace-flags -O3 -O2
-
- cmake_src_prepare
-
- # remove bundled stuff
- rm -r 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use dnnsamples; then
- mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
- fi
-
- if use contrib; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- if use contribxfeatures2d; then
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
- fi
-
- if use download; then
- mv "${WORKDIR}/${PN}-extdep-4.4.0" "${WORKDIR}/${P}/.cache/" || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # Optional 3rd party components
- # ===================================================
- -DENABLE_DOWNLOAD=$(usex download)
- -DWITH_QUIRC=OFF # Do not have dependencies
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk3)
- -DWITH_GTK_2_X=OFF # only want gtk3 nowadays
- -DWITH_IPP=OFF
- # Jasper was removed from tree because of security problems.
- # Upstream were/are making progress. We use openjpeg instead.
- # bug 734284
- -DWITH_JASPER=OFF
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_OPENJPEG=$(usex jpeg2k)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(multilib_native_usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- # -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
- # -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=$(usex opencvapps ON OFF)
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=OFF
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- -DOPENCV_GENERATE_PKGCONFIG=ON
- # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
- # to set its destination libdir
- -DLIB_SUFFIX=
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- # bug 733796, but PCH is a risky game in CMake anyway
- -DENABLE_PRECOMPILED_HEADERS=OFF
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- -DENABLE_LTO=$(usex lto)
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- -DBUILD_opencv_features2d=$(usex features2d ON OFF)
- )
-
- # ==================================================
- # cpu flags, should solve 633900
- #===================================================
- local CPU_BASELINE=""
- for i in "${CPU_FEATURES_MAP[@]}" ; do
- if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163
- use ${i%:*} && CPU_BASELINE="${CPU_BASELINE}${i#*:};"
- fi
- done
-
- GLOBALCMAKEARGS+=(
- -DOPENCV_CPU_OPT_IMPLIES_IGNORE=ON
- -DCPU_BASELINE=${CPU_BASELINE}
- -DCPU_DISPATCH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contribdnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contribxfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contribcvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contribhdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contribsfm ON OFF)
- -DBUILD_opencv_freetype=$(usex contribfreetype ON OFF)
- -DBUILD_opencv_ovis=$(usex contribovis ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=(
- ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- -DBUILD_opencv_python2=OFF
- -DBUILD_opencv_python3=OFF
- )
-
- cmake_src_configure
-
- # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
- # TODO patch ocv_download to copy files into destination dirs
- if use contribdnn; then
- mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- fi
-
-}
-
-python_module_compile() {
- local BUILD_DIR="${orig_BUILD_DIR}"
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # python_setup alters PATH and sets this as wrapper
- # to the correct interpreter we are building for
- -DPYTHON_DEFAULT_EXECUTABLE=${EPYTHON}
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm CMakeCache.txt || die "rm failed"
- cmake_src_configure
- cmake_src_compile
- cmake_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -r modules/python3 || die "rm failed"
-
- python_optimize "${ED}"/$(python_get_sitedir)
-}
-
-multilib_src_install() {
- cmake_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR="${BUILD_DIR}"
- python_foreach_impl python_module_compile
- fi
-}
diff --git a/media-libs/opencv/opencv-4.7.0-r1.ebuild b/media-libs/opencv/opencv-4.7.0-r1.ebuild
deleted file mode 100644
index ddf36bc7442e..000000000000
--- a/media-libs/opencv/opencv-4.7.0-r1.ebuild
+++ /dev/null
@@ -1,584 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-inherit flag-o-matic java-pkg-opt-2 java-ant-2 cmake-multilib python-r1 toolchain-funcs
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- dnnsamples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
- download? ( https://github.com/rossbridger/opencv-extdep/archive/4.4.0.tar.gz -> ${PN}-4.4.0_extdep.tar.gz )
- contrib? (
- https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contribdnn? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz )
- contribxfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
- )"
-
-LICENSE="Apache-2.0"
-SLOT="0/${PV}" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
-IUSE="contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d cuda debug dnnsamples download +eigen examples +features2d ffmpeg gdal gflags glog gphoto2 gstreamer gtk3 ieee1394 jpeg jpeg2k lapack lto opencl openexr opengl openmp opencvapps png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
-
-# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications
-ARM_CPU_FEATURES=(
- cpu_flags_arm_neon:NEON
- cpu_flags_arm_vfpv3:VFPV3
-)
-PPC_CPU_FEATURES=(
- cpu_flags_ppc_vsx:VSX
- cpu_flags_ppc_vsx3:VSX3
-)
-X86_CPU_FEATURES_RAW=(
- avx:AVX
- avx2:AVX2
- avx512f:AVX_512F
- f16c:FP16
- fma3:FMA3
- popcnt:POPCNT
- sse:SSE
- sse2:SSE2
- sse3:SSE3
- ssse3:SSSE3
- sse4_1:SSE4_1
- sse4_2:SSE4_2
-)
-X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
-CPU_FEATURES_MAP=(
- ${ARM_CPU_FEATURES[@]}
- ${PPC_CPU_FEATURES[@]}
- ${X86_CPU_FEATURES[@]}
-)
-IUSE="${IUSE} ${CPU_FEATURES_MAP[@]%:*}"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it Wwithout the user knowing, which defeats the
-# purpose of the opengl use flag.
-# cuda needs contrib, bug #701712
-REQUIRED_USE="
- cpu_flags_x86_avx2? ( cpu_flags_x86_f16c )
- cpu_flags_x86_f16c? ( cpu_flags_x86_avx )
- cuda? ( contrib
- tesseract? ( opencl ) )
- dnnsamples? ( examples )
- gflags? ( contrib )
- glog? ( contrib )
- contribcvv? ( contrib qt5 )
- contribdnn? ( contrib )
- contribfreetype? ( contrib )
- contribhdf? ( contrib )
- contribovis? ( contrib )
- contribsfm? ( contrib eigen gflags glog )
- contribxfeatures2d? ( contrib download )
- examples? ( contribdnn )
- java? ( python )
- opengl? ( qt5 )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )
- ?? ( gtk3 qt5 )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contribhdf? ( sci-libs/hdf5:= )
- contribfreetype? (
- media-libs/freetype:2[${MULTILIB_USEDEP}]
- media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
- )
- contribovis? ( dev-games/ogre:0/1.12 )
- ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk3? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:3[${MULTILIB_USEDEP}]
- )
- ieee1394? (
- media-libs/libdc1394:=[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.8:* )
- jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
- lapack? (
- virtual/cblas
- >=virtual/lapack-3.10
- )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? (
- dev-libs/imath:=
- media-libs/openexr:=
- )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? (
- ${PYTHON_DEPS}
- dev-python/numpy[${PYTHON_USEDEP}]
- )
- qt5? (
- dev-qt/qtgui:5=
- dev-qt/qtwidgets:5=
- dev-qt/qttest:5=
- dev-qt/qtconcurrent:5=
- opengl? ( dev-qt/qtopengl:5= )
- )
- tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
- threads? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 )
- java? ( >=virtual/jdk-1.8:* )"
-BDEPEND="virtual/pkgconfig"
-
-MULTILIB_WRAPPED_HEADERS=(
- # [opencv4]
- /usr/include/opencv4/opencv2/cvconfig.h
- /usr/include/opencv4/opencv2/opencv_modules.hpp
- # [cudev]
- /usr/include/opencv4/opencv2/cudaarithm.hpp
- /usr/include/opencv4/opencv2/cudabgsegm.hpp
- /usr/include/opencv4/opencv2/cudacodec.hpp
- /usr/include/opencv4/opencv2/cudafeatures2d.hpp
- /usr/include/opencv4/opencv2/cudafilters.hpp
- /usr/include/opencv4/opencv2/cudaimgproc.hpp
- /usr/include/opencv4/opencv2/cudalegacy.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv4/opencv2/cudaobjdetect.hpp
- /usr/include/opencv4/opencv2/cudaoptflow.hpp
- /usr/include/opencv4/opencv2/cudastereo.hpp
- /usr/include/opencv4/opencv2/cudawarping.hpp
- /usr/include/opencv4/opencv2/cudev/block/block.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv4/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/scan.hpp
- /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv4/opencv2/cudev/common.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/color.hpp
- /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv4/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv4/opencv2/cudev.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv4/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/limits.hpp
- /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv4/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv4/opencv2/cudev/warp/warp.hpp
- # [contrib_cvv]
- /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv4/opencv2/cvv/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv4/opencv2/cvv/dmatch.hpp
- /usr/include/opencv4/opencv2/cvv/filter.hpp
- /usr/include/opencv4/opencv2/cvv/final_show.hpp
- /usr/include/opencv4/opencv2/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv4/opencv2/hdf/hdf5.hpp
- /usr/include/opencv4/opencv2/hdf.hpp
- # [contrib_ovis]
- /usr/include/opencv4/opencv2/ovis.hpp
- # [contrib_sfm]
- /usr/include/opencv4/opencv2/sfm.hpp
- /usr/include/opencv4/opencv2/sfm/conditioning.hpp
- /usr/include/opencv4/opencv2/sfm/fundamental.hpp
- /usr/include/opencv4/opencv2/sfm/io.hpp
- /usr/include/opencv4/opencv2/sfm/numeric.hpp
- /usr/include/opencv4/opencv2/sfm/projection.hpp
- /usr/include/opencv4/opencv2/sfm/reconstruct.hpp
- /usr/include/opencv4/opencv2/sfm/robust.hpp
- /usr/include/opencv4/opencv2/sfm/simple_pipeline.hpp
- /usr/include/opencv4/opencv2/sfm/triangulation.hpp
- # [vtk]
- /usr/include/opencv4/opencv2/viz.hpp
- /usr/include/opencv4/opencv2/viz/types.hpp
- /usr/include/opencv4/opencv2/viz/viz3d.hpp
- /usr/include/opencv4/opencv2/viz/vizcore.hpp
- /usr/include/opencv4/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv4/opencv2/viz/widgets.hpp
-)
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.4.0-disable-download.patch
- "${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
- "${FILESDIR}"/${PN}-4.6.0-fix-build-examples.patch # bug 830163, pending upstream PR #22245
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- # https://bugs.gentoo.org/838274
- replace-flags -O3 -O2
-
- cmake_src_prepare
-
- # remove bundled stuff
- rm -r 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use dnnsamples; then
- mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
- fi
-
- if use contrib; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- if use contribxfeatures2d; then
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
- fi
-
- if use download; then
- mv "${WORKDIR}/${PN}-extdep-4.4.0" "${WORKDIR}/${P}/.cache/" || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # for protobuf
- -DCMAKE_CXX_STANDARD=14
-
- # Optional 3rd party components
- # ===================================================
- -DENABLE_DOWNLOAD=$(usex download)
- -DWITH_QUIRC=OFF # Do not have dependencies
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk3)
- -DWITH_GTK_2_X=OFF # only want gtk3 nowadays
- -DWITH_IPP=OFF
- # Jasper was removed from tree because of security problems.
- # Upstream were/are making progress. We use openjpeg instead.
- # bug 734284
- -DWITH_JASPER=OFF
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_OPENJPEG=$(usex jpeg2k)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(multilib_native_usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- # -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
- # -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=$(usex opencvapps ON OFF)
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=OFF
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- -DOPENCV_GENERATE_PKGCONFIG=ON
- # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
- # to set its destination libdir
- -DLIB_SUFFIX=
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- # bug 733796, but PCH is a risky game in CMake anyway
- -DENABLE_PRECOMPILED_HEADERS=OFF
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- -DENABLE_LTO=$(usex lto)
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- -DBUILD_opencv_features2d=$(usex features2d ON OFF)
- )
-
- # ==================================================
- # cpu flags, should solve 633900
- #===================================================
- local CPU_BASELINE=""
- for i in "${CPU_FEATURES_MAP[@]}" ; do
- if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163
- use ${i%:*} && CPU_BASELINE="${CPU_BASELINE}${i#*:};"
- fi
- done
-
- GLOBALCMAKEARGS+=(
- -DOPENCV_CPU_OPT_IMPLIES_IGNORE=ON
- -DCPU_BASELINE=${CPU_BASELINE}
- -DCPU_DISPATCH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contribdnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contribxfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contribcvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contribhdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contribsfm ON OFF)
- -DBUILD_opencv_freetype=$(usex contribfreetype ON OFF)
- -DBUILD_opencv_ovis=$(usex contribovis ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=(
- ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- -DBUILD_opencv_python2=OFF
- -DBUILD_opencv_python3=OFF
- )
-
- cmake_src_configure
-
- # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
- # TODO patch ocv_download to copy files into destination dirs
- if use contribdnn; then
- mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- fi
-
-}
-
-python_module_compile() {
- local BUILD_DIR="${orig_BUILD_DIR}"
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # python_setup alters PATH and sets this as wrapper
- # to the correct interpreter we are building for
- -DPYTHON_DEFAULT_EXECUTABLE=${EPYTHON}
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm CMakeCache.txt || die "rm failed"
- cmake_src_configure
- cmake_src_compile
- cmake_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -r modules/python3 || die "rm failed"
-
- python_optimize "${ED}"/$(python_get_sitedir)
-}
-
-multilib_src_install() {
- cmake_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR="${BUILD_DIR}"
- python_foreach_impl python_module_compile
- fi
-}
diff --git a/media-libs/opencv/opencv-4.7.0.ebuild b/media-libs/opencv/opencv-4.7.0.ebuild
deleted file mode 100644
index 15fd917278e6..000000000000
--- a/media-libs/opencv/opencv-4.7.0.ebuild
+++ /dev/null
@@ -1,581 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-inherit flag-o-matic java-pkg-opt-2 java-ant-2 cmake-multilib python-r1 toolchain-funcs
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- dnnsamples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
- download? ( https://github.com/rossbridger/opencv-extdep/archive/4.4.0.tar.gz -> ${PN}-4.4.0_extdep.tar.gz )
- contrib? (
- https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contribdnn? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz )
- contribxfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
- )"
-
-LICENSE="Apache-2.0"
-SLOT="0/${PV}" # subslot = libopencv* soname version
-KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv x86"
-IUSE="contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d cuda debug dnnsamples download +eigen examples +features2d ffmpeg gdal gflags glog gphoto2 gstreamer gtk3 ieee1394 jpeg jpeg2k lapack lto opencl openexr opengl openmp opencvapps png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
-
-# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications
-ARM_CPU_FEATURES=(
- cpu_flags_arm_neon:NEON
- cpu_flags_arm_vfpv3:VFPV3
-)
-PPC_CPU_FEATURES=(
- cpu_flags_ppc_vsx:VSX
- cpu_flags_ppc_vsx3:VSX3
-)
-X86_CPU_FEATURES_RAW=(
- avx:AVX
- avx2:AVX2
- avx512f:AVX_512F
- f16c:FP16
- fma3:FMA3
- popcnt:POPCNT
- sse:SSE
- sse2:SSE2
- sse3:SSE3
- ssse3:SSSE3
- sse4_1:SSE4_1
- sse4_2:SSE4_2
-)
-X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
-CPU_FEATURES_MAP=(
- ${ARM_CPU_FEATURES[@]}
- ${PPC_CPU_FEATURES[@]}
- ${X86_CPU_FEATURES[@]}
-)
-IUSE="${IUSE} ${CPU_FEATURES_MAP[@]%:*}"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it Wwithout the user knowing, which defeats the
-# purpose of the opengl use flag.
-# cuda needs contrib, bug #701712
-REQUIRED_USE="
- cpu_flags_x86_avx2? ( cpu_flags_x86_f16c )
- cpu_flags_x86_f16c? ( cpu_flags_x86_avx )
- cuda? ( contrib
- tesseract? ( opencl ) )
- dnnsamples? ( examples )
- gflags? ( contrib )
- glog? ( contrib )
- contribcvv? ( contrib qt5 )
- contribdnn? ( contrib )
- contribfreetype? ( contrib )
- contribhdf? ( contrib )
- contribovis? ( contrib )
- contribsfm? ( contrib eigen gflags glog )
- contribxfeatures2d? ( contrib download )
- examples? ( contribdnn )
- java? ( python )
- opengl? ( qt5 )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )
- ?? ( gtk3 qt5 )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contribhdf? ( sci-libs/hdf5:= )
- contribfreetype? (
- media-libs/freetype:2[${MULTILIB_USEDEP}]
- media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
- )
- contribovis? ( dev-games/ogre:0/1.12 )
- ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk3? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:3[${MULTILIB_USEDEP}]
- )
- ieee1394? (
- media-libs/libdc1394:=[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.8:* )
- jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
- lapack? (
- virtual/cblas
- >=virtual/lapack-3.10
- )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? (
- dev-libs/imath:=
- media-libs/openexr:=
- )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? (
- ${PYTHON_DEPS}
- dev-python/numpy[${PYTHON_USEDEP}]
- )
- qt5? (
- dev-qt/qtgui:5=
- dev-qt/qtwidgets:5=
- dev-qt/qttest:5=
- dev-qt/qtconcurrent:5=
- opengl? ( dev-qt/qtopengl:5= )
- )
- tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
- threads? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 )
- java? ( >=virtual/jdk-1.8:* )"
-BDEPEND="virtual/pkgconfig"
-
-MULTILIB_WRAPPED_HEADERS=(
- # [opencv4]
- /usr/include/opencv4/opencv2/cvconfig.h
- /usr/include/opencv4/opencv2/opencv_modules.hpp
- # [cudev]
- /usr/include/opencv4/opencv2/cudaarithm.hpp
- /usr/include/opencv4/opencv2/cudabgsegm.hpp
- /usr/include/opencv4/opencv2/cudacodec.hpp
- /usr/include/opencv4/opencv2/cudafeatures2d.hpp
- /usr/include/opencv4/opencv2/cudafilters.hpp
- /usr/include/opencv4/opencv2/cudaimgproc.hpp
- /usr/include/opencv4/opencv2/cudalegacy.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv4/opencv2/cudaobjdetect.hpp
- /usr/include/opencv4/opencv2/cudaoptflow.hpp
- /usr/include/opencv4/opencv2/cudastereo.hpp
- /usr/include/opencv4/opencv2/cudawarping.hpp
- /usr/include/opencv4/opencv2/cudev/block/block.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv4/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/scan.hpp
- /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv4/opencv2/cudev/common.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/color.hpp
- /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv4/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv4/opencv2/cudev.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv4/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/limits.hpp
- /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv4/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv4/opencv2/cudev/warp/warp.hpp
- # [contrib_cvv]
- /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv4/opencv2/cvv/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv4/opencv2/cvv/dmatch.hpp
- /usr/include/opencv4/opencv2/cvv/filter.hpp
- /usr/include/opencv4/opencv2/cvv/final_show.hpp
- /usr/include/opencv4/opencv2/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv4/opencv2/hdf/hdf5.hpp
- /usr/include/opencv4/opencv2/hdf.hpp
- # [contrib_ovis]
- /usr/include/opencv4/opencv2/ovis.hpp
- # [contrib_sfm]
- /usr/include/opencv4/opencv2/sfm.hpp
- /usr/include/opencv4/opencv2/sfm/conditioning.hpp
- /usr/include/opencv4/opencv2/sfm/fundamental.hpp
- /usr/include/opencv4/opencv2/sfm/io.hpp
- /usr/include/opencv4/opencv2/sfm/numeric.hpp
- /usr/include/opencv4/opencv2/sfm/projection.hpp
- /usr/include/opencv4/opencv2/sfm/reconstruct.hpp
- /usr/include/opencv4/opencv2/sfm/robust.hpp
- /usr/include/opencv4/opencv2/sfm/simple_pipeline.hpp
- /usr/include/opencv4/opencv2/sfm/triangulation.hpp
- # [vtk]
- /usr/include/opencv4/opencv2/viz.hpp
- /usr/include/opencv4/opencv2/viz/types.hpp
- /usr/include/opencv4/opencv2/viz/viz3d.hpp
- /usr/include/opencv4/opencv2/viz/vizcore.hpp
- /usr/include/opencv4/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv4/opencv2/viz/widgets.hpp
-)
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.4.0-disable-download.patch
- "${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
- "${FILESDIR}"/${PN}-4.6.0-fix-build-examples.patch # bug 830163, pending upstream PR #22245
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- # https://bugs.gentoo.org/838274
- replace-flags -O3 -O2
-
- cmake_src_prepare
-
- # remove bundled stuff
- rm -r 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use dnnsamples; then
- mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
- fi
-
- if use contrib; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- if use contribxfeatures2d; then
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
- fi
-
- if use download; then
- mv "${WORKDIR}/${PN}-extdep-4.4.0" "${WORKDIR}/${P}/.cache/" || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # Optional 3rd party components
- # ===================================================
- -DENABLE_DOWNLOAD=$(usex download)
- -DWITH_QUIRC=OFF # Do not have dependencies
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk3)
- -DWITH_GTK_2_X=OFF # only want gtk3 nowadays
- -DWITH_IPP=OFF
- # Jasper was removed from tree because of security problems.
- # Upstream were/are making progress. We use openjpeg instead.
- # bug 734284
- -DWITH_JASPER=OFF
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_OPENJPEG=$(usex jpeg2k)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(multilib_native_usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- # -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
- # -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=$(usex opencvapps ON OFF)
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=OFF
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- -DOPENCV_GENERATE_PKGCONFIG=ON
- # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
- # to set its destination libdir
- -DLIB_SUFFIX=
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- # bug 733796, but PCH is a risky game in CMake anyway
- -DENABLE_PRECOMPILED_HEADERS=OFF
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- -DENABLE_LTO=$(usex lto)
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- -DBUILD_opencv_features2d=$(usex features2d ON OFF)
- )
-
- # ==================================================
- # cpu flags, should solve 633900
- #===================================================
- local CPU_BASELINE=""
- for i in "${CPU_FEATURES_MAP[@]}" ; do
- if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163
- use ${i%:*} && CPU_BASELINE="${CPU_BASELINE}${i#*:};"
- fi
- done
-
- GLOBALCMAKEARGS+=(
- -DOPENCV_CPU_OPT_IMPLIES_IGNORE=ON
- -DCPU_BASELINE=${CPU_BASELINE}
- -DCPU_DISPATCH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contribdnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contribxfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contribcvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contribhdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contribsfm ON OFF)
- -DBUILD_opencv_freetype=$(usex contribfreetype ON OFF)
- -DBUILD_opencv_ovis=$(usex contribovis ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=(
- ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- -DBUILD_opencv_python2=OFF
- -DBUILD_opencv_python3=OFF
- )
-
- cmake_src_configure
-
- # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
- # TODO patch ocv_download to copy files into destination dirs
- if use contribdnn; then
- mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- fi
-
-}
-
-python_module_compile() {
- local BUILD_DIR="${orig_BUILD_DIR}"
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # python_setup alters PATH and sets this as wrapper
- # to the correct interpreter we are building for
- -DPYTHON_DEFAULT_EXECUTABLE=${EPYTHON}
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm CMakeCache.txt || die "rm failed"
- cmake_src_configure
- cmake_src_compile
- cmake_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -r modules/python3 || die "rm failed"
-
- python_optimize "${ED}"/$(python_get_sitedir)
-}
-
-multilib_src_install() {
- cmake_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR="${BUILD_DIR}"
- python_foreach_impl python_module_compile
- fi
-}
diff --git a/media-libs/opencv/opencv-4.8.0.ebuild b/media-libs/opencv/opencv-4.8.0.ebuild
deleted file mode 100644
index 82322d2d67fb..000000000000
--- a/media-libs/opencv/opencv-4.8.0.ebuild
+++ /dev/null
@@ -1,585 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{9..11} )
-inherit flag-o-matic java-pkg-opt-2 java-ant-2 cmake-multilib python-r1 toolchain-funcs
-
-DESCRIPTION="A collection of algorithms and sample code for various computer vision problems"
-HOMEPAGE="https://opencv.org"
-TINY_DNN_PV="1.0.0a3"
-SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
- dnnsamples? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-res10_300x300-caffeemodel.tar.gz )
- download? ( https://github.com/rossbridger/opencv-extdep/archive/4.4.0.tar.gz -> ${PN}-4.4.0_extdep.tar.gz )
- contrib? (
- https://github.com/${PN}/${PN}_contrib/archive/${PV}.tar.gz -> ${P}_contrib.tar.gz
- contribdnn? ( https://dev.gentoo.org/~amynka/snap/${PN}-3.4.0-face_landmark_model.tar.gz )
- contribxfeatures2d? ( https://dev.gentoo.org/~amynka/snap/vgg_boostdesc-3.2.0.tar.gz )
- )"
-
-LICENSE="Apache-2.0"
-SLOT="0/${PV}" # subslot = libopencv* soname version
-KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
-IUSE="contrib contribcvv contribdnn contribfreetype contribhdf contribovis contribsfm contribxfeatures2d cuda debug dnnsamples download +eigen examples +features2d ffmpeg gdal gflags glog gphoto2 gstreamer gtk3 ieee1394 jpeg jpeg2k lapack lto opencl openexr opengl openmp opencvapps png +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine"
-
-# The following lines are shamelessly stolen from ffmpeg-9999.ebuild with modifications
-ARM_CPU_FEATURES=(
- cpu_flags_arm_neon:NEON
- cpu_flags_arm_vfpv3:VFPV3
-)
-PPC_CPU_FEATURES=(
- cpu_flags_ppc_vsx:VSX
- cpu_flags_ppc_vsx3:VSX3
-)
-X86_CPU_FEATURES_RAW=(
- avx:AVX
- avx2:AVX2
- avx512f:AVX_512F
- f16c:FP16
- fma3:FMA3
- popcnt:POPCNT
- sse:SSE
- sse2:SSE2
- sse3:SSE3
- ssse3:SSSE3
- sse4_1:SSE4_1
- sse4_2:SSE4_2
-)
-X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
-CPU_FEATURES_MAP=(
- ${ARM_CPU_FEATURES[@]}
- ${PPC_CPU_FEATURES[@]}
- ${X86_CPU_FEATURES[@]}
-)
-IUSE="${IUSE} ${CPU_FEATURES_MAP[@]%:*}"
-
-# OpenGL needs gtk or Qt installed to activate, otherwise build system
-# will silently disable it Wwithout the user knowing, which defeats the
-# purpose of the opengl use flag.
-# cuda needs contrib, bug #701712
-REQUIRED_USE="
- cpu_flags_x86_avx2? ( cpu_flags_x86_f16c )
- cpu_flags_x86_f16c? ( cpu_flags_x86_avx )
- cuda? ( contrib
- tesseract? ( opencl ) )
- dnnsamples? ( examples )
- gflags? ( contrib )
- glog? ( contrib )
- contribcvv? ( contrib qt5 )
- contribdnn? ( contrib )
- contribfreetype? ( contrib )
- contribhdf? ( contrib )
- contribovis? ( contrib )
- contribsfm? ( contrib eigen gflags glog )
- contribxfeatures2d? ( contrib download )
- examples? ( contribdnn )
- java? ( python )
- opengl? ( qt5 )
- python? ( ${PYTHON_REQUIRED_USE} )
- tesseract? ( contrib )
- ?? ( gtk3 qt5 )"
-
-# The following logic is intrinsic in the build system, but we do not enforce
-# it on the useflags since this just blocks emerging pointlessly:
-# openmp? ( !threads )
-
-RDEPEND="
- app-arch/bzip2[${MULTILIB_USEDEP}]
- <dev-libs/protobuf-23:=[${MULTILIB_USEDEP}]
- sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:0= )
- contribhdf? ( sci-libs/hdf5:= )
- contribfreetype? (
- media-libs/freetype:2[${MULTILIB_USEDEP}]
- media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
- )
- contribovis? ( dev-games/ogre:0/1.12 )
- ffmpeg? ( media-video/ffmpeg:0=[${MULTILIB_USEDEP}] )
- gdal? ( sci-libs/gdal:= )
- gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
- glog? ( dev-cpp/glog:=[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-libs/gst-plugins-base:1.0[${MULTILIB_USEDEP}]
- )
- gtk3? (
- dev-libs/glib:2[${MULTILIB_USEDEP}]
- x11-libs/gtk+:3[${MULTILIB_USEDEP}]
- )
- ieee1394? (
- media-libs/libdc1394:=[${MULTILIB_USEDEP}]
- sys-libs/libraw1394[${MULTILIB_USEDEP}]
- )
- java? ( >=virtual/jre-1.8:* )
- jpeg? ( media-libs/libjpeg-turbo:=[${MULTILIB_USEDEP}] )
- jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
- lapack? (
- virtual/cblas
- >=virtual/lapack-3.10
- )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- openexr? (
- dev-libs/imath:=
- media-libs/openexr:=
- )
- opengl? (
- virtual/opengl[${MULTILIB_USEDEP}]
- virtual/glu[${MULTILIB_USEDEP}]
- )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
- python? (
- ${PYTHON_DEPS}
- dev-python/numpy[${PYTHON_USEDEP}]
- )
- qt5? (
- dev-qt/qtgui:5=
- dev-qt/qtwidgets:5=
- dev-qt/qttest:5=
- dev-qt/qtconcurrent:5=
- opengl? ( dev-qt/qtopengl:5= )
- )
- tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
- threads? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
- tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
- v4l? ( >=media-libs/libv4l-0.8.3[${MULTILIB_USEDEP}] )
- vaapi? ( media-libs/libva[${MULTILIB_USEDEP}] )
- vtk? ( sci-libs/vtk[rendering] )
- webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
- xine? ( media-libs/xine-lib )"
-DEPEND="${RDEPEND}
- eigen? ( >=dev-cpp/eigen-3.3.8-r1:3 )
- java? ( >=virtual/jdk-1.8:* )"
-BDEPEND="virtual/pkgconfig"
-
-MULTILIB_WRAPPED_HEADERS=(
- # [opencv4]
- /usr/include/opencv4/opencv2/cvconfig.h
- /usr/include/opencv4/opencv2/opencv_modules.hpp
- # [cudev]
- /usr/include/opencv4/opencv2/cudaarithm.hpp
- /usr/include/opencv4/opencv2/cudabgsegm.hpp
- /usr/include/opencv4/opencv2/cudacodec.hpp
- /usr/include/opencv4/opencv2/cudafeatures2d.hpp
- /usr/include/opencv4/opencv2/cudafilters.hpp
- /usr/include/opencv4/opencv2/cudaimgproc.hpp
- /usr/include/opencv4/opencv2/cudalegacy.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVBroxOpticalFlow.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVHaarObjectDetection.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCV.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NCVPyramid.hpp
- /usr/include/opencv4/opencv2/cudalegacy/NPP_staging.hpp
- /usr/include/opencv4/opencv2/cudaobjdetect.hpp
- /usr/include/opencv4/opencv2/cudaoptflow.hpp
- /usr/include/opencv4/opencv2/cudastereo.hpp
- /usr/include/opencv4/opencv2/cudawarping.hpp
- /usr/include/opencv4/opencv2/cudev/block/block.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/block/dynamic_smem.hpp
- /usr/include/opencv4/opencv2/cudev/block/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/block/scan.hpp
- /usr/include/opencv4/opencv2/cudev/block/vec_distance.hpp
- /usr/include/opencv4/opencv2/cudev/common.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/binary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/color.hpp
- /usr/include/opencv4/opencv2/cudev/expr/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/expr/expr.hpp
- /usr/include/opencv4/opencv2/cudev/expr/per_element_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/reduction.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_func.hpp
- /usr/include/opencv4/opencv2/cudev/expr/unary_op.hpp
- /usr/include/opencv4/opencv2/cudev/expr/warping.hpp
- /usr/include/opencv4/opencv2/cudev/functional/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/detail/color_cvt.hpp
- /usr/include/opencv4/opencv2/cudev/functional/functional.hpp
- /usr/include/opencv4/opencv2/cudev/functional/tuple_adapter.hpp
- /usr/include/opencv4/opencv2/cudev/grid/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/copy.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/minmaxloc.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_down.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/pyr_up.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_column.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/reduce_to_row.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/detail/transpose.hpp
- /usr/include/opencv4/opencv2/cudev/grid/histogram.hpp
- /usr/include/opencv4/opencv2/cudev/grid/integral.hpp
- /usr/include/opencv4/opencv2/cudev/grid/pyramids.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/grid/reduce_to_vec.hpp
- /usr/include/opencv4/opencv2/cudev/grid/split_merge.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transform.hpp
- /usr/include/opencv4/opencv2/cudev/grid/transpose.hpp
- /usr/include/opencv4/opencv2/cudev.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/constant.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/deriv.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/detail/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/extrapolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/glob.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/gpumat.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/interpolation.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/lut.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/mask.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/remap.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/resize.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/texture.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/traits.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/transform.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/warping.hpp
- /usr/include/opencv4/opencv2/cudev/ptr2d/zip.hpp
- /usr/include/opencv4/opencv2/cudev/util/atomic.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/detail/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/limits.hpp
- /usr/include/opencv4/opencv2/cudev/util/saturate_cast.hpp
- /usr/include/opencv4/opencv2/cudev/util/simd_functions.hpp
- /usr/include/opencv4/opencv2/cudev/util/tuple.hpp
- /usr/include/opencv4/opencv2/cudev/util/type_traits.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_math.hpp
- /usr/include/opencv4/opencv2/cudev/util/vec_traits.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/detail/reduce_key_val.hpp
- /usr/include/opencv4/opencv2/cudev/warp/reduce.hpp
- /usr/include/opencv4/opencv2/cudev/warp/scan.hpp
- /usr/include/opencv4/opencv2/cudev/warp/shuffle.hpp
- /usr/include/opencv4/opencv2/cudev/warp/warp.hpp
- # [contrib_cvv]
- /usr/include/opencv4/opencv2/cvv/call_meta_data.hpp
- /usr/include/opencv4/opencv2/cvv/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/debug_mode.hpp
- /usr/include/opencv4/opencv2/cvv/dmatch.hpp
- /usr/include/opencv4/opencv2/cvv/filter.hpp
- /usr/include/opencv4/opencv2/cvv/final_show.hpp
- /usr/include/opencv4/opencv2/cvv.hpp
- /usr/include/opencv4/opencv2/cvv/show_image.hpp
- # [contrib_hdf]
- /usr/include/opencv4/opencv2/hdf/hdf5.hpp
- /usr/include/opencv4/opencv2/hdf.hpp
- # [contrib_ovis]
- /usr/include/opencv4/opencv2/ovis.hpp
- # [contrib_sfm]
- /usr/include/opencv4/opencv2/sfm.hpp
- /usr/include/opencv4/opencv2/sfm/conditioning.hpp
- /usr/include/opencv4/opencv2/sfm/fundamental.hpp
- /usr/include/opencv4/opencv2/sfm/io.hpp
- /usr/include/opencv4/opencv2/sfm/numeric.hpp
- /usr/include/opencv4/opencv2/sfm/projection.hpp
- /usr/include/opencv4/opencv2/sfm/reconstruct.hpp
- /usr/include/opencv4/opencv2/sfm/robust.hpp
- /usr/include/opencv4/opencv2/sfm/simple_pipeline.hpp
- /usr/include/opencv4/opencv2/sfm/triangulation.hpp
- # [vtk]
- /usr/include/opencv4/opencv2/viz.hpp
- /usr/include/opencv4/opencv2/viz/types.hpp
- /usr/include/opencv4/opencv2/viz/viz3d.hpp
- /usr/include/opencv4/opencv2/viz/vizcore.hpp
- /usr/include/opencv4/opencv2/viz/widget_accessor.hpp
- /usr/include/opencv4/opencv2/viz/widgets.hpp
-)
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.4.0-disable-download.patch
- "${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
- "${FILESDIR}"/${PN}-4.8.0-fix-cuda-12.2.0.patch
-)
-
-pkg_pretend() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
-}
-
-pkg_setup() {
- [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
- java-pkg-opt-2_pkg_setup
-}
-
-src_prepare() {
- # https://bugs.gentoo.org/838274
- replace-flags -O3 -O2
-
- cmake_src_prepare
-
- # remove bundled stuff
- rm -r 3rdparty || die "Removing 3rd party components failed"
- sed -e '/add_subdirectory(.*3rdparty.*)/ d' \
- -i CMakeLists.txt cmake/*cmake || die
-
- if use dnnsamples; then
- mv "${WORKDIR}/res10_300x300_ssd_iter_140000.caffemodel" "${WORKDIR}/${P}/samples/dnn/" || die
- fi
-
- if use contrib; then
- cd "${WORKDIR}/${PN}_contrib-${PV}" || die
- if use contribxfeatures2d; then
- mv "${WORKDIR}"/*.i "${WORKDIR}/${PN}_contrib-${PV}"/modules/xfeatures2d/src/ || die
- fi
- fi
-
- if use download; then
- mv "${WORKDIR}/${PN}-extdep-4.4.0" "${WORKDIR}/${P}/.cache/" || die
- fi
-
- java-pkg-opt-2_src_prepare
-
- # this really belongs in src_prepare() too
- JAVA_ANT_ENCODING="iso-8859-1"
- # set encoding so even this cmake build will pick it up.
- export ANT_OPTS+=" -Dfile.encoding=iso-8859-1"
- java-ant-2_src_configure
-}
-
-multilib_src_configure() {
- # please dont sort here, order is the same as in CMakeLists.txt
- GLOBALCMAKEARGS=(
- # for protobuf
- -DCMAKE_CXX_STANDARD=14
-
- # Optional 3rd party components
- # ===================================================
- -DENABLE_DOWNLOAD=$(usex download)
- -DWITH_QUIRC=OFF # Do not have dependencies
- -DWITH_FLATBUFFERS=OFF # Requires removed third party component
- -DWITH_1394=$(usex ieee1394)
- # -DWITH_AVFOUNDATION=OFF # IOS
- -DWITH_VTK=$(multilib_native_usex vtk)
- -DWITH_EIGEN=$(usex eigen)
- -DWITH_VFW=OFF # Video windows support
- -DWITH_FFMPEG=$(usex ffmpeg)
- -DWITH_GSTREAMER=$(usex gstreamer)
- -DWITH_GSTREAMER_0_10=OFF # Don't want this
- -DWITH_GTK=$(usex gtk3)
- -DWITH_GTK_2_X=OFF # only want gtk3 nowadays
- -DWITH_IPP=OFF
- # Jasper was removed from tree because of security problems.
- # Upstream were/are making progress. We use openjpeg instead.
- # bug 734284
- -DWITH_JASPER=OFF
- -DWITH_JPEG=$(usex jpeg)
- -DWITH_OPENJPEG=$(usex jpeg2k)
- -DWITH_WEBP=$(usex webp)
- -DWITH_OPENEXR=$(multilib_native_usex openexr)
- -DWITH_OPENGL=$(usex opengl)
- -DWITH_OPENVX=OFF
- -DWITH_OPENNI=OFF # Not packaged
- -DWITH_OPENNI2=OFF # Not packaged
- -DWITH_PNG=$(usex png)
- -DWITH_GDCM=OFF
- -DWITH_PVAPI=OFF
- -DWITH_GIGEAPI=OFF
- -DWITH_ARAVIS=OFF
- -DWITH_QT=$(multilib_native_usex qt5 5 OFF)
- -DWITH_WIN32UI=OFF # Windows only
- # -DWITH_QUICKTIME=OFF
- # -DWITH_QTKIT=OFF
- -DWITH_TBB=$(usex threads)
- -DWITH_OPENMP=$(usex openmp)
- -DWITH_CSTRIPES=OFF
- -DWITH_PTHREADS_PF=ON
- -DWITH_TIFF=$(usex tiff)
- -DWITH_UNICAP=OFF # Not packaged
- -DWITH_V4L=$(usex v4l)
- -DWITH_LIBV4L=$(usex v4l)
- # -DWITH_DSHOW=ON # direct show supp
- -DWITH_MSMF=OFF
- -DWITH_XIMEA=OFF # Windows only
- -DWITH_XINE=$(multilib_native_usex xine)
- -DWITH_CLP=OFF
- -DWITH_OPENCL=$(usex opencl)
- -DWITH_OPENCL_SVM=OFF
- -DWITH_OPENCLAMDFFT=$(usex opencl)
- -DWITH_OPENCLAMDBLAS=$(usex opencl)
- -DWITH_DIRECTX=OFF
- -DWITH_INTELPERC=OFF
- -DWITH_IPP_A=OFF
- -DWITH_MATLAB=OFF
- -DWITH_VA=$(usex vaapi)
- -DWITH_VA_INTEL=$(usex vaapi)
- -DWITH_GDAL=$(multilib_native_usex gdal)
- -DWITH_GPHOTO2=$(usex gphoto2)
- -DWITH_LAPACK=$(multilib_native_usex lapack)
- -DWITH_ITT=OFF # 3dparty libs itt_notify
- # ===================================================
- # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
- # ===================================================
- -DWITH_CUDA=$(multilib_native_usex cuda)
- -DWITH_CUBLAS=$(multilib_native_usex cuda)
- -DWITH_CUFFT=$(multilib_native_usex cuda)
- -DWITH_NVCUVID=OFF
- # -DWITH_NVCUVID=$(usex cuda)
- -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")
- # ===================================================
- # OpenCV build components
- # ===================================================
- -DBUILD_SHARED_LIBS=ON
- -DBUILD_JAVA=$(multilib_native_usex java) # Ant needed, no compile flag
- -DBUILD_ANDROID_EXAMPLES=OFF
- -DBUILD_opencv_apps=$(usex opencvapps ON OFF)
- -DBUILD_DOCS=OFF # Doesn't install anyways.
- -DBUILD_EXAMPLES=$(multilib_native_usex examples)
- -DBUILD_PERF_TESTS=OFF
- -DBUILD_TESTS=$(multilib_native_usex testprograms)
- -DBUILD_WITH_DEBUG_INFO=$(usex debug)
- # -DBUILD_WITH_STATIC_CRT=OFF
- -DBUILD_WITH_DYNAMIC_IPP=OFF
- -DBUILD_FAT_JAVA_LIB=OFF
- # -DBUILD_ANDROID_SERVICE=OFF
- -DBUILD_CUDA_STUBS=$(multilib_native_usex cuda)
- -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${PV}/modules" "")
- # ===================================================
- # OpenCV installation options
- # ===================================================
- -DINSTALL_CREATE_DISTRIB=OFF
- -DINSTALL_C_EXAMPLES=$(multilib_native_usex examples)
- -DINSTALL_TESTS=$(multilib_native_usex testprograms)
- -DINSTALL_PYTHON_EXAMPLES=$(multilib_native_usex examples)
- # -DINSTALL_ANDROID_EXAMPLES=OFF
- -DINSTALL_TO_MANGLED_PATHS=OFF
- -DOPENCV_GENERATE_PKGCONFIG=ON
- # opencv uses both ${CMAKE_INSTALL_LIBDIR} and ${LIB_SUFFIX}
- # to set its destination libdir
- -DLIB_SUFFIX=
- # ===================================================
- # OpenCV build options
- # ===================================================
- -DENABLE_CCACHE=OFF
- # bug 733796, but PCH is a risky game in CMake anyway
- -DENABLE_PRECOMPILED_HEADERS=OFF
- -DENABLE_SOLUTION_FOLDERS=OFF
- -DENABLE_PROFILING=OFF
- -DENABLE_COVERAGE=OFF
-
- -DHAVE_opencv_java=$(multilib_native_usex java YES NO)
- -DENABLE_NOISY_WARNINGS=OFF
- -DOPENCV_WARNINGS_ARE_ERRORS=OFF
- -DENABLE_IMPL_COLLECTION=OFF
- -DENABLE_INSTRUMENTATION=OFF
- -DGENERATE_ABI_DESCRIPTOR=OFF
- -DDOWNLOAD_EXTERNAL_TEST_DATA=OFF
- -DENABLE_LTO=$(usex lto)
- # ===================================================
- # things we want to be hard off or not yet figured out
- # ===================================================
- -DBUILD_PACKAGE=OFF
- # ===================================================
- # Not building protobuf but update files bug #631418
- # ===================================================
- -DBUILD_PROTOBUF=OFF
- -DPROTOBUF_UPDATE_FILES=ON
- # ===================================================
- # things we want to be hard enabled not worth useflag
- # ===================================================
- -DCMAKE_SKIP_RPATH=ON
- -DOPENCV_DOC_INSTALL_PATH=
- -DBUILD_opencv_features2d=$(usex features2d ON OFF)
- )
-
- # ==================================================
- # cpu flags, should solve 633900
- #===================================================
- local CPU_BASELINE=""
- for i in "${CPU_FEATURES_MAP[@]}" ; do
- if [[ ${ABI} != x86 || ${i%:*} != "cpu_flags_x86_avx2" ]]; then # workaround for Bug 747163
- use ${i%:*} && CPU_BASELINE="${CPU_BASELINE}${i#*:};"
- fi
- done
-
- GLOBALCMAKEARGS+=(
- -DOPENCV_CPU_OPT_IMPLIES_IGNORE=ON
- -DCPU_BASELINE=${CPU_BASELINE}
- -DCPU_DISPATCH=
- )
-
- # ===================================================
- # OpenCV Contrib Modules
- # ===================================================
- if use contrib; then
- GLOBALCMAKEARGS+=(
- -DBUILD_opencv_dnn=$(usex contribdnn ON OFF)
- -DTINYDNN_ROOT="${WORKDIR}/tiny-dnn-${TINY_DNN_PV}"
- -DBUILD_opencv_dnns_easily_fooled=OFF
- -DBUILD_opencv_xfeatures2d=$(usex contribxfeatures2d ON OFF)
- -DBUILD_opencv_cvv=$(usex contribcvv ON OFF)
- -DBUILD_opencv_hdf=$(multilib_native_usex contribhdf ON OFF)
- -DBUILD_opencv_sfm=$(usex contribsfm ON OFF)
- -DBUILD_opencv_freetype=$(usex contribfreetype ON OFF)
- -DBUILD_opencv_ovis=$(usex contribovis ON OFF)
- )
-
- if multilib_is_native_abi; then
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract)
- )
- else
- GLOBALCMAKEARGS+=(
- -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=ON
- )
- fi
- fi
-
- # workaround for bug 413429
- tc-export CC CXX
-
- local mycmakeargs=(
- ${GLOBALCMAKEARGS[@]}
- -DPYTHON_EXECUTABLE=OFF
- -DINSTALL_PYTHON_EXAMPLES=OFF
- -DBUILD_opencv_python2=OFF
- -DBUILD_opencv_python3=OFF
- )
-
- cmake_src_configure
-
- # Copy face_land_model to ${CMAKE_BINARY_DIR}/${OPENCV_TEST_DATA_INSTALL_PATH}
- # TODO patch ocv_download to copy files into destination dirs
- if use contribdnn; then
- mkdir -p "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- cp "${WORKDIR}"/face_landmark_model.dat "${BUILD_DIR}"/share/OpenCV/testdata/cv/face/ || die
- fi
-
-}
-
-python_module_compile() {
- local BUILD_DIR="${orig_BUILD_DIR}"
- local mycmakeargs=( ${GLOBALCMAKEARGS[@]} )
-
- # Set all python variables to load the correct Gentoo paths
- mycmakeargs+=(
- # python_setup alters PATH and sets this as wrapper
- # to the correct interpreter we are building for
- -DPYTHON_DEFAULT_EXECUTABLE=${EPYTHON}
- -DINSTALL_PYTHON_EXAMPLES=$(usex examples)
- )
-
- # Regenerate cache file. Can't use rebuild_cache as it won't
- # have the Gentoo specific options.
- rm CMakeCache.txt || die "rm failed"
- cmake_src_configure
- cmake_src_compile
- cmake_src_install
-
- # Remove compiled binary so new version compiles
- # Avoid conflicts with new module builds as build system doesn't
- # really support it.
- rm -r modules/python3 || die "rm failed"
-
- python_optimize "${ED}"/$(python_get_sitedir)
-}
-
-multilib_src_install() {
- cmake_src_install
-
- # Build and install the python modules for all targets
- if multilib_is_native_abi && use python; then
- local orig_BUILD_DIR="${BUILD_DIR}"
- python_foreach_impl python_module_compile
- fi
-}
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2024-01-10 12:41 Sam James
0 siblings, 0 replies; 20+ messages in thread
From: Sam James @ 2024-01-10 12:41 UTC (permalink / raw
To: gentoo-commits
commit: 75eee21436198227c02ae33e67d718c626cc2646
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Jan 5 21:20:25 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 10 12:41:01 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75eee214
media-libs/opencv: 4.8.0-r1 drop broken protobuf patch
This might be the cause for runtime failures.
Bug: https://bugs.gentoo.org/916189
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/34663
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../opencv/files/opencv-4.8.0-fix-protobuf.patch | 20 --------------------
...opencv-4.8.0-r1.ebuild => opencv-4.8.0-r2.ebuild} | 3 +--
2 files changed, 1 insertion(+), 22 deletions(-)
diff --git a/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch b/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch
deleted file mode 100644
index 937e00e0c024..000000000000
--- a/media-libs/opencv/files/opencv-4.8.0-fix-protobuf.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/cmake/OpenCVFindProtobuf.cmake
-+++ b/cmake/OpenCVFindProtobuf.cmake
-@@ -31,7 +31,7 @@ if(BUILD_PROTOBUF)
- set(HAVE_PROTOBUF TRUE)
- else()
- unset(Protobuf_VERSION CACHE)
-- find_package(Protobuf QUIET)
-+ find_package(protobuf)
-
- # Backwards compatibility
- # Define camel case versions of input variables
-@@ -50,7 +50,7 @@ else()
- endforeach()
- # end of compatibility block
-
-- if(Protobuf_FOUND)
-+ if(protobuf_FOUND)
- if(TARGET protobuf::libprotobuf)
- set(Protobuf_LIBRARIES "protobuf::libprotobuf")
- else()
diff --git a/media-libs/opencv/opencv-4.8.0-r1.ebuild b/media-libs/opencv/opencv-4.8.0-r2.ebuild
similarity index 99%
rename from media-libs/opencv/opencv-4.8.0-r1.ebuild
rename to media-libs/opencv/opencv-4.8.0-r2.ebuild
index e5f917168501..2671f7fab885 100644
--- a/media-libs/opencv/opencv-4.8.0-r1.ebuild
+++ b/media-libs/opencv/opencv-4.8.0-r2.ebuild
@@ -87,7 +87,7 @@ REQUIRED_USE="
RDEPEND="
app-arch/bzip2[${MULTILIB_USEDEP}]
- dev-libs/protobuf:=[${MULTILIB_USEDEP}]
+ <dev-libs/protobuf-23:=[${MULTILIB_USEDEP}]
sys-libs/zlib[${MULTILIB_USEDEP}]
cuda? ( dev-util/nvidia-cuda-toolkit:0= )
contribdnn? ( dev-libs/flatbuffers:= )
@@ -292,7 +292,6 @@ PATCHES=(
"${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
- "${FILESDIR}"/${PN}-4.8.0-fix-protobuf.patch
"${FILESDIR}"/${PN}-4.8.0-fix-flatbuffer.patch
"${FILESDIR}"/${PN}-4.8.0-arm64-fp16.patch
"${FILESDIR}"/${PN}-4.8.0-fix-cuda-12.2.0.patch
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/
@ 2024-04-26 19:49 Andrew Ammerlaan
0 siblings, 0 replies; 20+ messages in thread
From: Andrew Ammerlaan @ 2024-04-26 19:49 UTC (permalink / raw
To: gentoo-commits
commit: 4edaafa9cf27632b52d1cd385621943c12cb58f9
Author: Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Apr 26 15:41:05 2024 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Fri Apr 26 19:49:13 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4edaafa9
media-libs/opencv: limit cuda-12.4 again
Still requires fixes from https://github.com/NVIDIA/cccl/pull/1522
Bug: https://bugs.gentoo.org/928747
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36437
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
...v-4.9.0-cuda-12.4.patch => opencv_contrib-4.9.0-cuda-12.4.patch} | 0
media-libs/opencv/opencv-4.9.0.ebuild | 6 +++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/media-libs/opencv/files/opencv-4.9.0-cuda-12.4.patch b/media-libs/opencv/files/opencv_contrib-4.9.0-cuda-12.4.patch
similarity index 100%
rename from media-libs/opencv/files/opencv-4.9.0-cuda-12.4.patch
rename to media-libs/opencv/files/opencv_contrib-4.9.0-cuda-12.4.patch
diff --git a/media-libs/opencv/opencv-4.9.0.ebuild b/media-libs/opencv/opencv-4.9.0.ebuild
index 36bf72aa8718..dbf8b20165fd 100644
--- a/media-libs/opencv/opencv-4.9.0.ebuild
+++ b/media-libs/opencv/opencv-4.9.0.ebuild
@@ -145,7 +145,7 @@ RDEPEND="
app-arch/bzip2[${MULTILIB_USEDEP}]
dev-libs/protobuf:=[${MULTILIB_USEDEP}]
sys-libs/zlib[${MULTILIB_USEDEP}]
- cuda? ( dev-util/nvidia-cuda-toolkit:= )
+ cuda? ( <dev-util/nvidia-cuda-toolkit-12.4:0= )
cudnn? ( dev-libs/cudnn:= )
contribdnn? ( dev-libs/flatbuffers:= )
contribhdf? ( sci-libs/hdf5:= )
@@ -341,6 +341,10 @@ src_prepare() {
cd "${WORKDIR}/${PN}_contrib-${PV}" || die
eapply "${FILESDIR}/${PN}_contrib-4.8.1-rgbd.patch"
eapply "${FILESDIR}/${PN}_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch"
+ if has_version ">=dev-util/nvidia-cuda-toolkit-12.4" && use cuda; then
+ # TODO https://github.com/NVIDIA/cccl/pull/1522
+ eapply "${FILESDIR}/${PN}_contrib-4.9.0-cuda-12.4.patch"
+ fi
cd "${S}" || die
! use contribcvv && { rm -R "${WORKDIR}/${PN}_contrib-${PV}/modules/cvv" || die; }
^ permalink raw reply related [flat|nested] 20+ messages in thread
end of thread, other threads:[~2024-04-26 19:49 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 22:37 [gentoo-commits] repo/gentoo:master commit in: media-libs/opencv/files/, media-libs/opencv/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-04-26 19:49 Andrew Ammerlaan
2024-01-10 12:41 Sam James
2024-01-03 21:28 Andreas Sturmlechner
2022-10-15 0:44 Sam James
2021-12-03 0:54 Sam James
2020-06-25 17:08 Andreas Sturmlechner
2019-12-07 19:39 Amy Liffey
2019-08-10 20:15 Alexey Shvetsov
2019-01-16 19:46 Amy Liffey
2019-01-14 22:23 Amy Liffey
2018-05-31 17:24 Amy Liffey
2018-05-25 19:26 Amy Liffey
2018-01-21 8:36 Amy Liffey
2017-07-27 18:54 Amy Liffey
2017-07-27 18:42 Amy Liffey
2016-09-27 14:22 Amy Winston
2016-06-09 13:54 Amy Winston
2016-04-07 17:39 Amy Winston
2016-02-25 13:35 Amy Winston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox