summaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2021-11-03 21:16:48 -0500
committerTom Hochstein <tom.hochstein@nxp.com>2021-11-03 21:23:36 -0500
commitdc3ea70ff53a3989636d98768c1f510cc6baedd8 (patch)
treeee11ec48aff8120e483cceb78d895a8f2b7c803e /recipes-support
parent75cc53cc480f73d8dc97cf1b52c48fb874d16a97 (diff)
downloadmeta-freescale-dc3ea70ff53a3989636d98768c1f510cc6baedd8.tar.gz
opencv: Backport updates from OE-Core
2178fd7386 opencv: remove setup_vars_opencv4.sh cafcc65e74 opencv: fix build with protobuf-3.18 when dnn PACKAGECONFIG is enabled 3c022cd50d opencv: Do not lock to gcc only compiler Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch41
-rw-r--r--recipes-support/opencv/opencv_4.5.2.imx.bb13
2 files changed, 52 insertions, 2 deletions
diff --git a/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch b/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch
new file mode 100644
index 00000000..5d88d1a6
--- /dev/null
+++ b/recipes-support/opencv/opencv/0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch
@@ -0,0 +1,41 @@
1From 9cfa84313c5833d7295fcf57be93d5d2aaadfd88 Mon Sep 17 00:00:00 2001
2From: Vincent Rabaud <vrabaud@google.com>
3Date: Sat, 10 Jul 2021 00:21:52 +0200
4Subject: [PATCH] Use the one argument version of SetTotalBytesLimit.
5
6The two argument versions has been deprecated, cf
7https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.io.coded_stream
8
9Upstream-Status: Backport [9cfa84313c5833d7295fcf57be93d5d2aaadfd88 - from master after 4.5.3 tag]
10Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
11---
12 modules/dnn/src/caffe/caffe_io.cpp | 5 +++++
13 1 file changed, 5 insertions(+)
14
15diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp
16index 2fc4d84f46..ebecf95eea 100644
17--- a/modules/dnn/src/caffe/caffe_io.cpp
18+++ b/modules/dnn/src/caffe/caffe_io.cpp
19@@ -92,6 +92,7 @@
20 #ifdef HAVE_PROTOBUF
21 #include <google/protobuf/io/coded_stream.h>
22 #include <google/protobuf/io/zero_copy_stream_impl.h>
23+#include <google/protobuf/stubs/common.h>
24 #include <google/protobuf/text_format.h>
25
26 #include <opencv2/core.hpp>
27@@ -1111,7 +1112,11 @@ static const int kProtoReadBytesLimit = INT_MAX; // Max size of 2 GB minus 1 by
28
29 bool ReadProtoFromBinary(ZeroCopyInputStream* input, Message *proto) {
30 CodedInputStream coded_input(input);
31+#if GOOGLE_PROTOBUF_VERSION >= 3006000
32+ coded_input.SetTotalBytesLimit(kProtoReadBytesLimit);
33+#else
34 coded_input.SetTotalBytesLimit(kProtoReadBytesLimit, 536870912);
35+#endif
36
37 return proto->ParseFromCodedStream(&coded_input);
38 }
39--
402.32.0
41
diff --git a/recipes-support/opencv/opencv_4.5.2.imx.bb b/recipes-support/opencv/opencv_4.5.2.imx.bb
index 8bb492ba..f84e29d7 100644
--- a/recipes-support/opencv/opencv_4.5.2.imx.bb
+++ b/recipes-support/opencv/opencv_4.5.2.imx.bb
@@ -58,6 +58,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=master;protocol
58 file://download.patch \ 58 file://download.patch \
59 file://0001-Make-ts-module-external.patch \ 59 file://0001-Make-ts-module-external.patch \
60 file://0001-sfm-link-with-Glog_LIBS.patch;patchdir=../contrib \ 60 file://0001-sfm-link-with-Glog_LIBS.patch;patchdir=../contrib \
61 file://0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch \
61 " 62 "
62SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib" 63SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib"
63 64
@@ -112,6 +113,12 @@ PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples
112 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ 113 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
113 ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}" 114 ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
114 115
116# TBB does not build for powerpc so disable that package config
117PACKAGECONFIG:remove:powerpc = "tbb"
118# tbb now needs getcontect/setcontext which is not there for all arches on musl
119PACKAGECONFIG:remove:libc-musl:riscv64 = "tbb"
120PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb"
121
115PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" 122PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade"
116PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," 123PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
117PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," 124PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
@@ -229,10 +236,12 @@ do_install:append() {
229 sed -e 's@${STAGING_DIR_HOST}@@g' \ 236 sed -e 's@${STAGING_DIR_HOST}@@g' \
230 -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake 237 -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake
231 fi 238 fi
239 # remove setup_vars_opencv4.sh as its content is confusing and useless
240 if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then
241 rm -rf ${D}${bindir}/setup_vars_opencv4.sh
242 fi
232} 243}
233 244
234TOOLCHAIN = "gcc"
235
236########## End of meta-openembedded copy ########## 245########## End of meta-openembedded copy ##########
237 246
238########## i.MX overrides ########## 247########## i.MX overrides ##########