[meta-freescale] Reference headers/library generated by one recipe in another

Searles, Dan Dan.Searles at garmin.com
Thu Apr 25 08:45:45 PDT 2019


The following recipe is from:
sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/imx-dpu-g2d/imx-dpu-g2d_1.6.0.bb

# Copyright (C) 2016 Freescale Semiconductor
# Copyright 2017-2018 NXP
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "GPU G2D library and apps for i.MX with 2D GPU and DPU"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://COPYING;md5=6dfb32a488e5fd6bae52fbf6c7ebb086"

RDEPENDS_${PN} = "libgal-imx libdrm"

PROVIDES += "virtual/libg2d"

SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true"

S="${WORKDIR}/${PN}-${PV}"

inherit fsl-eula-unpack

SRC_URI[md5sum] = "080de224085c37db107b5e477bd7900a"
SRC_URI[sha256sum] = "854014164be517467252a2f0a79145bdcdd2892243b317ba25a3157d85a612ba"

do_install () {

    install -d ${D}${libdir}
    install -d ${D}${includedir}

    cp -r ${S}/g2d/usr/lib/*.so* ${D}${libdir}
    cp -Pr ${S}/g2d/usr/include/* ${D}${includedir}
    cp -r ${S}/gpu-demos/opt ${D}
}

INSANE_SKIP_${PN} += "ldflags"

FILES_${PN} = "${libdir}/libg2d* /opt"
FILES_${PN}-dev = "${libdir}/libg2d${SOLIBSDEV} ${includedir}"

# Compatible only with i.MX DPU
COMPATIBLE_MACHINE = "(^$)"
COMPATIBLE_MACHINE_imxdpu = "${MACHINE}"

It appears to install some headers and a library.
I'm trying to use the headers and library produced by this recipe in another recipe. Does there need to be a .pc file for this? Can you say what it would contain?
If I copy the headers and .so file directly to the directory where I include, compile and link with them I can build a small executable outside Yocto.
But to use a recipe to build that small executable, how would I specify the DEPENDS so that the headers/library become accessible during the Yocto build?
The above PROVIDES uses 'virtual' so maybe I would have to use a PREFERRED_PROVIDER?

Here is my attempt:
SUMMARY = "G2D app-1.0.0"
DESCRIPTION = "G2D app-1.0.0"
SECTION = "apps"

inherit pkgconfig

#  imx-dpu-g2d
#DEPENDS = "glib-2.0 dpu-g2d"
DEPENDS = "glib-2.0  virtual/libg2d"
#DEPENDS = "glib-2.0"
#DEPENDS = "glib-2.0 imx-dpu-g2d"

DEPENDS_append_imxgpu2d = " virtual/libg2d"

LDFLAGS='-L=/usr/lib'

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += " \
  file://. \
"

do_compile() {
  ${CXX} ${WORKDIR}/g2d-app_1.cpp -o g2d-app_1 ${CXXFLAGS} ${LDFLAGS} `pkg-config --cflags --libs g2d`
}

do_install() {
  install -d ${D}${bindir}/
  install -m 0755 ${S}/gst-app_1 ${D}${bindir}/
}

FILES_${PN} += " \
  ${bindir}/ \
"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20190425/0c71905d/attachment.html>


More information about the meta-freescale mailing list