yoctorecipebitbakeqtgstreamer

Bitbake does not populate so symlinks to shared libaries


In my Yocto layer I have such bitbake recipe for Qt Gstreamer libraries:

SUMMARY = "QtGStreamer libraries for Qt5"
DESCRIPTION = "QtGStreamer is a set of libraries and plugins providing C++ bindings for GStreamer with a Qt-style API plus some helper classes for integrating GStreamer better in Qt applications."
SECTION = "multimedia"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"

SRC_URI[md5sum] = "fd794045a828c184acc1794b08a463fd"
SRC_URI[sha256sum] = "9f3b492b74cad9be918e4c4db96df48dab9c012f2ae5667f438b64a4d92e8fd4"

SRC_URI = "http://gstreamer.freedesktop.org/src/qt-gstreamer/${PN}-${PV}.tar.xz"

RDEPENDS_${PN} = "libgstpbutils-1.0 \
                gstreamer1.0 \
                qtdeclarative \
                glib-2.0 \
                libgstvideo-1.0 \
                libgstapp-1.0 \
                libgstaudio-1.0 \
                qtbase \
"

inherit cmake_qt5

export EXTRA_OECMAKE = "-DQT_VERSION=5 \
                        -DHW_PLATFORM=imx6 \
                        -DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${STAGING_DIR_NATIVE}/usr/bin/qt5/ \
                        -DUSE_QT_PLUGIN_DIR=OFF \
                        -DCMAKE_SKIP_INSTALL_RPATH=YES \
                        -DCMAKE_SKIP_RPATH=YES \
                        -DCMAKE_INSTALL_PREFIX="/" \
"

FILES_${PN} += "\
    ${libdir}/gstreamer-1.0/* \
"

INSANE_SKIP_qt-gstreamer = "installed-vs-shipped"

EXTRA_OECONF += "--disable-rpath"

As a result of this recipe in temporary build directory I have 3 files for each shared library created- one actual library and two symlinks like so:

libQt5GStreamer-1.0.so -> libQt5GStreamer-1.0.so.0
libQt5GStreamer-1.0.so.0 -> libQt5GStreamer-1.0.so.1.2.0
libQt5GStreamer-1.0.so.1.2.0

Now I wonder why in package ${PN} I have files libQt5GStreamer-1.0.so.0 and libQt5GStreamer-1.0.so.1.2.0 but no libQt5GStreamer-1.0.so ?

On the other hand I have this file included in package ${PN}-dev.

I tried to copy this file to package ${PN} by using FILES_${PN} but then I get QA error that I cannot have so symlinks in non-dev package.

My Qt application to play video depends on these *.so files so I need to have them on my target rootfs.

How to add those file to the image?


Solution

  • My Qt application to play video depends on these *.so

    This is probably the problem you should be solving: the .so should not be needed by the application at runtime. The way Yocto installs libraries and symlinks is quite standard: You will find this same division in Ubuntu and other distros.

    You can silence the QA warning with INSANE_SKIP_${PN} += "dev-so" but that won't change the fact that the bug is probably in the application.

    Alternatively you could of course make your application depend on the -dev package.