summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordracwyrm <j.scruggs@gmail.com>2016-06-09 13:52:00 +0100
committerAmy Winston <amynka@gentoo.org>2016-06-09 15:52:29 +0200
commitcf149b0c51363346080559b66a540c956cfd05aa (patch)
tree2297df56aab578dd129a7b6b9bc118ab9d0fc124 /media-libs/opencv
parentmedia-gfx/arss: revision bump (diff)
downloadgentoo-cf149b0c51363346080559b66a540c956cfd05aa.tar.gz
gentoo-cf149b0c51363346080559b66a540c956cfd05aa.tar.bz2
gentoo-cf149b0c51363346080559b66a540c956cfd05aa.zip
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
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-gentooify-python.patch101
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-git-autodetect.patch4
-rw-r--r--media-libs/opencv/files/opencv-3.1.0-java-magic.patch47
-rw-r--r--media-libs/opencv/opencv-3.1.0-r4.ebuild269
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 000000000000..7bb01b455f09
--- /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 e4fa2871a06e..f4bf0da2cc92 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 000000000000..96a0e7e7053f
--- /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 000000000000..d83ba38f1ace
--- /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
+}