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?
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.
Related
I am doing bitbake image -c populate_sdk to get my SDK but I can't find a way to get the flatc binary included in the SDK.
I have tried a do_install_append in my flatbuffers.bb file and I have put dependencies on various flatbuffers things in another .bb file. I have added to TOOLCHAIN_HOST_TASK_append in my machine .conf file.
I do get the flatbuffers header files in the SDK but only the ARM flatc not the native one.
Here is the dependency I put in the .bb file for a custom binary we have:
DEPENDS += "yaml-cpp libevent protobuf python3 nativesdk-flatbuffers flatbuffers-native flatbuffers"
DEPENDS_append_class-nativesdk = " flatbuffers"
Here is my flatbuffers .bb file
SUMMARY = "Memory Efficient Serialization Library"
HOMEPAGE = "https://github.com/google/flatbuffers"
SECTION = "console/tools"
LICENSE = "Apache-2.0"
PACKAGE_BEFORE_PN = "${PN}-compiler"
RDEPENDS_${PN}-compiler = "${PN}"
RDEPENDS_${PN}-dev += "${PN}-compiler"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559"
SRCREV = "c0698cc33f1e534bb59c455909b88cc2726089af"
SRC_URI = "git://github.com/google/flatbuffers.git"
# Make sure C++11 is used, required for example for GCC 4.9
CXXFLAGS += "-std=c++11"
BUILD_CXXFLAGS += "-std=c++11"
# BUILD_TYPE=Release is required, otherwise flatc is not installed
EXTRA_OECMAKE += "\
-DCMAKE_BUILD_TYPE=Release \
-DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_SHAREDLIB=ON \
"
# -DFLATBUFFERS_BUILD_FLATC=ON
#do_install_append() {
# install -d ${$D}/${bindir}
# install ${B}/flatc ${D}${bindir}
#}
inherit cmake
S = "${WORKDIR}/git"
FILES_${PN}-compiler = "${bindir}"
FILES_${PN} += "/usr/lib/*"
FILES_${PN} += "/opt/ousteros/2019.7/sysroots/*"
#FILES_${PN} += "${WORKDIR}/${SDK_ARCH}/usr/bin/flatc"
BBCLASSEXTEND = "native nativesdk"
I get the ARM flatc but not the x86_64 flatc which I need to build a header file that my other binary will need. My other binary doesn't yet require that header file, I first want to generate an SDK with flatc in it.
Don't mix target and nativesdk packages in DEPENDS.
To add native tools to the SDK you need to add nativesdk-flatbuffers-compiler to TOOLCHAIN_HOST_TASK in the image recipe that the SDK is created from.
I created an application with Room,Lifecycle,Paging libraries in android studio,its working well.
Then I tried to build the same application in AOSP,But I can't include Room,Lifecycle,Paging libraries.
I found all these libraries in frameworks/support/ .
But i don't have any idea about how to add these libraries.
Any clues on how to do it?
Add the following lines in your Android.mk file
LOCAL_STATIC_ANDROID_LIBRARIES += \
android-arch-room-runtime \
android-arch-paging-runtime \
I want to install my own custom deb package in yocto image. For this I am using following mydebpkg.bb recipe using ROOTFS_POSTPROCESS_COMMAND
SUMMARY = "Recipe for installing deb package"
DESCRIPTION = "It installs own deb package"
HOMEPAGE = ""
LICENSE = "CLOSED"
inherit bin_package
my_install_pkg_deb() {
${STAGING_BINDIR_NATIVE}/dpkg \
--root=${IMAGE_ROOTFS}/ --admindir=${IMAGE_ROOTFS}/var/lib/dpkg/ \
-i /home/pi1/install/own_1.3-07u_armhf.deb
}
ROOTFS_POSTPROCESS_COMMAND += "my_install_pkg_deb; "
But while building image the process fails with following error cannot install package mydebpkg and Function failed: do_rootfs. Where I am making mistake and what will be the correct recipe for installing any deb package.
Installing precompiled .deb is an awful decision, you should avoid doing so anytime you are able to compile the package from source code. If this isn't the case, I'd suggest doing something like this:
SUMMARY = "Recipe for installing deb package"
DESCRIPTION = "It installs own deb package"
HOMEPAGE = ""
LICENSE = "CLOSED"
DEPENDS += " dpkg-native "
SRC_URI += " \
file://own_1.3-07u_armhf.deb.zip \
"
do_install_append() {
touch ${STAGING_DIR_NATIVE}/var/lib/dpkg/status
${STAGING_BINDIR_NATIVE}/dpkg --instdir=${D}/ \
--admindir=${STAGING_DIR_NATIVE}/var/lib/dpkg/ \
-i ${WORKDIR}/own_1.3-07u_armhf.deb
}
So: use SRC_URI variable to let bitbake copy your .deb file to the working dir. I suggest you zip the file as bitbake tries to unpack all the archives you supply him, and .deb is just another archive. So pack it to zip and let bitbake bring your .deb file to the working directory. Place your .deb.zip file by /path/to/your/recipe/files folder. Remember: never use absolute paths in yocto!
Then in do_install function invoke dpkg to install your .deb file into deploy dir of your package. This code is not complete as in case of a successful installation (don't forget about conflict resolution), you will get a list of files and directories that installed but not shipped in any package. You will need to add to your recipe FILES_${PN} variable:
FILES_${PN} += " \
/usr/bin/some_file \
/etc/some_config_file \
/and_so_on \
"
The complete list what you need to add you can get from the error message.
And remember: this method will only work if your target architecture is the same as your host architecture. Regarding that you used STAGING_BINDIR_NATIVE variable this is the case, regarding that your package contains arm, this isn't.
I am working on yocto i have compiled a library using yocto, which installed library inside
/tmp/work/corei7-64-poky-linux/lib-ad/git-r0/package/usr/lib/libad.a
Now inside my recipe i have included
FILES_${PN} += " \
libad.a \
"
Now this is adding this file into build-corei7-64/tmp/sysroots/corei7-64/usr/lib/libad.a
but not into final rootfs, I assume FILES_${PN} will copy my files into rootfs.
but this is not happening.
Any help is appreciated, Thank You
Well, up to now you managed to build and package your code correctly.
I guess you mean with rootfs the image that you build. To add a package to an image you can set IMAGE_INSTALL_append = "lib-ad" within your local conf
I'm using bitbake to compile rygel for yocto from the meta-openembedded layer, with the plugins mpris and gst-launch.
As per the PACKAGECONFIG docs, I created a bbappend file and added the following:
EXTRA_OECONF = "--disable-introspection \
--disable-tracker-plugin \
--with-media-engine=gstreamer \
--enable-mpris-plugin \
--enable-gst-launch-plugin"
PR = "r1"
It compiles and installs, but has no plugins.
The append shows up when I run bitbake-layers show-appends, so at least bitbake is finding it. After running bitbake the directory tmp/work/core2-64-poky-linux/rygel/0.26.1-r1/image/usr/lib/rygel-2.6/plugins/ is populated. Then when I run the image /usr/lib/rygel-2.6/ contains an engines dir and nothing else.
Any idea where I'm going wrong?
I don't think your read all the way down to "If you want to change an existing PACKAGECONFIG block, you can do so one of two ways:".
From a bbappend, just do
PACKAGECONFIG_append = " mpris gst-launch"
In the recipe do_install, they remove some of the engines and plugins files. This might be the reason you do not see them in your image.
do_install_append() {
# Remove .la files for loadable modules
rm -f ${D}/${libdir}/rygel-${LIBV}/engines/*.la
rm -f ${D}/${libdir}/rygel-${LIBV}/plugins/*.la
}
your compiling plugins successfully and not able to see in board(rootfs)? if yes please add below line in your .bbappend file. '
FILES_${PN} += "${libdir}/*"
this will add all your compiled plugins to your rootfs image.