0

我正在尝试为 Alexa-SDK 添加一个自定义层。我创建了 *.bb 文件,当我运行 bitbake alexa 命令时,每个任务都成功完成。但我无法在 /tmp /deploy 或 /work 目录中找到 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} \"
4

1 回答 1

1

由于您在此处使用 cmake,因此您无需在此处编写 do_compile(),因为当您继承 cmake 时,cmake bbclass 会使用它。

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

你可以加

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

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

IMAGE_INSTALL_append = "sampleApp"

检查您现在是否在 rootfs 中获得了所需的 bin。

于 2019-07-21T19:57:12.577 回答