1 From d3121e8febdb5cb00511624983c24e50441b64e8 Mon Sep 17 00:00:00 2001
2 From: Andrey Zhizhikin <andrey.z@gmail.com>
3 Date: Mon, 27 Jan 2020 10:22:35 +0000
4 Subject: [PATCH] opencv: resolve missing opencv data dir in yocto build
6 When Yocto build is performed, opencv searches for data dir using simple
7 'test' command, this fails because pkg-config provides an absolute
8 path on the target which needs to be prepended by PKG_CONFIG_SYSROOT_DIR
9 in order for the 'test' utility to pick up the absolute path.
11 Upstream-Status: Inappropriate [OE-specific]
13 Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
14 Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
16 gst-libs/gst/opencv/meson.build | 3 +++
17 1 file changed, 3 insertions(+)
19 diff --git a/gst-libs/gst/opencv/meson.build b/gst-libs/gst/opencv/meson.build
20 index 1d337f1..f47939a 100644
21 --- a/gst-libs/gst/opencv/meson.build
22 +++ b/gst-libs/gst/opencv/meson.build
23 @@ -52,6 +52,9 @@ if opencv_found
24 # /usr/include/opencv4/opencv2/flann/logger.h:83:36: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
25 gstopencv_cargs += cxx.get_supported_arguments(['-Wno-missing-include-dirs', '-Wno-format-nonliteral'])
27 + pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip()
28 + opencv_prefix = pkgconf_sysroot + opencv_prefix
30 # Check the data dir used by opencv for its xml data files
31 # Use prefix from pkg-config to be compatible with cross-compilation
32 r = run_command('test', '-d', opencv_prefix + '/share/opencv', check: false)