5

I am trying to write a bitbake file for a project with uses autotools to configure the Makefiles.

### 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"

In the do_configure step where the configure script is called, I get this error message:

| 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

As you can see, configure is using sysroots/x86_64-linux/usr/lib/python2.7/site-packages for finding modules, but the modules are installed in sysroots/raspberrypi3/usr/lib/python2.7/site-packages.

How can I set the site-packages path in autoconf/configure call so it points to the correct path?

serkan.tuerker
  • 1,681
  • 10
  • 20
  • Can you provide your recipe? do you have `inherit distutils` inside? – Nayfe Jun 03 '19 at 19:22
  • @Nayfe Added the recipes – serkan.tuerker Jun 03 '19 at 20:14
  • did you try to remove pythonnative from inherit list? – Nayfe Jun 04 '19 at 18:13
  • @Nayfe Yes, but then I am getting another error. Gonna post it in a bit – serkan.tuerker Jun 04 '19 at 19:04
  • @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. ``` – serkan.tuerker Jun 04 '19 at 19:18
  • @Nayfe I think I have to configure an autoconf variable called `AC_CHECK_TOOL`. See [this patch](https://github.com/openembedded/meta-openembedded/blob/dd5622ef2b4065dc80ee549c57a2ec5010d0b4d1/meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch#L147) for an example. – serkan.tuerker Jun 04 '19 at 19:58

1 Answers1

-1

Keep in mind that the configure script is executed on the HOST and it looks for tools that are needed for compilation on the HOST as well, hence what you need is to DEPEND on the python-soundcloud-NATIVE package (you might need to use BBCLASSEXTEND for this package to exist), meaning that what that package installs, will be populated automatically on recipe-sysroot-native/x86_64-linux/usr/lib/python2.7/site-packages (since it DEPENDs on it) which is what the configure script will read automatically as well.

ah008a
  • 1,115
  • 6
  • 11
  • Are you sure that configure script should be executed natively and not in cross-compile target environment? – Nayfe Jun 04 '19 at 09:03
  • The cross compilers are also executed on the host, thats why they are cross compiling from host to target, plus you literally checked the path from which its trying to pull python libraries and the x86_64-linux part gives it away. – ah008a Jun 04 '19 at 18:08
  • @aehs29 Adding `python-soundcloud-native` to `DEPENDS` instead of `python-soundcloud` resulted in the same error. – serkan.tuerker Jun 04 '19 at 19:05