diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-01-10 13:02:42 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-01-10 13:02:42 +0000 |
commit | 8c8f1cfd2aa9e839aad7dad6fd43b370cfbc0a1e (patch) | |
tree | f7b0f94c13a0454ed75b614028f1455e894f28d2 /media-libs/opencv/files | |
parent | 47f05d092ef8c19b3e973f62648e58c0e1a18631 (diff) |
gentoo auto-resync : 10:01:2024 - 13:02:42
Diffstat (limited to 'media-libs/opencv/files')
10 files changed, 274 insertions, 0 deletions
diff --git a/media-libs/opencv/files/opencv-4.8.1-ade-0.1.2a.tar.gz.patch b/media-libs/opencv/files/opencv-4.8.1-ade-0.1.2a.tar.gz.patch new file mode 100644 index 000000000000..056553695ee2 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-ade-0.1.2a.tar.gz.patch @@ -0,0 +1,18 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Use tar.gz instead of zip to make CI happy. + +diff --git a/modules/gapi/cmake/DownloadADE.cmake b/modules/gapi/cmake/DownloadADE.cmake +index e22c4f1..fb0c10a 100644 +--- a/modules/gapi/cmake/DownloadADE.cmake ++++ b/modules/gapi/cmake/DownloadADE.cmake +@@ -1,7 +1,7 @@ + set(ade_src_dir "${OpenCV_BINARY_DIR}/3rdparty/ade") +-set(ade_filename "v0.1.2a.zip") ++set(ade_filename "v0.1.2a.tar.gz") + set(ade_subdir "ade-0.1.2a") +-set(ade_md5 "fa4b3e25167319cb0fa9432ef8281945") ++set(ade_md5 "89fd5f32c2796d3fecf62273c4aa7c4d") + ocv_download(FILENAME ${ade_filename} + HASH ${ade_md5} + URL diff --git a/media-libs/opencv/files/opencv-4.8.1-drop-python2-detection.patch b/media-libs/opencv/files/opencv-4.8.1-drop-python2-detection.patch new file mode 100644 index 000000000000..5a3a89f665b4 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-drop-python2-detection.patch @@ -0,0 +1,23 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Python2 is long gone. So don't try finding it. + +diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake +index 599b2eb..345e3ef 100644 +--- a/cmake/OpenCVDetectPython.cmake ++++ b/cmake/OpenCVDetectPython.cmake +@@ -268,14 +268,6 @@ if(OPENCV_PYTHON_SKIP_DETECTION) + return() + endif() + +-find_python("" "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR +- 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 PYTHON2_NUMPY_VERSION) +- + option(OPENCV_PYTHON3_VERSION "Python3 version" "") + find_python("${OPENCV_PYTHON3_VERSION}" "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR + PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING diff --git a/media-libs/opencv/files/opencv-4.8.1-eliminate-lto-compiler-warnings.patch b/media-libs/opencv/files/opencv-4.8.1-eliminate-lto-compiler-warnings.patch new file mode 100644 index 000000000000..7d6a5456a63f --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-eliminate-lto-compiler-warnings.patch @@ -0,0 +1,36 @@ +https://github.com/opencv/opencv/pull/23991 + +From 4ee0f212cc19f7e77483d34d4cf8378945e3da31 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E4=B8=8D=E9=B1=BC=E5=84=BF?= + <36976072+buyuer@users.noreply.github.com> +Date: Fri, 14 Jul 2023 08:45:14 +0000 +Subject: [PATCH] Eliminating compilation warnings when using lto in gcc12 and + later versions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +use -flto=auto when use gcc12 or later + +Signed-off-by: 不鱼儿 <36976072+buyuer@users.noreply.github.com> +--- + cmake/OpenCVCompilerOptions.cmake | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake +index d4600943fb0d..8bd86681303e 100644 +--- a/cmake/OpenCVCompilerOptions.cmake ++++ b/cmake/OpenCVCompilerOptions.cmake +@@ -261,7 +261,11 @@ if(CV_GCC OR CV_CLANG) + endif() + + if(ENABLE_LTO) +- add_extra_compiler_option(-flto) ++ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12) ++ add_extra_compiler_option(-flto=auto) ++ else() ++ add_extra_compiler_option(-flto) ++ endif() + endif() + if(ENABLE_THIN_LTO) + add_extra_compiler_option(-flto=thin) diff --git a/media-libs/opencv/files/opencv-4.8.1-libpng16.patch b/media-libs/opencv/files/opencv-4.8.1-libpng16.patch new file mode 100644 index 000000000000..a5b2aedb063a --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-libpng16.patch @@ -0,0 +1,58 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Gentoo installs libpng as libpng16, so adjust the detection. + +diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake +index 46b5108..0ff88ea 100644 +--- a/cmake/OpenCVFindLibsGrfmt.cmake ++++ b/cmake/OpenCVFindLibsGrfmt.cmake +@@ -245,9 +245,9 @@ if(NOT HAVE_SPNG AND WITH_PNG) + include(FindPNG) + if(PNG_FOUND) + include(CheckIncludeFile) +- check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H) +- if(HAVE_LIBPNG_PNG_H) +- ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE) ++ check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng16/png.h" HAVE_LIBPNG16_PNG_H) ++ if(HAVE_LIBPNG16_PNG_H) ++ ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng16/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE) + else() + ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE) + endif() +@@ -255,7 +255,7 @@ if(NOT HAVE_SPNG AND WITH_PNG) + endif() + + if(NOT PNG_FOUND) +- ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_PNG_INCLUDE_DIR HAVE_LIBPNG_PNG_H PNG_DEFINITIONS) ++ ocv_clear_vars(PNG_LIBRARY PNG_LIBRARIES PNG_INCLUDE_DIR PNG_PNG_INCLUDE_DIR HAVE_LIBPNG16_PNG_H PNG_DEFINITIONS) + + set(PNG_LIBRARY libpng CACHE INTERNAL "") + set(PNG_LIBRARIES ${PNG_LIBRARY}) +diff --git a/cmake/templates/cvconfig.h.in b/cmake/templates/cvconfig.h.in +index d6c7875..005e9b3 100644 +--- a/cmake/templates/cvconfig.h.in ++++ b/cmake/templates/cvconfig.h.in +@@ -79,7 +79,7 @@ + #cmakedefine HAVE_JPEG + + /* libpng/png.h needs to be included */ +-#cmakedefine HAVE_LIBPNG_PNG_H ++#cmakedefine HAVE_LIBPNG16_PNG_H + + /* GDCM DICOM codec */ + #cmakedefine HAVE_GDCM +diff --git a/modules/imgcodecs/src/grfmt_png.cpp b/modules/imgcodecs/src/grfmt_png.cpp +index 388a3fc..4dde181 100644 +--- a/modules/imgcodecs/src/grfmt_png.cpp ++++ b/modules/imgcodecs/src/grfmt_png.cpp +@@ -58,8 +58,8 @@ + # define _FILE_OFFSET_BITS 0 + #endif + +-#ifdef HAVE_LIBPNG_PNG_H +-#include <libpng/png.h> ++#ifdef HAVE_LIBPNG16_PNG_H ++#include <libpng16/png.h> + #else + #include <png.h> + #endif diff --git a/media-libs/opencv/files/opencv-4.8.1-opencv_test.patch b/media-libs/opencv/files/opencv-4.8.1-opencv_test.patch new file mode 100644 index 000000000000..2bdc2d830570 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-opencv_test.patch @@ -0,0 +1,18 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +We don't package quirc, so the misplaced #ifdef breaks compilation. + +diff --git a/modules/objdetect/test/test_qrcode.cpp b/modules/objdetect/test/test_qrcode.cpp +index 5e6ec6f..6dc14cc 100644 +--- a/modules/objdetect/test/test_qrcode.cpp ++++ b/modules/objdetect/test/test_qrcode.cpp +@@ -374,8 +374,8 @@ TEST_P(Objdetect_QRCode_Multi, regression) + qrcode = QRCodeDetectorAruco(); + } + std::vector<Point> corners; +-#ifdef HAVE_QUIRC + std::vector<cv::String> decoded_info; ++#ifdef HAVE_QUIRC + std::vector<Mat> straight_barcode; + EXPECT_TRUE(qrcode.detectAndDecodeMulti(src, decoded_info, corners, straight_barcode)); + ASSERT_FALSE(corners.empty()); diff --git a/media-libs/opencv/files/opencv-4.8.1-python3_12-support.patch b/media-libs/opencv/files/opencv-4.8.1-python3_12-support.patch new file mode 100644 index 000000000000..7eae8a180ce6 --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-python3_12-support.patch @@ -0,0 +1,25 @@ +https://github.com/opencv/opencv/pull/23991 + +From 00ca8f455e6a5588d905e3a0b268f18ee3fda5dd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= <sergio@serjux.com> +Date: Sun, 1 Oct 2023 16:12:25 +0100 +Subject: [PATCH] `numpy.distutils` is removed in numpy 1.26 on Python 3.12. + +so we don't use numpy.distutils to get includes dirs of python-numpy +--- + cmake/OpenCVDetectPython.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake +index 88a434185622..d4098ce8e60d 100644 +--- a/cmake/OpenCVDetectPython.cmake ++++ b/cmake/OpenCVDetectPython.cmake +@@ -216,7 +216,7 @@ if(NOT ${found}) + message(STATUS " PYTHON3_NUMPY_INCLUDE_DIRS") + else() + # Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy +- execute_process(COMMAND "${_executable}" -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(os.pathsep.join(numpy.distutils.misc_util.get_numpy_include_dirs()))" ++ execute_process(COMMAND "${_executable}" -c "import numpy; print(numpy.get_include())" + RESULT_VARIABLE _numpy_process + OUTPUT_VARIABLE _numpy_include_dirs + OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/media-libs/opencv/files/opencv-4.8.1-use-system-flatbuffers.patch b/media-libs/opencv/files/opencv-4.8.1-use-system-flatbuffers.patch new file mode 100644 index 000000000000..11c42aea0e6d --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-use-system-flatbuffers.patch @@ -0,0 +1,36 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Find the system flatbuffers and allow for newer revisions. + +diff --git a/cmake/OpenCVDetectFlatbuffers.cmake b/cmake/OpenCVDetectFlatbuffers.cmake +index 537b738..dbfa532 100644 +--- a/cmake/OpenCVDetectFlatbuffers.cmake ++++ b/cmake/OpenCVDetectFlatbuffers.cmake +@@ -1,12 +1,6 @@ + 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})") +-endif() +- +-if(WITH_FLATBUFFERS OR HAVE_FLATBUFFERS) ++ find_package(flatbuffers REQUIRED) ++ set(HAVE_FLATBUFFERS "${flatbuffers_FOUND}") + list(APPEND CUSTOM_STATUS flatbuffers) + + if(HAVE_FLATBUFFERS) +diff --git a/modules/dnn/misc/tflite/schema_generated.h b/modules/dnn/misc/tflite/schema_generated.h +index 44162ee..1c3c35a 100644 +--- a/modules/dnn/misc/tflite/schema_generated.h ++++ b/modules/dnn/misc/tflite/schema_generated.h +@@ -10,7 +10,7 @@ + // generated, otherwise it may not be compatible. + static_assert(FLATBUFFERS_VERSION_MAJOR == 23 && + FLATBUFFERS_VERSION_MINOR == 5 && +- FLATBUFFERS_VERSION_REVISION == 9, ++ FLATBUFFERS_VERSION_REVISION >= 9, + "Non-compatible flatbuffers version included"); + + namespace opencv_tflite { diff --git a/media-libs/opencv/files/opencv-4.8.1-use-system-opencl.patch b/media-libs/opencv/files/opencv-4.8.1-use-system-opencl.patch new file mode 100644 index 000000000000..f4efd06897df --- /dev/null +++ b/media-libs/opencv/files/opencv-4.8.1-use-system-opencl.patch @@ -0,0 +1,25 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Find the system opencl and inject the include dir. + +diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake +index 100fb0e..ab30bf9 100644 +--- a/cmake/OpenCVDetectOpenCL.cmake ++++ b/cmake/OpenCVDetectOpenCL.cmake +@@ -1,3 +1,8 @@ ++find_package(OpenCLHeaders REQUIRED) ++if(NOT TARGET OpenCL::Headers) ++ message(FATAL_ERROR "OpenCL::Headers not found") ++endif() ++ + set(OPENCL_FOUND ON CACHE BOOL "OpenCL library is found") + if(APPLE) + set(OPENCL_LIBRARY "-framework OpenCL" CACHE STRING "OpenCL library") +@@ -5,6 +10,7 @@ if(APPLE) + 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") ++ get_target_property(OPENCL_INCLUDE_DIR OpenCL::Headers INTERFACE_INCLUDE_DIRECTORIES) + endif() + mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY) + diff --git a/media-libs/opencv/files/opencv_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch b/media-libs/opencv/files/opencv_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch new file mode 100644 index 000000000000..fe66258b15f2 --- /dev/null +++ b/media-libs/opencv/files/opencv_contrib-4.8.1-NVIDIAOpticalFlowSDK-2.0.tar.gz.patch @@ -0,0 +1,20 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Use tar.gz instead of zip to make CI happy. + +diff --git a/modules/cudaoptflow/CMakeLists.txt b/modules/cudaoptflow/CMakeLists.txt +index b295abc..1e916e5 100644 +--- a/modules/cudaoptflow/CMakeLists.txt ++++ b/modules/cudaoptflow/CMakeLists.txt +@@ -10,9 +10,9 @@ ocv_define_module(cudaoptflow opencv_video opencv_optflow opencv_cudaarithm open + + if(NOT CUDA_VERSION VERSION_LESS "10.0") + set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT "edb50da3cf849840d680249aa6dbef248ebce2ca") +- set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5 "a73cd48b18dcc0cc8933b30796074191") ++ set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5 "5626b1d1c335fbcbf893fcb27e1230be") + set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH "${OpenCV_BINARY_DIR}/3rdparty/NVIDIAOpticalFlowSDK_2_0_Headers") +- ocv_download(FILENAME "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}.zip" ++ ocv_download(FILENAME "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}.tar.gz" + HASH ${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5} + URL "https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/" + DESTINATION_DIR "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}" diff --git a/media-libs/opencv/files/opencv_contrib-4.8.1-rgbd.patch b/media-libs/opencv/files/opencv_contrib-4.8.1-rgbd.patch new file mode 100644 index 000000000000..0e1f12d6df46 --- /dev/null +++ b/media-libs/opencv/files/opencv_contrib-4.8.1-rgbd.patch @@ -0,0 +1,15 @@ +From: Paul Zander <negril.nx+gentoo@gmail.com> + +Fixes compilation when using GLVND. + +diff --git a/modules/rgbd/CMakeLists.txt b/modules/rgbd/CMakeLists.txt +index 79e1562..eaebc3a 100644 +--- a/modules/rgbd/CMakeLists.txt ++++ b/modules/rgbd/CMakeLists.txt +@@ -7,5 +7,5 @@ if(NOT HAVE_EIGEN) + endif() + + if(HAVE_OPENGL) +- ocv_target_link_libraries(${the_module} PRIVATE "${OPENGL_LIBRARIES}") ++ ocv_target_link_libraries(${the_module} PRIVATE "${OPENGL_LIBRARIES}" GL) + endif() |