diff options
author | dracwyrm <j.scruggs@gmail.com> | 2016-06-09 13:52:00 +0100 |
---|---|---|
committer | Amy Winston <amynka@gentoo.org> | 2016-06-09 15:52:29 +0200 |
commit | cf149b0c51363346080559b66a540c956cfd05aa (patch) | |
tree | 2297df56aab578dd129a7b6b9bc118ab9d0fc124 /media-libs/opencv/files | |
parent | media-gfx/arss: revision bump (diff) | |
download | gentoo-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/files')
3 files changed, 150 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() + |