pythonraspberry-pi3buildroot

How to include python-dev in buildroot?


I'm making a buildroot for my Raspberry Pi 3 for a school project.

I've made a buildroot with everything from python included because I want to use WebIOPi. A buildroot has been done and the image has been written on the SDCard.

Now, when I want to install it on the buildroot device it asks for python-dev, which is not included by buildroot. With further research I've only found this. That's a python-dev0.4.0, but I think there's a much recent version on my virtual Ubuntu 16 OS.(main OS is Windows 10, so need image to use win32diskimager)

But I don't know how to implement this in the Python buildroot packages. I've already read the manuals from buildroot, it's kind of confusing for me...

I've already tried to make a directory named 'python-dev' in the buildroot/package directory (Ubuntu OS), but with no success.

This is what I've got so far:

buildroot/package/python-dev:

in the config.in file:

config BR2_PACKAGE_PYTHON_DEV
bool "python-dev"
help

in the python-dev.mk file (copied from libconfig):

################################################################################
#
# python-dev
#
################################################################################

PYTHON_DEV_VERSION = 0.4.0
PYTHON_DEV_SOURCE = dev-0.4.0.tar.gz
PYTHON_DEV_SITE = https://pypi.python.org/packages/53/34/e0d4da6c3e9ea8fdcc4657699f2ca62d5c4ac18763a897feb690c2fb0574/dev-0.4.0.tar.gz

PYTHON_DEV_LICENSE = Python software foundation license v2, others
PYTHON_DEV_LICENSE_FILES = README

PYTHON_DEV_SETUP_TYPE = setuptools

PYTHON_DEV_DEPENDENCIES = libconfig boost

$(eval $(python-package))

When I run a make menuconfig and search for python-dev, it's not there...

I hope someone could help me with this.

If there's an easier way, it's pretty much welcome.


Solution

  • The python-dev package that the WebIOPi setup script is checking for has nothing to do with the dev python package that you found at https://pypi.python.org/pypi/dev.

    The python-dev package is a package on Linux distributions that contains the development files for the Python library that is installed together with the Python interpreter. It installs the necessary files to allow C/C++ programs to link against libpython.

    Buildroot has already installed what you need in STAGING_DIR. However, you are probably trying to install WebIOPi directly on the target, which is not how Buildroot is intended to be used. Buildroot does not allow to do development on the target: it does not provide a compiler on the target, nor the necessary files for development.

    Buildroot is intended to be used as a cross-compilation environment. So what you should do instead is create a Buildroot package for WebIOPi, and have it cross-compiled (from your host machine), so that it gets installed, ready to use, in your target filesystem.