Yocto Project not install files properly

1.3k Views Asked by At

I am trying to create a recipe for the C/C++ Connector of MariaDB.

Bitbake works without errors or warnings but if I checked the files in my image there are two missing:

  • libmariadbclient.a
  • libmariadb.so

There are both in different packages (-dev and -staticdev) but for whatever reason there are not shipped to my image.

Does someone has a solution?

Here is the recipe:

 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
                file://win/packaging     /license.rtf;md5=0b6c50a153e2fca0364c97805d74ba50 \
                file://cmake/COPYING-CMAKE-SCRIPTS;md5=54c7042be62e169199200bc6477f04d1"

SRC_URI = "http://mirror2.hs-esslingen.de/mariadb//connector-c-3.0.2/mariadb-connector-c-3.0.2-src.tar.gz;name=source"

SRC_URI[source.md5sum] = "2eb5ba004ac105eebb538ead352c0c78"
SRC_URI[source.md256sum] = "518d14b8d77838370767d73f9bf1674f46232e1a2a34d4195bd38f52a3033758"

S = "${WORKDIR}/mariadb-connector-c-3.0.2-src"

DEPENDS = "zlib openssl gnutls krb5 curl"

PACKAGES =+"${PN}-include"

FILES_${PN}+="${libdir}/mariadb/libmariadb.so.3 \
    ${libdir}/mariadb/plugin/dialog.so \
    ${libdir}/mariadb/plugin/mysql_clear_password.so \
    ${libdir}/mariadb/plugin/remote_io.so \
    ${libdir}/mariadb/plugin/auth_gssapi_client.so \
    ${bindir}/mariadb_config"

FILES_${PN}-dev+="${libdir}/mariadb/libmariadb.so"

FILES_${PN}-staticdev+="${libdir}/mariadb/libmariadbclient.a"

FILES_${PN}-include+="${includedir}/mariadb/mariadb_com.h \
    ${includedir}/mariadb/mysql.h \
    ${includedir}/mariadb/mariadb_stmt.h \
    ${includedir}/mariadb/ma_pvio.h \
    ${includedir}/mariadb/ma_tls.h \
    ${includedir}/mariadb/mariadb_version.h \
    ${includedir}/mariadb/ma_list.h \
    ${includedir}/mariadb/errmsg.h \
    ${includedir}/mariadb/mariadb_dyncol.h \
    ${includedir}/mariadb/mariadb_ctype.h \
    ${includedir}/mariadb/mysqld_error.h \
    ${includedir}/mariadb/mysql/client_plugin.h \
    ${includedir}/mariadb/mysql/plugin_auth_common.h \
    ${includedir}/mariadb/mysql/plugin_auth.h \
    ${includedir}/mariadb/mariadb/ma_io.h "

RDEPENDS_${PN}+="${PN}-include"

inherit cmake

do_compile() {
    make
}
1

There are 1 best solutions below

0
On BEST ANSWER

Adding just a specific package to image can be done with e.g. IMAGE_INSTALL_append = " mariadb-dev" in your local.conf (or image recipe). It sounds like you want to compile something on device so this is unlikely to do what you want (you'd still be missing all the development tools and and all the other -dev packages you need).

I wouldn't really suggest developing on the image (why not write a recipe for your app and let Yocto handle the compiling and installing instead?) but if you want to do it, adding this in local.conf should work:

EXTRA_IMAGE_FEATURES += "dev-pkgs tools-sdk"

This adds build tools (gcc, make, etc) and all -dev packages to the image. See the manual for more details.