0

我正在将第三方软件包添加到我的 imx6q yocto 构建中。我按照指南创建了一个单独的元层,并将以下配方添加到具有包名称的子文件夹下的新创建层中。

SUMMARY = "light-weight can protocol 'UAVCAN' implementation based on C++"
HOMEPAGE = "https://uavcan.org/"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1b59e4524bdc7bdb14e2af001b180e14"

inherit pkgconfig cmake pythonnative

SRCREV   = "81d859a401da95720336c9fe6a4622278f796bc8"
SRC_URI  = "git://github.com/Tal-seven/libuavcan.git"

S = "${WORKDIR}/git"
OECMAKE_SOURCEPATH = "${S}"
OECMAKE_BUILDPATH   = "${S}/build"


do_install(){
        install -d ${D}${libdir}/
        install -m 0755 ${S}/../build/libuavcan/libuavcan.a ${D}${libdir}
        install -d ${D}${includedir}/uavcan
        install -d ${D}${includedir}/uavcan
        cp -r ${S}/libuavcan/include/uavcan/* ${D}${includedir}/uavcan/
        cp -r ${S}/libuavcan/include/dsdlc_generated/uavcan/* ${D}${includedir}/uavcan/
        cp -r ${S}/libuavcan_drivers/linux/include/uavcan_linux ${D}${includedir}
        cp -r ${S}/libuavcan_drivers/posix/include/uavcan_posix ${D}${includedir}       
}

FILES_${PN} += "${S}/libuavcan_drivers/posix/include/uavcan_posix/"
FILES_${PN} += "${S}/libuavcan_drivers/linux/include/uavcan_linux/*"
FILES_${PN} += "${S}/libuavcan/include/uavcan/" 
FILES_${PN} += "${S}/libuavcan/include/dsdlc_generated/uavcan/" 
FILES_${PN} += "${S}/../build/libuavcan/libuavcan.a"

#FILES_${PN}-dev += "${S}/../build/libuavcan/libuavcan.a" 

BB_STRICT_CHECKSUM = "0"

我认为 do_install 命令足以将此包添加到 rootfs 的 /usr/lib 和 /usr/include 中,但事实并非如此。该软件包被添加到 sysroot-destdir 的 /usr/lib 和 /usr/include 中

build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/libuavcan/1.0-r0/sysroot-destdir

我还尝试添加一个 recipes-images/udoo-image-full-cmdline.bbappend 其中包含

IMAGE_INSTALL_append = "libuavcan libuavcan-dev"

udoo-image-full-cmdline 是即时创建的图像。但这也行不通;如果我将 append 命令添加到 local.conf,则 do_rootfs 失败并出现以下错误

Collected errors:                                                                                                                                                                                                                            
 * opkg_install: Cannot install package libuavcan.                                                                                                                                                                                           
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for libuavcan-dev:                                                                                                                                                    
 *      libuavcan (= 1.0-r0) *                                                                                                                                                                                                               
 * opkg_install: Cannot install package libuavcan-dev. 

我不太了解 yocto 术语,我敢肯定我可能在这里遗漏了一些重要的东西。如果有人可以帮助我了解如何以更好的方式处理这个问题,我将不胜感激。

4

0 回答 0