When OpenCV is being built with the "fastcv" packageconfig, several
OpenCV libs are linked against the libfastcv.a. At runtime this lib will
dlopen(libfastcvopt.so.1), providing a fallback to slow algorithms, etc.
However as it is dlopen() rather than dynamic linking, there is no
runtime dependency.

In Yocto, if we enable a feature, we expect that all runtime
dependencies are pulled in. Utilize the qcom-fastcv-binaries recipe
provided by the meta-qcom layer and pull in libfastcvopt1 package as
required.

Cc: Pulkit Singh Tak <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
---
 meta-oe/recipes-support/opencv/opencv_4.12.0.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb 
b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb
index aa11d3da43fd..c0b657f1039a 100644
--- a/meta-oe/recipes-support/opencv/opencv_4.12.0.bb
+++ b/meta-oe/recipes-support/opencv/opencv_4.12.0.bb
@@ -122,7 +122,7 @@ PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON 
-DINSTALL_TESTS=ON,-DBUILD_TESTS=OFF,,"
 PACKAGECONFIG[text] = 
"-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
 PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
 PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
-PACKAGECONFIG[fastcv] = "-DWITH_FASTCV=ON ,-DWITH_FASTCV=OFF,,"
+PACKAGECONFIG[fastcv] = "-DWITH_FASTCV=ON 
,-DWITH_FASTCV=OFF,qcom-fastcv-binaries,"
 
 inherit pkgconfig cmake setuptools3-base python3native
 
@@ -165,6 +165,11 @@ python populate_packages:prepend () {
         if not pkg in blacklist and not pkg in metapkg_rdepends and not 
pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') 
and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
             metapkg_rdepends.append(pkg)
     d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends))
+
+    fastcv_pkgs = ["libopencv-core", "libopencv-fastcv", "libopencv-imgproc"]
+    if bb.utils.contains('PACKAGECONFIG', 'fastcv', True, False, d):
+        for pkg in fastcv_pkgs:
+            d.appendVar('RDEPENDS:' + pkg, " libfastcvopt1")
 }
 
 PACKAGES_DYNAMIC += "^libopencv-.*"
-- 
2.47.3

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#122558): 
https://lists.openembedded.org/g/openembedded-devel/message/122558
Mute This Topic: https://lists.openembedded.org/mt/116714125/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to