SRC_URI不适用于bitabake配方

时间:2017-08-17 07:52:56

标签: yocto bitbake

我创建了一个用于安装https://pypi.python.org/pypi/Adafruit-GPIO/1.0.3 python包的bitbake配方。以下是我的食谱

DESCRIPTION = "Library to provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO libraries"
SECTION = "devel/python"
LICENSE = "CLOSED"

PR = "r1"

SRC_URI = "https://pypi.python.org/packages/db/1c/2dc8a674514219f287fa344e44cadfd77b3e2878d6ff602a8c2149b50dd8/Adafruit_GPIO-1.0.3.tar.gz"

inherit pypi setuptools

do_install_append() {
  rm -f ${D}${libdir}/python*/site-packages/site.py*
}

do_compile_prepend() {
    ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_BUILD_ARGS} || \
    true
}
SRC_URI[md5sum] = "dfcdb1ba90188d18ba80b6d2958c8c33"

但每当我尝试咬食谱时,我总会收到以下错误

ERROR: Function failed: Fetcher failure for URL: 'https://pypi.python.org/packages/source/A/Adafruit-GPIO/Adafruit-GPIO-1.0.3.tar.gz'. Unable to fetch URL from any source

我的问题为什么当我在SRC_URI中有其他链接时,bitbake会尝试从其他链接下载?如何更正我的食谱>

1 个答案:

答案 0 :(得分:5)

pypi.bbclass指定另一个下载网址。

所以要么

  • 删除inherit pypi

  • 删除您的SRC_URI。在这种情况下,您还需要在pypi中将PYPI_PACKAGE = "Adafruit-GPIO"设置为正确的包名称(因为您的配方名称中包含-而不是_

请参阅pypi.bbclass

至少在我的系统上构建的未经测试的配方版本是adafruit-gpio_1.0.3.bb(注意,配方名称中只有小写字母):

DERIPTION = "Library to provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO libraries"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=e41c52dbe1b96447d1c50129a124f586"

SRC_URI[md5sum] = "dfcdb1ba90188d18ba80b6d2958c8c33"
SRC_URI[sha256sum] = "d6465b92c866c51ca8f3bc1e8f2ec36f5ccdb46d0fd54101c1109756d4a2dcd0"

PYPI_PACKAGE = "Adafruit_GPIO"
inherit pypi setuptools