From 99495bea5a62ef8b1ecf4e730451f5d9bea4b5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Thu, 24 Dec 2020 16:16:23 +0000 Subject: [PATCH] Fix build of grfmt_jpeg2000.cpp --- ...c199a20882c546fa31142e9c0f5a8b3cf983.patch | 33 +++++++++++++++++++ opencv.spec | 8 ++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 f66fc199a20882c546fa31142e9c0f5a8b3cf983.patch diff --git a/f66fc199a20882c546fa31142e9c0f5a8b3cf983.patch b/f66fc199a20882c546fa31142e9c0f5a8b3cf983.patch new file mode 100644 index 0000000..5262608 --- /dev/null +++ b/f66fc199a20882c546fa31142e9c0f5a8b3cf983.patch @@ -0,0 +1,33 @@ +From f66fc199a20882c546fa31142e9c0f5a8b3cf983 Mon Sep 17 00:00:00 2001 +From: Florian Jung +Date: Wed, 29 Jul 2020 18:51:55 +0200 +Subject: [PATCH] Fix build of grfmt_jpeg2000.cpp + +libjasper has recently changed `jas_matrix_get` from a macro to an inline function +(389951d071 in https://github.com/jasper-software/jasper), causing the build to fail. +--- + modules/imgcodecs/src/grfmt_jpeg2000.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp +index fe69f80c86f..0f4d28d6f4d 100644 +--- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp ++++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp +@@ -377,7 +377,7 @@ bool Jpeg2KDecoder::readComponent8u( uchar *data, void *_buffer, + + for( y = 0; y < yend - ystart; ) + { +- jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 ); ++ jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 ); + uchar* dst = data + (y - yoffset) * step - xoffset; + + if( xstep == 1 ) +@@ -443,7 +443,7 @@ bool Jpeg2KDecoder::readComponent16u( unsigned short *data, void *_buffer, + + for( y = 0; y < yend - ystart; ) + { +- jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 ); ++ jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 ); + ushort* dst = data + (y - yoffset) * step - xoffset; + + if( xstep == 1 ) diff --git a/opencv.spec b/opencv.spec index 78ccc5c..3199245 100644 --- a/opencv.spec +++ b/opencv.spec @@ -60,7 +60,7 @@ Name: opencv Version: 4.2.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Collection of algorithms for computer vision # This is normal three clause BSD. License: BSD @@ -80,6 +80,8 @@ Patch1: https://github.com/opencv/opencv/commit/fb3a334bbee3535d508af651 Patch2: https://github.com/opencv/opencv/commit/bd531bd82852808f7fa403e3ee159bd62b1c08cc.patch # Comment out removed vulkan symbols Patch3: opencv_vulkan.patch +#Fix build of grfmt_jpeg2000.cpp +Patch4: f66fc199a20882c546fa31142e9c0f5a8b3cf983.patch BuildRequires: gcc-c++ BuildRequires: libtool @@ -258,6 +260,7 @@ popd &>/dev/null %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 pushd %{name}_contrib-%{version} popd @@ -471,6 +474,9 @@ popd %{_libdir}/libopencv_xphoto.so.%{abiver}* %changelog +* Thu Dec 24 2020 Sérgio Basto - 4.2.0-8 +- Fix build of grfmt_jpeg2000.cpp + * Thu May 21 2020 Sandro Mani - 4.2.0-7 - Rebuild (gdal)