用于自定义setup.py的BitBake配方

时间:2018-03-12 16:18:27

标签: yocto bitbake recipe

在我的食谱中,我必须下载git存储库并运行CMake。在CMake完成其工作后,创建了另外的目录OUT,其中包含我想在do_install中运行的setup.py文件? 我试过了:

DEPENDS = "setuptools python" 
do_install () {
python OUT/setup.py install 
}

但它没有引发setup.py发现错误。 谁能处理这样的问题?

3 个答案:

答案 0 :(得分:0)

这是因为bitbake不知道 setup.py 的存储位置 - 你需要使用bitbake生成的 $ {S} 变量来提供这个的完整路径脚本。

请阅读 do_install()任务的工作原理 - link

答案 1 :(得分:0)

目前我已经重组了我的食谱,如下所示:

LICENSE = "CLOSED"
BB_STRICT_CHECKSUM = "0"

inherit cmake setuptools pythonnative

DEPENDS = "boost udev python swig-native python-native python-setuptools-native cmake-native"

SRC_URI = " \
    git://github.com/my_repo.git;name=my_name \
    file://0001-system-install.patch \
"
SRCREV_my_name = "404ff3eeff0d79c15cbfdbc126c4bff2996baea6"

S = "${WORKDIR}/git"

PARALLEL_MAKEINST = ""

从CMake上的git base下载的项目,安装方式如下:

install(CODE "execute_process(COMMAND python \"${PROJECT_SOURCE_DIR}/python/setup.py\" \"install\")")

但是当我调用recipe来构建(bitbake my_recipe)或构建包含该食谱的图像(bitbake my_image)时,我收到了这样的错误:

ERROR: pc-ble-driver-git-r0 do_compile: python setup.py build execution failed.
ERROR: pc-ble-driver-git-r0 do_compile: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Logfile of failure stored in: /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502
Log data follows:
| DEBUG: Executing shell function do_compile
| ERROR: python setup.py build execution failed.
| /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/recipe-sysroot-native/usr/bin/python-native/python: can't open file 'setup.py': [Errno 2] No such file or directory
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /build/yocto-fsl/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/pc-ble-driver/git-r0/temp/log.do_compile.16502)
ERROR: Task (/build/yocto-fsl/sources/meta-slabs/recipes-external/pc-ble-driver/pc-ble-driver_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2195 tasks of which 2194 didn't need to be rerun and 1 failed.

P.S。在我的PC上,当我构建CMake项目并调用make install时,一切都按照我的假设进行。

还有其他建议如何处理?

答案 2 :(得分:-1)

尝试在配方文件中添加以下命令

value

,并在下面查看更多详细信息... /* Update shared limitInUse state via context consumer */ return (<IsUseContext.Consumer> { ({ setLimitInUse }) => <input onChange={ (event) => setLimitInUse(event.currentTarget.value) } /> } </IsUseContext.Consumer>)