summaryrefslogtreecommitdiffstats
path: root/recipes-support
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2021-05-04 10:49:07 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2021-05-04 14:06:25 -0300
commit7462ae5636ebd8551350253d2bb1c3047431ba0d (patch)
tree393e16c600247926640bbae3c58b0ab7990ebe58 /recipes-support
parenta5fc68872680f82e1e4b12d0ffd4be7b9046d372 (diff)
downloadmeta-freescale-7462ae5636ebd8551350253d2bb1c3047431ba0d.tar.gz
opencv: Fix SRC_URI
The SRC_URI is updated for the base recipe, but the copy of the SRC_URI in the override section doesn't account for this, leading to a build break: ``` | -- wechat_qrcode: Download: detect.caffemodel | CMake Error at /opt/work/upstream/fsl-xwayland/tmp/work/cortexa53-crypto-mx8mp-fsl-linux/opencv/4.5.2.imx-r0/git/cmake/OpenCVDownload.cmake:161 (message): | Not going to download detect.caffemodel ``` Additionally, the SRC_URI is long and complex, and copying it in our override section does make problems like this more likely. Fix the problem and simplify maintenance by replacing the SRC_URI copy with a targetted override. The override section now shows only the changes to SRC_URI. The fix includes these related changes: - a new patch file is added in the base recipe and is now copied locally - the override for SRCREV_contrib is redundant and is dropped Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch44
-rw-r--r--recipes-support/opencv/opencv_4.5.2.imx.bb40
2 files changed, 62 insertions, 22 deletions
diff --git a/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch b/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch
new file mode 100644
index 00000000..7b2c4100
--- /dev/null
+++ b/recipes-support/opencv/opencv/0001-sfm-link-with-Glog_LIBS.patch
@@ -0,0 +1,44 @@
1From ffe20fc4ec46c6b491eff29a38f90686d4d035f6 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Mon, 12 Apr 2021 20:37:40 +0000
4Subject: [PATCH] sfm: link with Glog_LIBS
5
6* in 4.5.0 there was explicit linkage with GLOG_LIBRARY, but since 4.5.1 with:
7 https://github.com/opencv/opencv_contrib/commit/23ee62a19b7a3e50d6dbf295359d8b1aff2e03fd
8
9 it's gone, probably because Glog_FOUND is already set from Ceres,
10 but then GLOG_LIBRARIES is empty in LIBMV_LIGHT_LIBS and build with gold fails:
11
12FAILED: bin/example_tutorial_perspective_correction
13: && TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native/usr/bin/x86_64-oe-linux/x86_64-oe-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -mssse3 -DNDEBUG -DNDEBUG -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0=/usr/src/debug/opencv/4.5.2-r0 -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot= -fdebug-prefix-map=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot-native= -fvisibility-inlines-hidden -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -ITOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/git/include -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--gc-sections -Wl,--as-needed samples/cpp/CMakeFiles/example_tutorial_perspective_correction.dir/tutorial_code/features2D/Homography/perspective_correction.cpp.o -o bin/example_tutorial_perspective_correction -ldl -lm -lpthread -lrt lib/libopencv_gapi.so.4.5.2 lib/libopencv_stitching.so.4.5.2 lib/libopencv_ts.so.4.5.2 lib/libopencv_alphamat.so.4.5.2 lib/libopencv_aruco.so.4.5.2 lib/libopencv_bgsegm.so.4.5.2 lib/libopencv_bioinspired.so.4.5.2 lib/libopencv_ccalib.so.4.5.2 lib/libopencv_dnn_objdetect.so.4.5.2 lib/libopencv_dnn_superres.so.4.5.2 lib/libopencv_dpm.so.4.5.2 lib/libopencv_face.so.4.5.2 lib/libopencv_fuzzy.so.4.5.2 lib/libopencv_hfs.so.4.5.2 lib/libopencv_img_hash.so.4.5.2 lib/libopencv_intensity_transform.so.4.5.2 lib/libopencv_line_descriptor.so.4.5.2 lib/libopencv_mcc.so.4.5.2 lib/libopencv_quality.so.4.5.2 lib/libopencv_rapid.so.4.5.2 lib/libopencv_reg.so.4.5.2 lib/libopencv_rgbd.so.4.5.2 lib/libopencv_saliency.so.4.5.2 lib/libopencv_sfm.so.4.5.2 lib/libopencv_stereo.so.4.5.2 lib/libopencv_structured_light.so.4.5.2 lib/libopencv_superres.so.4.5.2 lib/libopencv_surface_matching.so.4.5.2 lib/libopencv_tracking.so.4.5.2 lib/libopencv_videostab.so.4.5.2 lib/libopencv_wechat_qrcode.so.4.5.2 lib/libopencv_xfeatures2d.so.4.5.2 lib/libopencv_xobjdetect.so.4.5.2 lib/libopencv_xphoto.so.4.5.2 lib/libopencv_shape.so.4.5.2 lib/libopencv_highgui.so.4.5.2 lib/libopencv_datasets.so.4.5.2 lib/libopencv_ml.so.4.5.2 lib/libopencv_plot.so.4.5.2 lib/libopencv_phase_unwrapping.so.4.5.2 lib/libopencv_optflow.so.4.5.2 lib/libopencv_ximgproc.so.4.5.2 lib/libopencv_videoio.so.4.5.2 lib/libopencv_video.so.4.5.2 lib/libopencv_dnn.so.4.5.2 lib/libopencv_imgcodecs.so.4.5.2 lib/libopencv_objdetect.so.4.5.2 lib/libopencv_calib3d.so.4.5.2 lib/libopencv_features2d.so.4.5.2 lib/libopencv_flann.so.4.5.2 lib/libopencv_photo.so.4.5.2 lib/libopencv_imgproc.so.4.5.2 lib/libopencv_core.so.4.5.2 -Wl,-rpath-link,TOPDIR/tmp-glibc/work/core2-64-oe-linux/opencv/4.5.2-r0/build/lib && :
14lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::LogMessage(char const*, int)'
15lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::stream()'
16lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessage::~LogMessage()'
17lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::kLogSiteUninitialized'
18lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'fLI::FLAGS_v'
19lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::InitVLOG3__(int**, int*, char const*, int)'
20lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::LogMessageFatal(char const*, int)'
21lib/libopencv_sfm.so.4.5.2: error: undefined reference to 'google::LogMessageFatal::~LogMessageFatal()'
22collect2: error: ld returned 1 exit status
23
24 Add Glog_LIBS which is set to the same value as GLOG_LIBRARIES used to be.
25
26Upstream-Status: Submitted [https://github.com/opencv/opencv_contrib/pull/2923]
27
28Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
29---
30 modules/sfm/CMakeLists.txt | 1 +
31 1 file changed, 1 insertion(+)
32
33diff --git a/modules/sfm/CMakeLists.txt b/modules/sfm/CMakeLists.txt
34index 045a1fe6e..ee7cecdac 100644
35--- a/modules/sfm/CMakeLists.txt
36+++ b/modules/sfm/CMakeLists.txt
37@@ -84,6 +84,7 @@ set(LIBMV_LIGHT_LIBS
38 multiview
39 numeric
40 ${GLOG_LIBRARIES}
41+ ${Glog_LIBS}
42 ${GFLAGS_LIBRARIES}
43 )
44
diff --git a/recipes-support/opencv/opencv_4.5.2.imx.bb b/recipes-support/opencv/opencv_4.5.2.imx.bb
index 0566341a..2d71acfc 100644
--- a/recipes-support/opencv/opencv_4.5.2.imx.bb
+++ b/recipes-support/opencv/opencv_4.5.2.imx.bb
@@ -241,32 +241,28 @@ SUMMARY = "Opencv : The Open Computer Vision Library, i.MX Fork"
241 241
242LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" 242LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
243 243
244# Replace the opencv URL with the fork
244SRCREV_opencv = "5423d53ae0d116ee5bbe52f8b5503f0cd8586998" 245SRCREV_opencv = "5423d53ae0d116ee5bbe52f8b5503f0cd8586998"
245SRCREV_contrib = "f5d7f6712d4ff229ba4f45cf79dfd11c557d56fd" 246OPENCV_SRC ?= "git://source.codeaurora.org/external/imx/opencv-imx.git;protocol=https"
247SRCBRANCH = "4.5.2_imx"
248SRC_URI_remove = "git://github.com/opencv/opencv.git;name=opencv"
249SRC_URI =+ "${OPENCV_SRC};branch=${SRCBRANCH};name=opencv"
250
251# Add opencv_extra
246SRCREV_extra = "855c4528402e563283f86f28c6393f57eb5dcf62" 252SRCREV_extra = "855c4528402e563283f86f28c6393f57eb5dcf62"
247SRC_URI[tinydnn.md5sum] = "adb1c512e09ca2c7a6faef36f9c53e59" 253SRC_URI += " \
248SRC_URI[tinydnn.sha256sum] = "e2c61ce8c5debaa644121179e9dbdcf83f497f39de853f8dd5175846505aa18b" 254 git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra \
255 file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=../extra \
256"
249SRCREV_FORMAT_append = "_extra" 257SRCREV_FORMAT_append = "_extra"
250 258
251OPENCV_SRC ?= "git://source.codeaurora.org/external/imx/opencv-imx.git;protocol=https" 259# Add tiny-dnn
252SRCBRANCH = "4.5.2_imx" 260SRC_URI[tinydnn.md5sum] = "adb1c512e09ca2c7a6faef36f9c53e59"
253SRC_URI = "${OPENCV_SRC};branch=${SRCBRANCH};name=opencv \ 261SRC_URI[tinydnn.sha256sum] = "e2c61ce8c5debaa644121179e9dbdcf83f497f39de853f8dd5175846505aa18b"
254 git://github.com/opencv/opencv_extra.git;destsuffix=extra;name=extra \ 262SRC_URI += " \
255 git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \ 263 https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz;destsuffix=git/3rdparty/tinydnn/tiny-dnn-1.0.0a3;name=tinydnn;unpack=false \
256 git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=ipp;name=ipp \ 264 file://OpenCV_DNN_examples.patch \
257 git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc \ 265"
258 git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
259 git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face \
260 https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz;destsuffix=git/3rdparty/tinydnn/tiny-dnn-1.0.0a3;name=tinydnn;unpack=false \
261 file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
262 file://0003-To-fix-errors-as-following.patch \
263 file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
264 file://0001-Dont-use-isystem.patch \
265 file://download.patch \
266 file://0001-Make-ts-module-external.patch \
267 file://OpenCV_DNN_examples.patch \
268 file://0001-Add-smaller-version-of-download_models.py.patch;patchdir=../extra \
269 "
270 266
271PACKAGECONFIG_remove = "eigen" 267PACKAGECONFIG_remove = "eigen"
272PACKAGECONFIG_append_mx8 = " dnn text" 268PACKAGECONFIG_append_mx8 = " dnn text"