[Buildroot] [RFC] package/python-mako: build host-python-mako as python3 module for mesa3d build.

Romain Naour romain.naour at smile.fr
Sat Apr 13 16:46:06 UTC 2019

Since a long time, it was not possible to build mesa3d from the git
repository due to the missing dependency on host-python-mako package
in mesa3d package.

python-mako module is used by a python script
ir_expression_operation.py to build the header file

Hopefully when building mesa3d from a tarball release using the
autotools build system, this header is alreay generated and the build

But we are switching mesa3d package to meson build system that check
unconditionnaly if the mako module for python3 interpreter is present.

Even by removing this check, the meson build system call
ir_expression_operation.py script even if
ir_expression_operation_constant.h is already generated.

The problem with host-python-mako and mesa3d is that we need to build
mako module for python3 interpreter. Adding host-python-mako as mesa3d
dependency is not enough since it can be build as host python2 module
when BR2_PACKAGE_PYTHON3 is not selected for the target.

But adding python3 on the target in order to have a python3 module
on the host is not nice.

To build host-python-mako as python3 module we can add this line
in pyhon-mako package:

But python mako is not available anymore for python2 interpreter.

The problem is more global, how can we build the same python
module for python2 and/or python3 on the host ?

Mako module is also used by gnuradio build system and building
this module for python3 for mesa3d can eventually break the build of
gnuradio when the python interpreter on the host is python2
(to be tested).

Signed-off-by: Romain Naour <romain.naour at smile.fr>
Cc: Asaf Kahlon <asafka7 at gmail.com>
Cc: Bernd Kuhls <bernd.kuhls at t-online.de>
Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Cc: Yegor Yefremov <yegorslists at googlemail.com>
 package/python-mako/python-mako.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/python-mako/python-mako.mk b/package/python-mako/python-mako.mk
index 0d06dc4986..710e4bbe32 100644
--- a/package/python-mako/python-mako.mk
+++ b/package/python-mako/python-mako.mk
 # In host build, setup.py tries to download markupsafe if it is not installed
 HOST_PYTHON_MAKO_DEPENDENCIES = host-python-markupsafe
+# mesa3d python script use python-mako module only for python3.
+# So, build python-mako as python3 module.
+ifeq ($(BR2_PACKAGE_MESA3D),y)
 $(eval $(python-package))
 $(eval $(host-python-package))

More information about the buildroot mailing list