2

I created a bitbake recipe for installing https://pypi.python.org/pypi/Adafruit-GPIO/1.0.3 python package. Following is my recipe

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"

But whenever I try to bitbake recipe I always receive following error

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

My question why does bitbake tries to download from some other link while I have some other link in SRC_URI? How can I correct my recipe>

prattom
  • 1,625
  • 11
  • 42
  • 67

1 Answers1

6

It's pypi.bbclass that specifies another download URL.

So either

  • remove inherit pypi

or

  • remove your SRC_URI. In this case, you will also need to set PYPI_PACKAGE = "Adafruit-GPIO" to the correct package name in pypi (as your recipe has a - instead of a _ in its name).

See pypi.bbclass

An untested version of your recipe that at least builds on my system is adafruit-gpio_1.0.3.bb (note, only lowercase letters in the recipe name):

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
Anders
  • 8,541
  • 1
  • 27
  • 34
  • Thanks for your answer. One more question, how can I find the correct package name. For example https://pypi.python.org/pypi/Adafruit-ADS1x15/1.0.2 for this I am using PYPI_PACKAGE = "Adafruit-ADS1x15" but ut shows fetcg error. Even PYPI_PACKAGE = "Adafruit_ADS1x15" doesn't work in this case. – prattom Aug 17 '17 at 10:00
  • You doesn't tell me what went wrong. However, I've just modified your example to at least build for me. See my edited answer. – Anders Aug 17 '17 at 10:46
  • Thanks I understand now where I was making mistake – prattom Aug 18 '17 at 07:14