summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-support/opencv
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-support/opencv')
-rw-r--r--meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch42
-rw-r--r--meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch31
-rw-r--r--meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch24
-rw-r--r--meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.4.0.bb (renamed from meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.3.0.bb)19
4 files changed, 88 insertions, 28 deletions
diff --git a/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch
new file mode 100644
index 000000000..d56b8ae67
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch
@@ -0,0 +1,42 @@
+From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Thu, 18 Jun 2020 05:51:38 +0000
+Subject: [PATCH] Make ts module external
+
+Make ts module external
+
+Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb
+
+Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ modules/ts/CMakeLists.txt | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
+index f95bed0793..66f315bcca 100644
+--- a/modules/ts/CMakeLists.txt
++++ b/modules/ts/CMakeLists.txt
+@@ -4,9 +4,6 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
+ ocv_module_disable(ts)
+ endif()
+
+-set(OPENCV_MODULE_TYPE STATIC)
+-set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
+-
+ if(WINRT)
+ # WINRT doesn't have access to environment variables
+ # so adding corresponding macros during CMake run
+@@ -16,7 +13,7 @@ endif()
+
+ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
+
+-ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
++ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
+
+ ocv_glob_module_sources()
+ ocv_module_include_directories()
+--
+2.24.1
+
diff --git a/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch b/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch
new file mode 100644
index 000000000..c5a64387f
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch
@@ -0,0 +1,31 @@
+From 59fafe6e39759e193b5764b36b4c5a93da352123 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Aug 2020 00:36:49 -0700
+Subject: [PATCH] Use -Os to compile tinyxml2.cpp
+
+This workarounds issue [1] seen on riscv with gcc
+
+[1] https://github.com/riscv/riscv-gnu-toolchain/issues/624
+
+Upstream-Status: Inappropriate [ OE-Specific ]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ modules/datasets/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/datasets/CMakeLists.txt b/modules/datasets/CMakeLists.txt
+index 56ca9e310..99b7a33f6 100644
+--- a/modules/datasets/CMakeLists.txt
++++ b/modules/datasets/CMakeLists.txt
+@@ -2,7 +2,7 @@ set(the_description "datasets framework")
+
+ set(filter_srcs "${CMAKE_CURRENT_LIST_DIR}/src/tinyxml2/tinyxml2.cpp")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+- ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override") # GCC
++ ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override -Os") # GCC
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-inconsistent-missing-override") # Clang
+ endif()
+--
+2.28.0
+
diff --git a/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch b/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch
deleted file mode 100644
index 20d54d407..000000000
--- a/meta-openembedded/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 78e2fc167fd27ab17175dcfd6eccf6f74bd5e1c7 Mon Sep 17 00:00:00 2001
-From: Bian Naimeng <biannm@cn.fujitsu.com>
-Date: Wed, 19 Apr 2017 03:11:37 +0900
-Subject: [PATCH] Make opencv-ts create share library intead of static.
-
-Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
-
----
- modules/ts/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
-index f95bed0793..ee67858df8 100644
---- a/modules/ts/CMakeLists.txt
-+++ b/modules/ts/CMakeLists.txt
-@@ -4,7 +4,7 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
- ocv_module_disable(ts)
- endif()
-
--set(OPENCV_MODULE_TYPE STATIC)
-+#set(OPENCV_MODULE_TYPE STATIC)
- set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
-
- if(WINRT)
diff --git a/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.3.0.bb b/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.4.0.bb
index 2587b189c..c83186de0 100644
--- a/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.3.0.bb
+++ b/meta-openembedded/meta-oe/recipes-support/opencv/opencv_4.4.0.bb
@@ -10,8 +10,8 @@ ARM_INSTRUCTION_SET_armv5 = "arm"
DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"
-SRCREV_opencv = "01b2c5a77ca6dbef3baef24ebc0a5984579231d9"
-SRCREV_contrib = "e6f32c6a69043456a806a4e802ee3ce7b7059c93"
+SRCREV_opencv = "c3bb57afeaf030f10939204d48d7c2a3842f4293"
+SRCREV_contrib = "5fae4082cc493efa5cb7a7486f9e009618a5198b"
SRCREV_ipp = "a56b6ac6f030c312b2dce17430eef13aed9af274"
SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
@@ -44,13 +44,13 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face \
file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
- file://0002-Make-opencv-ts-create-share-library-intead-of-static.patch \
file://0003-To-fix-errors-as-following.patch \
file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
file://0001-Dont-use-isystem.patch \
file://download.patch \
+ file://0001-Make-ts-module-external.patch \
"
-PV = "4.3.0"
+SRC_URI_append_riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib"
S = "${WORKDIR}/git"
@@ -80,6 +80,8 @@ do_unpack_extra() {
}
addtask unpack_extra after do_unpack before do_patch
+CMAKE_VERBOSE = "VERBOSE=1"
+
EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
-DWITH_1394=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
@@ -197,6 +199,13 @@ RDEPENDS_python3-opencv = "python3-core python3-numpy"
RDEPENDS_${PN}-apps = "bash"
+do_compile_prepend() {
+ # remove the build host info to improve reproducibility
+ if [ -f ${WORKDIR}/build/modules/core/version_string.inc ]; then
+ sed -i "s#${WORKDIR}#/workdir#g" ${WORKDIR}/build/modules/core/version_string.inc
+ fi
+}
+
do_install_append() {
# Move Python files into correct library folder (for multilib build)
if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
@@ -204,3 +213,5 @@ do_install_append() {
rm -rf ${D}/usr/lib
fi
}
+
+TOOLCHAIN = "gcc"