[Buildroot] [PATCH v4 1/2] dependencies: build a host python2 if no suitable one can be found

Samuel Martin s.martin49 at gmail.com
Sun Oct 21 21:04:52 UTC 2012


Hi all,

Reviving an old thread...

2012/7/16 Samuel Martin <s.martin49 at gmail.com>:
> Some distros choose to change the /usr/bin/python binary, making it pointed
> to python3 instead of python2.
>
> This may have some bad consequences for packages that uses some
> non-python3-compliant python scripts in their build system (eg. in install
> or post-install scripts).
>
> This patch checks for a suitable python2 version (2.6 or 2.7) on the host
> system, and declares the following variables:
> - PYTHON2: pointing to the host python2 binary;
> - NEED_PYTHON2: sets to "host-python" if no python2 binary has been found.
>
> This way, a package using some python2 scripts must:
> - adds $(NEED_PYTHON2) to its dependency list;
> - sets $(PYTHON2) as the python binary to be used.
>
> A side effect of this patch is getting rid of any host python. Buildroot
> can runs on a host without python, or with a too old python2 version, or
> with only python3; in such case, $(NEED_PYTHON2) should be added to the
> dependency list. So, we can get rid of the python dependency check.
>

Just to let you know that this patch may also fix some issues with
scons, which does not seem to support python3 yet.
Any comment about this?


Regards,

-- 
Sam


More information about the buildroot mailing list