【问题标题】:Set python dist-packages path for autotools in Yocto bitbake在 Yocto bitbake 中为 autotools 设置 python dist-packages 路径
【发布时间】:2019-10-19 08:20:13
【问题描述】:

我正在尝试为使用自动工具配置 Makefile 的项目编写 bitbake 文件。

### tizonia.bb
SUMMARY = "Tizonia Library"
DESCRIPTION = "Tizonia"
LICENSE = "LGPL-3.0"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"

SRC_URI = "git://github.com/tizonia/tizonia-openmax-il.git;protocol=https"
SRCREV = "9004bc40b89eeafb04b28fbb2b772e47dd62fdc9"

S = "${WORKDIR}/git"

DEPENDS = "python-dev python-setuptools mediainfo log4c python-pip python-soundcloud"

inherit autotools ccache pkgconfig python-dir pythonnative

RDEPENDS_${PN} = "libstdc++ dbus boost libgcc mediainfo log4c libspotify python-pip python-soundcloud"

### python-soundcloud.bb
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=31fa3a9dc818e0087893d63583d2d21a"

SRC_URI[md5sum] = "40c1d32afd019ed11ec1fbee3e84e31f"
SRC_URI[sha256sum] = "aad2003592cec945f835f158f7b41ba8bf805c5738a2fcc5629668ea1df653d5"

DEPENDS = "${PYTHON_PN}-modules"

PYPI_PACKAGE = "soundcloud"

inherit pypi setuptools

RDEPENDS_${PN} = "${PYTHON_PN}-modules"

在调用configure 脚本的do_configure 步骤中,我收到以下错误消息:

| checking for python2.7... (cached) /home/developer/build-webos-ose/BUILD/sysroots/x86_64-linux/usr/bin/python-native/python
| checking for a version of Python >= '2.1.0'... yes
| checking for a version of Python >= '2.7'... yes
| checking for the distutils Python package... yes
| checking for Python include path... -I/home/developer/build-webos-ose/BUILD/sysroots/raspberrypi3/usr/include/python2.7
| checking for Python library path... -L/home/developer/build-webos-ose/BUILD/sysroots/raspberrypi3/usr/lib -lpython2.7
| checking for Python site-packages path... /home/developer/build-webos-ose/BUILD/sysroots/x86_64-linux/usr/lib/python2.7/site-packages
| checking python extra libraries... -lpthread -ldl  -lpthread -lutil -lm
| checking python extra linking flags... -Xlinker -export-dynamic
| checking consistency of all components of python development environment... yes
| checking python module: soundcloud... no
| configure: error: failed to find required module soundcloud

如您所见,configure 使用sysroots/x86_64-linux/usr/lib/python2.7/site-packages 查找modules,但模块安装在sysroots/raspberrypi3/usr/lib/python2.7/site-packages 中。

如何在autoconf/configure 调用中设置site-packages 路径,使其指向正确的路径?

【问题讨论】:

  • 你能提供你的食谱吗?你里面有inherit distutils吗?
  • @Nayfe 添加了食谱
  • 您是否尝试从继承列表中删除 pythonnative?
  • @Nayfe 是的,但是我又遇到了另一个错误。一会儿发过来
  • @Nayfe | checking consistency of all components of python development environment... no | | Could not link test program to Python. Maybe the main Python library has been | installed in some non-standard library path. If so, pass it to configure, | via the LDFLAGS environment variable. | Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" | | ERROR! | You probably have to install the development version of the Python package | for your distribution. The exact name of this package varies among them.

标签: python yocto autotools automake bitbake


【解决方案1】:

请记住,配置脚本是在主机上执行的,它也会查找主机上编译所需的工具,因此您需要依赖于 python-soundcloud-NATIVE 包(您可能需要使用 BBCLASSEXTEND 以使该软件包存在),这意味着该软件包安装的内容将在 recipe-sysroot-native/x86_64-linux/usr/lib/python2.7/site-packages 上自动填充(因为它依赖于它)这也是配置脚本会自动读取的内容。

【讨论】:

  • 您确定配置脚本应该在本地执行而不是在交叉编译目标环境中执行吗?
  • 交叉编译器也在主机上执行,这就是它们从主机到目标交叉编译的原因,而且你从字面上检查了它试图从中提取 python 库和 x86_64-linux 部分给出的路径它走了。
  • @aehs29 将python-soundcloud-native 添加到DEPENDS 而不是python-soundcloud 会导致相同的错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-02-05
  • 1970-01-01
  • 2019-09-30
  • 2017-10-03
  • 1970-01-01
  • 2015-04-09
  • 1970-01-01
相关资源
最近更新 更多