0

I'm in the process of adding a third-party software package to my imx6q yocto build. I followed the guide and create a separate meta layer and added the following recipe to the newly created layer under the subfolder with package name.

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"

I thought that the do_install command is enough to add this package to the /usr/lib and /usr/include of the rootfs but it doesn't. The package is added to /usr/lib and /usr/include of the sysroot-destdir

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

i also tried adding a recipes-images/udoo-image-full-cmdline.bbappend which contains

IMAGE_INSTALL_append = "libuavcan libuavcan-dev"

udoo-image-full-cmdline is the image im creating. But this too doesnt work; if i add the append command to local.conf, then the do_rootfs fails with the following error

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. 

I dont quite understand yocto terminology well, i'm certain i might be missing something important here. If anyone could help me understand how to deal with this in a better way i'd be very grateful.

Asusrog
  • 11
  • 1
  • You shouldn't override `OECMAKE_*` variables, and use ${B} instead of ${S}. `do_compile()` step put files in ${B} folder and install usually put those from ${B} to ${D}. `FILES_${PN}` is relative to `rootfs`, so you don't want to use `${S}` and directly put `FILES_${PN} += "/something"`. – Nayfe Nov 24 '19 at 09:58
  • You can check where files are installed with `oe-pkgdata-util list-pkg-files -p ` and check for mistakes with something like `bitbake -e | grep ^[A-Z_]*[A-Z_]*=` – Nayfe Nov 24 '19 at 10:05
  • `FILES_${PN}` is already relative to `${D}`. So you don't need to use `${S}` and specify the path. And also you need to mention files (not the whole directory). For example, `FILES_${PN} = "${libdir}/*` will include the libraries. Similarly, you can add the includes as well. – Parthiban Nov 25 '19 at 12:53

0 Answers0