Yocto Project 未正确安装文件

Yocto Project not install files properly

我正在尝试为 MariaDB 的 C/C++ 连接器创建一个配方。

Bitbake 工作时没有错误或警告,但如果我检查图像中的文件,则缺少两个文件:

两者都在不同的包中(-dev 和 -staticdev),但出于某种原因没有运送到我的图像中。

有人有解决办法吗?

食谱如下:

 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
}

仅将特定包添加到图像可以通过例如IMAGE_INSTALL_append = " mariadb-dev" 在您的 local.conf(或图像配方)中。听起来你想在设备上编译一些东西,所以这不太可能做你想做的事(你仍然会缺少所有的开发工具和你需要的所有其他 -dev 包)。

我真的不建议在图像上进行开发(为什么不为你的应用程序写一个配方,让 Yocto 来处理编译和安装呢?)但是如果你想这样做,在 local.conf 应该有效:

EXTRA_IMAGE_FEATURES += "dev-pkgs tools-sdk"

这会将构建工具(gcc、make 等)和所有 -dev 包添加到映像中。有关详细信息,请参阅 the manual