Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 1 | From 3bc5d48257032b6bbee532aad15062fbbcc43bfe Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Andrey Zhizhikin <andrey.z@gmail.com> |
| 3 | Date: Mon, 27 Jan 2020 10:22:35 +0000 |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 4 | Subject: [PATCH] opencv: resolve missing opencv data dir in yocto build |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | |
| 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. |
| 10 | |
| 11 | Upstream-Status: Inappropriate [OE-specific] |
| 12 | |
| 13 | Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 14 | Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> |
| 15 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | --- |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 17 | ext/opencv/meson.build | 3 +++ |
| 18 | 1 file changed, 3 insertions(+) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | |
| 20 | diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 21 | index 1d86b90..b5c8b95 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 22 | --- a/ext/opencv/meson.build |
| 23 | +++ b/ext/opencv/meson.build |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 24 | @@ -87,6 +87,9 @@ if opencv_found |
| 25 | opencv_prefix = opencv_dep.get_variable('prefix') |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"'] |
| 27 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 28 | + pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip() |
| 29 | + opencv_prefix = pkgconf_sysroot + opencv_prefix |
| 30 | + |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | # Check the data dir used by opencv for its xml data files |
| 32 | # Use prefix from pkg-config to be compatible with cross-compilation |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 33 | r = run_command('test', '-d', opencv_prefix + '/share/opencv', check: false) |