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@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/36248
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander
2024-04-12 15:08:34 +02:00
committed by Sam James
parent 383a723d17
commit cebb6e2fdc
8 changed files with 95 additions and 1 deletions

View File

@@ -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);

View File

@@ -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+=(

View File

@@ -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

View File

@@ -4,6 +4,10 @@
# Unmask the flag which corresponds to ARCH.
-amd64
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-14)
# media-libs/quirc is keyworded on amd64
-quirc
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-03-28)
# dev-libs/optix works on amd64
-optix

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-12)
# supports 64 bit neon
media-libs/opencv cpu_flags_arm_neon
# Matt Jolly <kangie@gentoo.org> (2024-01-30)
# Google does not provide an arm64 toolchain
www-client/chromium system-toolchain

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-12)
# Supports 64-bit NEON
media-libs/opencv -cpu_flags_arm_neon
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-02)
# Supports 64-bit NEON
media-libs/openpgl -cpu_flags_arm_neon

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-14)
# media-libs/quirc only keyworded on amd64, x86
quirc
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-03-28)
# dev-libs/optix only works on amd64 and arm64
optix

View File

@@ -4,6 +4,10 @@
# Unmask the flag which corresponds to ARCH.
-x86
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-04-14)
# media-libs/quirc is keyworded on amd64
-quirc
# Paul Zander <negril.nx+gentoo@gmail.com> (2024-03-29)
# not keyworded
openimageio