diff options
author | Jonathan Scruggs <j.scruggs@gmail.com> | 2016-11-07 12:47:07 +0000 |
---|---|---|
committer | Amy Winston <amynka@gentoo.org> | 2016-11-08 07:51:30 +0100 |
commit | 7701033807a21a0c5c52780efa1a1b059e3e9b95 (patch) | |
tree | 6d796d357800c369aec1e9ceb03c2fcb5512707c /media-libs | |
parent | c72212ddb52e6125bf1ab29fb3571dbe888cef9c (diff) | |
download | gentoo-7701033807a21a0c5c52780efa1a1b059e3e9b95.tar.gz gentoo-7701033807a21a0c5c52780efa1a1b059e3e9b95.tar.xz |
media-libs/opencv: revision bump to 3.1.0-r6
* Update SRC_URI to the new URLs
* Switch to downloading the tar.gz instead zip file
* Add git hash to end of contrib download to allow revision bumps
* Updated revision of contrib modules to fix various errors
* Remove Qt 4 support to follow the new Gentoo standard
* Use new OpenMP test logic
* Added patch to build against CUDA v8.
Patch based on one submitted by Sven Eden
Gentoo-bug: 598674
Gentoo-bug: 597754
* Added Tesseract use flag and fixed building against it.
Gentoo-bug: 572836
Gentoo-bug: 584428
* Added use flag for the SFM module because of dependencies
on several Google libraries
Gentoo-bug: 597166
* Added use flag for the HDF module because of a dependency
on media-libs/hdaf5
Gentoo-bug: 596212
* Added use flag for the CVV module because it will silently
fail if Qt 5 is not installed.
* Added patch to fix the finding of certain libraries
Gentoo-Bug: 584478
Signed-off by: Jonathan Scruggs (j.scruggs@gmail.com)
Diffstat (limited to 'media-libs')
-rw-r--r-- | media-libs/opencv/Manifest | 2 | ||||
-rw-r--r-- | media-libs/opencv/files/opencv-3.1.0-find-libraries-fix.patch | 48 | ||||
-rw-r--r-- | media-libs/opencv/files/opencv-3.1.0-remove-graphcut-for-cuda-8.patch | 23 | ||||
-rw-r--r-- | media-libs/opencv/metadata.xml | 6 | ||||
-rw-r--r-- | media-libs/opencv/opencv-3.1.0-r6.ebuild | 296 |
5 files changed, 375 insertions, 0 deletions
diff --git a/media-libs/opencv/Manifest b/media-libs/opencv/Manifest index 82a9d48a6ea..624ef49cfcd 100644 --- a/media-libs/opencv/Manifest +++ b/media-libs/opencv/Manifest @@ -1,5 +1,7 @@ DIST opencv-2.4.12.zip 93261101 SHA256 2a7e47da87b9119be922f010a1059539e96130c242f4d38e2dbb445ccbeccbc1 SHA512 3f9142ef23181f93200413b456c11235ecac11c322ccf3f89cc3740bfa9d9228508948cee245583103029e9f6abf1c5d0c5d249eff400e65b3655153bc6dbb05 WHIRLPOOL 86488d91cfac4c980e4f794d6d7e40bf93803f4d79defc991647af742198b845db796b1578b5d79a12a71ecbb04d8430a49c1538d6f86f1288c2a31efefc2548 DIST opencv-3.0.0.zip 100980799 SHA256 07094ea2f996f2622d572f0f3a162d698c8a547520341ca9109fbaf9363fb001 SHA512 108d0fdcc60b5688ebf61c930fb965ec81f0d3c36bb1797f6cc571fac35331f540773207fd1cb81b12c05c8f4d1af20c4a2452d9f75cd0cae4acd8131be92375 WHIRLPOOL 61cbbf5201b1dea75ffa998d1f55ee35f098bb8f76591cc9705de13b9f05eaefd19dcc74e93d2643d9b721e62483a36547617ec2e3d14fa6a2522e18ccf06747 +DIST opencv-3.1.0.tar.gz 76135587 SHA256 f00b3c4f42acda07d89031a2ebb5ebe390764a133502c03a511f67b78bbd4fbf SHA512 57e0fe41e3d5d1dc036e7fc5673523e53d54f5f62e4d3bcb95238a9cd53e79da7c1704dc136ce632f7cfce369ebf5eb27f629a9b6ac4f7fa34120b80b5c7438f WHIRLPOOL b2825d5cafa87e0fe9cacd093ddb969913d916c0370819073b2bde3c598798efcf23c406aae2116f2628c564ca99e5f871a448a3ece97d8d29ec73841ac283b4 DIST opencv-3.1.0.zip 79186131 SHA256 1f6990249fdb82804fff40e96fa6d99949023ab0e3277eae4bd459b374e622a4 SHA512 b4915e8838fce8ba9e1af8b11e46678624435e9a41592e645413dfdc830993eaa017d337fe4c212a49f096421a6317a1892546087fbc3cfdab554522336c0f1a WHIRLPOOL 3c38715e2abc431781b724199c2cf06f844c7a889c51a06ecb64889a8ca36d9fd370a0738deec2995e24e453cb64f5db228238681714f62daf6eac50d95a4914 +DIST opencv-3.1.0_contrib-75b3ea9.tar.gz 54277105 SHA256 478f742457d3f4e96f857b726e35b28a8d20a1de8e5f51b8671251bc896d443b SHA512 d1d11520b8729fbaf0257c927654251ff9ac1ba5cf937af9dd973ec39f483d1ee08aff7ad3f1a9941fef921a35dc466ac5574918197ddecd3f6c66b682bf671a WHIRLPOOL 18b70014428c4fa532658ca5ac332bffaae049b468f46cb027a6972f21f5b2bd17d02b33d68c43b84f821a77fa09efb9c372499cfa4f645a0516b93acb858353 DIST opencv-3.1.0_contrib.zip 55182211 SHA256 5082b5df7179ff71f4681747c482169f0d5d5b77605816cfe5b93c588021fbb4 SHA512 f0ceb8d9ed85efe948a40071793d164a82391a462c52ca71a6029e8b119afdab8b1453baaed2cd7d540001559849a62ec4b745d41345db225acff0531c76e762 WHIRLPOOL 589294c849a00426f4c52d07ab652e71e8bbc74efd0878fbaea2e089051fd118217b1a04f33258fcef2abe1729147282eb17a98c5463691aa3fd56af264ea6a0 DIST opencv_contrib.zip 76144299 SHA256 ba780e61e9659aac299055d68c9fe40258e3fab7cb167892163eb5732387c4bb SHA512 9253a9d209368da5bea5f0138c55379132467b840d25fc5eaa1bc0103e6da61d6facf206456ff3f4bb68482d9c6381e23a566cb4dd155ac9ff9a259e54f7ffbf WHIRLPOOL 411febd3d5912ea28b570b217e3af41bee2d48daf5f47b0de6125b40cfbf435216c668545b3e0dfa48e4eef8d4a86135058ee72dc7b5a4244b661130a6916843 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 new file mode 100644 index 00000000000..52f4db6b311 --- /dev/null +++ b/media-libs/opencv/files/opencv-3.1.0-find-libraries-fix.patch @@ -0,0 +1,48 @@ +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-remove-graphcut-for-cuda-8.patch b/media-libs/opencv/files/opencv-3.1.0-remove-graphcut-for-cuda-8.patch new file mode 100644 index 00000000000..64761a263a1 --- /dev/null +++ b/media-libs/opencv/files/opencv-3.1.0-remove-graphcut-for-cuda-8.patch @@ -0,0 +1,23 @@ +From 10896129b39655e19e4e7c529153cb5c2191a1db Mon Sep 17 00:00:00 2001 +From: Vladislav Vinogradov <vlad.vinogradov@itseez.com> +Date: Fri, 6 May 2016 11:37:32 +0300 +Subject: [PATCH] GraphCut deprecated in CUDA 7.5 and removed in 8.0 + +--- + modules/cudalegacy/src/graphcuts.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules/cudalegacy/src/graphcuts.cpp b/modules/cudalegacy/src/graphcuts.cpp +index eb08c3c..1a1eb85 100644 +--- a/modules/cudalegacy/src/graphcuts.cpp ++++ b/modules/cudalegacy/src/graphcuts.cpp +@@ -42,7 +42,8 @@ + + #include "precomp.hpp" + +-#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) ++// GraphCut has been removed in NPP 8.0 ++#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000) + + void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } + void cv::cuda::graphcut(GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, Stream&) { throw_no_cuda(); } diff --git a/media-libs/opencv/metadata.xml b/media-libs/opencv/metadata.xml index fe2e2d90c83..bc331e3339c 100644 --- a/media-libs/opencv/metadata.xml +++ b/media-libs/opencv/metadata.xml @@ -24,8 +24,14 @@ Face Recognition; Gesture Recognition; Motion Tracking, Ego Motion, Motion Under <flag name="cuda">Enable NVIDIA Cuda computations support</flag> <flag name="eigen">Enable usage of <pkg>dev-cpp/eigen</pkg> for computations</flag> <flag name="gdal">Enable support for sci-libs/gdal library</flag> + <flag restrict=">=media-libs/opencv-3.1.0" name="gflags">Use Google's C++ argument parsing library</flag> + <flag restrict=">=media-libs/opencv-3.1.0" name="glog">Use Google's C++ loggin library</flag> <flag name="ipp">Enable Intel Integrated Primitive support</flag> + <flag restrict=">=media-libs/opencv-3.1.0" name="contrib_cvv">CVV module requires Qt5</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> + <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> <flag name="vtk">Build new 3D visualization module viz based on sci-libs/vtk</flag> <flag name="webp">Enable support for webp image format</flag> diff --git a/media-libs/opencv/opencv-3.1.0-r6.ebuild b/media-libs/opencv/opencv-3.1.0-r6.ebuild new file mode 100644 index 00000000000..a6adf6f915e --- /dev/null +++ b/media-libs/opencv/opencv-3.1.0-r6.ebuild @@ -0,0 +1,296 @@ +# 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" + +BASE_URI="https://github.com/${PN}/${PN}" +#commit from Thu, 02 Jun 2016 +CONTRIB_URI="75b3ea9f72fdb083140fc63855b7677d67748376" +CONTRIB_P="${P}_contrib-${CONTRIB_URI:0:7}" + +SRC_URI="${BASE_URI}/archive/${PV}.tar.gz -> ${P}.tar.gz + contrib? ( ${BASE_URI}_contrib/archive/${CONTRIB_URI}.tar.gz -> ${CONTRIB_P}.tar.gz )" +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 gflags glog gphoto2 gstreamer gtk \ + ieee1394 ipp jpeg jpeg2k libav opencl openexr opengl openmp pch png \ + +python qt5 tesseract testprograms threads tiff vaapi v4l vtk webp xine \ + contrib_cvv contrib_hdf contrib_sfm" + +# 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 + 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 ) + gflags? ( dev-cpp/gflags ) + glog? ( dev-cpp/glog ) + 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 ) + contrib_hdf? ( sci-libs/hdf5 ) + 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}] ) + 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 ) + 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}"/${P}-cmake-no-opengl.patch + "${FILESDIR}"/${P}-git-autodetect.patch + "${FILESDIR}"/${P}-java-magic.patch + "${FILESDIR}"/${P}-gentooify-python.patch + "${FILESDIR}"/${P}-remove-graphcut-for-cuda-8.patch + "${FILESDIR}"/${P}-find-libraries-fix.patch +) + +GLOBALCMAKEARGS=() + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + java-pkg-opt-2_pkg_setup +} + +src_prepare() { + default + + # remove bundled stuff + rm -rf 3rdparty || die "Removing 3rd party components failed" + sed -e '/add_subdirectory(.*3rdparty.*)/ d' \ + -i CMakeLists.txt cmake/*cmake || 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 + 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 + -DWITH_QT=$(usex qt5 5 OFF) + -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=OFF + -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) + -DOPENCV_EXTRA_MODULES_PATH=$(usex contrib "${WORKDIR}/opencv_contrib-${CONTRIB_URI}/modules" "") + # =================================================== + # 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= + ) + + # =================================================== + # OpenCV Contrib Modules + # =================================================== + if use contrib; then + GLOBALCMAKEARGS+=( + -DBUILD_opencv_dnn=OFF + -DBUILD_opencv_dnns_easily_fooled=OFF + -DBUILD_opencv_cvv=$(usex contrib_cvv ON OFF) + -DBUILD_opencv_hdf=$(usex contrib_hdf ON OFF) + -DBUILD_opencv_sfm=$(usex contrib_sfm ON OFF) + ) + fi + + # 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="" + -DINSTALL_PYTHON_EXAMPLES=$(usex examples) + ) + + # 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 + 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. + 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 +} |