如何使用 bitbake for RaspberryPi 编译 Alexa-SDK 的 SampleApp



我正在尝试为Alexa-SDK添加一个自定义层。我创建了 *.bb 文件,当我运行 bitbake alexa 命令时,每个任务都成功完成。但是我无法在/tmp/deploy 或/work dirrtorry 中找到 SampleApp 可执行文件。

这是我的 *.bb 文件

SUMMARY = "bitbake-alexa recipe" 
DESCRIPTION = "Alexa SDK"  
SECTION = "alexa" 
LICENSE = "CLOSED"
SRC_URI = "git://github.com/alexa/avs-devicesdk.git;branch=master;protocol=https"
SRCREV = "8bf0160c5e56a3d5ebc1e1caeab14afc8658b0da"
INSANE_SKIP_${PN} = "dev-so" 
TARGET_CC_ARCH += "${LDFLAGS}"
S = "${WORKDIR}/git" 
SB = "${WORKDIR}/build"
AVS_DIR ?= "/home/root/Alexa_SDK"
inherit cmake
EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RELEASE 
                 -DGSTREAMER_MEDIA_PLAYER=ON 
                 -DCMAKE_INSTALL_PREFIX=${D}${AVS_DIR}/avs-sdk-client 
                 -DPORTAUDIO=ON  
                 -DPORTAUDIO_LIB_PATH=${STAGING_LIBDIR}/libportaudio.so 
                 -DPORTAUDIO_INCLUDE_DIR=${STAGING_INCDIR} 
"
RDEPENDS_${PN} += "bash perl" 
DEPENDS = "curl sqlite3 portaudio-v19 gstreamer1.0-plugins-base"
do_compile() {
    cd ${SB}
    oe_runmake ${PARALLEL_MAKE} SampleApp 
}
do_install() {
    install -d -m 0755 ${D}${AVS_DIR}
    install -d -m 0755 ${D}/sounds
    install -d -m 0755 ${D}/database
    install -d -m 0755 ${D}${AVS_DIR}/avs-sdk-client
    cd ${SB}
    find ./ -executable -type f -exec cp --parents -v {} 
   ${D}/${AVS_DIR}/avs-sdk-client ;
    find ./ -name *.py -exec cp --parents -v {} ${D}/${AVS_DIR}/avs-sdk-client ;
    find ${D}/${AVS_DIR}/avs-sdk-client -name "*.py" -exec sed -e s#${SB}#${AVS_DIR}/avs-sdk-client#g -i {} ;
    mkdir ${D}/${AVS_DIR}/avs-sdk-client/Integration
    mkdir ${D}/${AVS_DIR}/libs
    cd ${D}/${AVS_DIR}/libs
    find ../avs-sdk-client -executable -type f -exec ${WORKDIR}/libsInstall.sh {} ;
    cp -r -L ${S} ${D}/${AVS_DIR}/avs-device-sdk
    cd ${D}/${AVS_DIR}/avs-device-sdk
    git repack -a -d 
}
FILES_${PN} = "${AVS_DIR} /sounds /database" 
BBCLASSEXTEND = "native"

请建议我缺少什么,因为我想使 SampleApp 成为图像的一部分并在 RaspberryPi 上运行它

更新的 .bb 文件

 SUMMARY = "bitbake-alexa recipe" DESCRIPTION = "Alexa SDK"  SECTION = "alexa" LICENSE = "CLOSED"
    SRC_URI = "git://github.com/alexa/avs-device-sdk.git;branch=master;protocol=https"
    SRCREV = "8bf0160c5e56a3d5ebc1e1caeab14afc8658b0da"

    S = "${WORKDIR}/git" SB = "${WORKDIR}/build"
    TARGET_CXXFLAGS += " -D_GLIBCXX_USE_CXX11_ABI=0
    -Wno-error=class-memaccess" 
inherit cmake 
INSANE_SKIP_${PN} = "install-vs-shipped" 
INSANE_SKIP_${PN} = "ldflags"
    AVS_DIR ?= "/home/root/Alexa_SDK"

    EXTRA_OECMAKE = "      -DCMAKE_BUILD_TYPE=DEBUG   -DGSTREAMER_MEDIA_PLAYER=ON 
            -DCMAKE_INSTALL_PREFIX=${D}${AVS_DIR}/avs-sdk-client   -DPORTAUDIO=ON     -DPORTAUDIO_LIB_PATH=${STAGING_LIBDIR}/libportaudio.so     -DPORTAUDIO_INCLUDE_DIR=${STAGING_INCDIR}  " RDEPENDS_${PN} += "bash 
            perl" 
            DEPENDS = "    curl   sqlite3 
            portaudio-v19      gstreamer1.0-plugins-base       
            gstreamer1.0-plugins-base 
            gstreamer1.0-plugins-good 
            gstreamer1.0-plugins-bad   gstreamer1.0-plugins-ugly       
          gstreamer1.0-libav  "
 do_install(){
         install -d -m 0755 ${D}${AVS_DIR}
         install -d -m 0755 ${D}${AVS_DIR}/avs-sdk-client
         find ./ -executable -type f -exec cp --parents -v {} 
         ${D}/${AVS_DIR}/avs-sdk-client ;
         find ./ -name *.py -exec cp --parents -v {} ${D}/${AVS_DIR}/avs- 
         sdk-client ;
         find ${D}/${AVS_DIR}/avs-sdk-client -name "*.py" -exec sed -e 
         s#${SB}#${AVS_DIR}/avs-sdk-client#g -i {} ;
         mkdir ${D}/${AVS_DIR}/libs
         cd ${D}/${AVS_DIR}/libs
         find ../avs-sdk-client -executable -type f -exec 
         ${WORKDIR}/libsInstall.sh {} ;
         cp -r -L ${S} ${D}/${AVS_DIR}/avs-device-sdk
         cd ${D}/${AVS_DIR}/avs-device-sdk
         git repack -a -d
         rm .git/objects/info/alternates
 }
FILES_${PN}  += "${bindir}/SampleApp 
                          ${AVSDIR} "

由于您在这里使用 cmake,因此您不需要在此处编写 do_compile((,因为 cmake bbclass 会在您继承 cmake 时使用它。

如果CmakeLists.txt适合您的应用程序,yocto将编译它并创建所需的bins/libs作为其中的一部分。

您可以添加

     FILES_${PN}  += "${bindir}/sample app 
                      ${AVSDIR} 
                      sounds"

然后将您的软件包添加到相应的软件包组中或添加到 local.conf 中。

IMAGE_INSTALL_append = "sampleApp"

检查现在您是否在 rootfs 中获取所需的箱。

相关内容

  • 没有找到相关文章

最新更新