diff -Nru opencv-4.6.0+dfsg/debian/changelog opencv-4.6.0+dfsg/debian/changelog --- opencv-4.6.0+dfsg/debian/changelog 2024-03-31 08:12:12.000000000 +0000 +++ opencv-4.6.0+dfsg/debian/changelog 2024-04-03 19:08:47.000000000 +0000 @@ -1,3 +1,9 @@ +opencv (4.6.0+dfsg-13.1ubuntu1) noble; urgency=medium + + * Cherry-pick upstream commit to avoid FTBFS with NumPy 1.26 + + -- Graham Inggs Wed, 03 Apr 2024 19:08:47 +0000 + opencv (4.6.0+dfsg-13.1build3) noble; urgency=medium * No-change rebuild for CVE-2024-3094 diff -Nru opencv-4.6.0+dfsg/debian/patches/numpy1.26.patch opencv-4.6.0+dfsg/debian/patches/numpy1.26.patch --- opencv-4.6.0+dfsg/debian/patches/numpy1.26.patch 1970-01-01 00:00:00.000000000 +0000 +++ opencv-4.6.0+dfsg/debian/patches/numpy1.26.patch 2024-04-03 18:15:04.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Do not use numpy.distutils to get includes dirs of python-numpy +Origin: upstream, https://github.com/opencv/opencv/commit/00ca8f455e6a5588d905e3a0b268f18ee3fda5dd +Author: Sérgio Basto +Last-Update: 2023-10-01 + +--- a/cmake/OpenCVDetectPython.cmake ++++ b/cmake/OpenCVDetectPython.cmake +@@ -216,7 +216,7 @@ + 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 -Nru opencv-4.6.0+dfsg/debian/patches/series opencv-4.6.0+dfsg/debian/patches/series --- opencv-4.6.0+dfsg/debian/patches/series 2023-07-16 21:04:15.000000000 +0000 +++ opencv-4.6.0+dfsg/debian/patches/series 2024-04-03 18:11:45.000000000 +0000 @@ -9,3 +9,4 @@ 0009-fix-wechat_qrcode-Init-nBytes-after-the-count-value-.patch 0010-fix-wechat_qrcode-fixed-memory-leaks.patch cmake-no-download.patch +numpy1.26.patch