commit:     cebb6e2fdce12a8c5f81f1b19bd494469ace2786
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Apr 12 13:08:34 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr 21 12:49:40 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cebb6e2f

media-libs/opencv: bugfixes

Closes: https://bugs.gentoo.org/929972
Closes: https://bugs.gentoo.org/928516
Closes: https://bugs.gentoo.org/928747
Closes: https://bugs.gentoo.org/927992
Closes: https://bugs.gentoo.org/927917
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36248
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../opencv/files/opencv-4.9.0-cuda-12.4.patch      | 70 ++++++++++++++++++++++
 media-libs/opencv/opencv-4.8.1-r1.ebuild           |  1 +
 media-libs/opencv/opencv-4.9.0.ebuild              |  5 +-
 profiles/arch/amd64/use.mask                       |  4 ++
 profiles/arch/arm64/package.use.force              |  4 ++
 profiles/arch/arm64/package.use.mask               |  4 ++
 profiles/arch/base/use.mask                        |  4 ++
 profiles/arch/x86/use.mask                         |  4 ++
 8 files changed, 95 insertions(+), 1 deletion(-)

diff --git a/media-libs/opencv/files/opencv-4.9.0-cuda-12.4.patch 
b/media-libs/opencv/files/opencv-4.9.0-cuda-12.4.patch
new file mode 100644
index 000000000000..f3b5c7b36b50
--- /dev/null
+++ b/media-libs/opencv/files/opencv-4.9.0-cuda-12.4.patch
@@ -0,0 +1,70 @@
+From: 
https://gitlab.archlinux.org/archlinux/packaging/packages/opencv/-/blob/main/fix-nppi-bufsize-type.patch?ref_type=heads
+--- a/modules/cudaarithm/src/reductions.cpp    2023-12-26 22:24:58.000000000 
+0100
++++ b/modules/cudaarithm/src/reductions.cpp    2024-03-18 16:51:32.108049155 
+0100
+@@ -151,7 +151,7 @@
+     sz.width  = gsrc.cols;
+     sz.height = gsrc.rows;
+
+-    int bufSize;
++    size_t bufSize;
+ #if (CUDA_VERSION <= 4020)
+     nppSafeCall( nppiMeanStdDev8uC1RGetBufferHostSize(sz, &bufSize) );
+ #else
+@@ -227,7 +227,7 @@
+     sz.width  = gsrc.cols;
+     sz.height = gsrc.rows;
+
+-    int bufSize;
++    size_t bufSize;
+ #if (CUDA_VERSION <= 4020)
+         nppSafeCall( nppiMeanStdDev8uC1MRGetBufferHostSize(sz, &bufSize) );
+ #else
+--- a/modules/cudaimgproc/src/histogram.cpp    2023-12-26 22:24:58.000000000 
+0100
++++ b/modules/cudaimgproc/src/histogram.cpp    2024-03-18 17:51:37.005208948 
+0100
+@@ -281,8 +281,8 @@
+
+ namespace
+ {
+-    typedef NppStatus (*get_buf_size_c1_t)(NppiSize oSizeROI, int nLevels, 
int* hpBufferSize);
+-    typedef NppStatus (*get_buf_size_c4_t)(NppiSize oSizeROI, int nLevels[], 
int* hpBufferSize);
++    typedef NppStatus (*get_buf_size_c1_t)(NppiSize oSizeROI, int nLevels, 
size_t* hpBufferSize);
++    typedef NppStatus (*get_buf_size_c4_t)(NppiSize oSizeROI, int nLevels[], 
size_t* hpBufferSize);
+
+     template<int SDEPTH> struct NppHistogramEvenFuncC1
+     {
+@@ -315,7 +315,7 @@
+             sz.width = src.cols;
+             sz.height = src.rows;
+
+-            int buf_size;
++            size_t buf_size;
+             get_buf_size(sz, levels, &buf_size);
+
+             BufferPool pool(stream);
+@@ -349,7 +349,7 @@
+
+             Npp32s* pHist[] = {hist[0].ptr<Npp32s>(), hist[1].ptr<Npp32s>(), 
hist[2].ptr<Npp32s>(), hist[3].ptr<Npp32s>()};
+
+-            int buf_size;
++            size_t buf_size;
+             get_buf_size(sz, levels, &buf_size);
+
+             BufferPool pool(stream);
+@@ -419,7 +419,7 @@
+             sz.width = src.cols;
+             sz.height = src.rows;
+
+-            int buf_size;
++            size_t buf_size;
+             get_buf_size(sz, levels.cols, &buf_size);
+
+             BufferPool pool(stream);
+@@ -460,7 +460,7 @@
+             sz.width = src.cols;
+             sz.height = src.rows;
+
+-            int buf_size;
++            size_t buf_size;
+             get_buf_size(sz, nLevels, &buf_size);
+
+             BufferPool pool(stream);

diff --git a/media-libs/opencv/opencv-4.8.1-r1.ebuild 
b/media-libs/opencv/opencv-4.8.1-r1.ebuild
index 0f6ed3e6a080..0756ee648856 100644
--- a/media-libs/opencv/opencv-4.8.1-r1.ebuild
+++ b/media-libs/opencv/opencv-4.8.1-r1.ebuild
@@ -568,6 +568,7 @@ multilib_src_configure() {
 
        if multilib_is_native_abi && use cuda; then
                cuda_add_sandbox -w
+               sandbox_write "/proc/self/task"
 
                if [[ -n "${CUDA_GENERATION}" ]]; then
                        mycmakeargs+=(

diff --git a/media-libs/opencv/opencv-4.9.0.ebuild 
b/media-libs/opencv/opencv-4.9.0.ebuild
index 5ad9e4eabaaa..9c1ac20be8c5 100644
--- a/media-libs/opencv/opencv-4.9.0.ebuild
+++ b/media-libs/opencv/opencv-4.9.0.ebuild
@@ -145,7 +145,7 @@ RDEPEND="
        app-arch/bzip2[${MULTILIB_USEDEP}]
        dev-libs/protobuf:=[${MULTILIB_USEDEP}]
        sys-libs/zlib[${MULTILIB_USEDEP}]
-       cuda? ( <dev-util/nvidia-cuda-toolkit-12.4:0= )
+       cuda? ( dev-util/nvidia-cuda-toolkit:= )
        cudnn? ( dev-libs/cudnn:= )
        contribdnn? ( dev-libs/flatbuffers:= )
        contribhdf? ( sci-libs/hdf5:= )
@@ -217,6 +217,7 @@ RDEPEND="
                        dev-qt/qtbase:6[gui,widgets,concurrent,opengl?]
                )
        )
+       quirc? ( media-libs/quirc )
        tesseract? ( app-text/tesseract[opencl=,${MULTILIB_USEDEP}] )
        tbb? ( dev-cpp/tbb:=[${MULTILIB_USEDEP}] )
        tiff? ( media-libs/tiff:=[${MULTILIB_USEDEP}] )
@@ -591,6 +592,7 @@ multilib_src_configure() {
        # ===================================================
        # configure modules to be build
        # ===================================================
+               -DBUILD_opencv_gapi="$(usex ffmpeg yes "$(usex gstreamer)")"
                -DBUILD_opencv_features2d="$(usex features2d)"
                -DBUILD_opencv_java_bindings_generator="$(usex java)"
                -DBUILD_opencv_js="no"
@@ -678,6 +680,7 @@ multilib_src_configure() {
 
        if multilib_is_native_abi && use cuda; then
                cuda_add_sandbox -w
+               sandbox_write "/proc/self/task"
                CUDAHOSTCXX="$(cuda_get_cuda_compiler)"
                CUDAARCHS="$(cuda_get_host_native_arch)"
                export CUDAHOSTCXX

diff --git a/profiles/arch/amd64/use.mask b/profiles/arch/amd64/use.mask
index ebc94c196b5f..8049967550c6 100644
--- a/profiles/arch/amd64/use.mask
+++ b/profiles/arch/amd64/use.mask
@@ -4,6 +4,10 @@
 # Unmask the flag which corresponds to ARCH.
 -amd64
 
+# Paul Zander <negril.nx+gen...@gmail.com> (2024-04-14)
+# media-libs/quirc is keyworded on amd64
+-quirc
+
 # Paul Zander <negril.nx+gen...@gmail.com> (2024-03-28)
 # dev-libs/optix works on amd64
 -optix

diff --git a/profiles/arch/arm64/package.use.force 
b/profiles/arch/arm64/package.use.force
index 2f70b36b7b36..a0427c5c5577 100644
--- a/profiles/arch/arm64/package.use.force
+++ b/profiles/arch/arm64/package.use.force
@@ -1,6 +1,10 @@
 # Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Paul Zander <negril.nx+gen...@gmail.com> (2024-04-12)
+# supports 64 bit neon
+media-libs/opencv cpu_flags_arm_neon
+
 # Matt Jolly <kan...@gentoo.org> (2024-01-30)
 # Google does not provide an arm64 toolchain
 www-client/chromium system-toolchain

diff --git a/profiles/arch/arm64/package.use.mask 
b/profiles/arch/arm64/package.use.mask
index b4ddc2fa27aa..a95fa3ba227e 100644
--- a/profiles/arch/arm64/package.use.mask
+++ b/profiles/arch/arm64/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Paul Zander <negril.nx+gen...@gmail.com> (2024-04-12)
+# Supports 64-bit NEON
+media-libs/opencv -cpu_flags_arm_neon
+
 # Paul Zander <negril.nx+gen...@gmail.com> (2024-04-02)
 # Supports 64-bit NEON
 media-libs/openpgl -cpu_flags_arm_neon

diff --git a/profiles/arch/base/use.mask b/profiles/arch/base/use.mask
index 451dd7d0fadc..d1cd9910ec4a 100644
--- a/profiles/arch/base/use.mask
+++ b/profiles/arch/base/use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# Paul Zander <negril.nx+gen...@gmail.com> (2024-04-14)
+# media-libs/quirc only keyworded on amd64, x86
+quirc
+
 # Paul Zander <negril.nx+gen...@gmail.com> (2024-03-28)
 # dev-libs/optix only works on amd64 and arm64
 optix

diff --git a/profiles/arch/x86/use.mask b/profiles/arch/x86/use.mask
index 267e27efdc54..38dc83097d4f 100644
--- a/profiles/arch/x86/use.mask
+++ b/profiles/arch/x86/use.mask
@@ -4,6 +4,10 @@
 # Unmask the flag which corresponds to ARCH.
 -x86
 
+# Paul Zander <negril.nx+gen...@gmail.com> (2024-04-14)
+# media-libs/quirc is keyworded on amd64
+-quirc
+
 # Paul Zander <negril.nx+gen...@gmail.com> (2024-03-29)
 # not keyworded
 openimageio

Reply via email to