[oe-commits] [openembedded-core] 07/10: gstreamer1.0-plugins-bad: resolve opencv pkg-config in meson build

git at git.openembedded.org git at git.openembedded.org
Sun Feb 2 15:04:12 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 8b8966efc292417fc1a55c90878b1f13e660cb2e
Author: Andrey Zhizhikin <andrey.z at gmail.com>
AuthorDate: Mon Jan 27 10:44:44 2020 +0000

    gstreamer1.0-plugins-bad: resolve opencv pkg-config in meson build
    
    When opencv is picked in PACKAGECONFIG, plugin fails to locate data
    dirs. This is due to meson.build file uses 'test' utility to verify that
    the data dirs path is present and not taking sysroot into prefix.
    
    Introduce additional patch, which picks up PKG_CONFIG_SYSROOT_DIR as
    prefix for 'test' utility to verify the data dir is actually present.
    
    Signed-off-by: Andrey Zhizhikin <andrey.z at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...lve-missing-opencv-data-dir-in-yocto-buil.patch | 49 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.16.1.bb   |  1 +
 2 files changed, 50 insertions(+)

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch
new file mode 100644
index 0000000..4b6591c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch
@@ -0,0 +1,49 @@
+From f41caae14b618ab815ede3c408e7482b00316e3e Mon Sep 17 00:00:00 2001
+From: Andrey Zhizhikin <andrey.z at gmail.com>
+Date: Mon, 27 Jan 2020 10:22:35 +0000
+Subject: [PATCH] opencv: resolve missing opencv data dir in yocto build
+
+When Yocto build is performed, opencv searches for data dir using simple
+'test' command, this fails because pkg-config provides an absolute
+path on the target which needs to be prepended by PKG_CONFIG_SYSROOT_DIR
+in order for the 'test' utility to pick up the absolute path.
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Andrey Zhizhikin <andrey.z at gmail.com>
+---
+ ext/opencv/meson.build | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build
+index f38b55dfe..a26403482 100644
+--- a/ext/opencv/meson.build
++++ b/ext/opencv/meson.build
+@@ -78,20 +78,21 @@ else
+ endif
+ 
+ if opencv_found
++  pkgconf_sysroot = run_command(python3, '-c', 'import os; print(os.environ.get("PKG_CONFIG_SYSROOT_DIR"))').stdout().strip()
+   opencv_prefix = opencv_dep.get_pkgconfig_variable('prefix')
+   gstopencv_cargs += ['-DOPENCV_PREFIX="' + opencv_prefix + '"']
+ 
+   # Check the data dir used by opencv for its xml data files
+   # Use prefix from pkg-config to be compatible with cross-compilation
+-  r = run_command('test', '-d', opencv_prefix + '/share/opencv')
++  r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv')
+   if r.returncode() == 0
+     gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv"'
+   else
+-    r = run_command('test', '-d', opencv_prefix + '/share/OpenCV')
++    r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/OpenCV')
+     if r.returncode() == 0
+       gstopencv_cargs += '-DOPENCV_PATH_NAME="OpenCV"'
+     else
+-      r = run_command('test', '-d', opencv_prefix + '/share/opencv4')
++      r = run_command('test', '-d', pkgconf_sysroot + opencv_prefix + '/share/opencv4')
+       if r.returncode() == 0
+         gstopencv_cargs += '-DOPENCV_PATH_NAME="opencv4"'
+       else
+-- 
+2.17.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.1.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.1.bb
index 56ae7a1..024277e 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.1.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.16.1.bb
@@ -6,6 +6,7 @@ SRC_URI = " \
     file://fix-maybe-uninitialized-warnings-when-compiling-with-Os.patch \
     file://avoid-including-sys-poll.h-directly.patch \
     file://ensure-valid-sentinels-for-gst_structure_get-etc.patch \
+    file://opencv-resolve-missing-opencv-data-dir-in-yocto-buil.patch \
 "
 SRC_URI[md5sum] = "24d4d30ecc67d5cbc77c0475bcea1210"
 SRC_URI[sha256sum] = "56481c95339b8985af13bac19b18bc8da7118c2a7d9440ed70e7dcd799c2adb5"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list