Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 1 | From f19ff66640f2f472c4e9d9055253032d34e125c6 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 | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 4 | Subject: [PATCH 4/4] 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> |
| 14 | --- |
| 15 | ext/opencv/meson.build | 7 ++++--- |
| 16 | 1 file changed, 4 insertions(+), 3 deletions(-) |
| 17 | |
| 18 | diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 19 | index 0b0b3fc..0ed3344 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | --- a/ext/opencv/meson.build |
| 21 | +++ b/ext/opencv/meson.build |
| 22 | @@ -78,20 +78,21 @@ else |
| 23 | endif |
| 24 | |
| 25 | if opencv_found |
| 26 | + pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip() |
| 27 | opencv_prefix = opencv_dep.get_pkgconfig_variable('prefix') |
| 28 | gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"'] |
| 29 | |
| 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') |
| 33 | + r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv') |
| 34 | if r.returncode() == 0 |
| 35 | gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv"' |
| 36 | else |
| 37 | - r = run_command('test', '-d', opencv_prefix + '/share/OpenCV') |
| 38 | + r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/OpenCV') |
| 39 | if r.returncode() == 0 |
| 40 | gstopencv_cargs += '-DOPENCV_PATH_NAME="OpenCV"' |
| 41 | else |
| 42 | - r = run_command('test', '-d', opencv_prefix + '/share/opencv4') |
| 43 | + r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv4') |
| 44 | if r.returncode() == 0 |
| 45 | gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv4"' |
| 46 | else |
| 47 | -- |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 48 | 2.28.0 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 49 | |