Files
buildroot/package
Thomas Petazzoni f75239d1b5 package/pkg-python: use host-python3-setuptools when needed
When a package uses "setuptools" as its <pkg>_SETUP_TYPE, we currently
add a dependency on host-python-setuptools. This means that:

 (1) When BR2_PACKAGE_PYTHON=y, the default host Python version is
     Python 2.x, and host-python-setuptools is installed for
     host-python.

 (2) When BR2_PACKAGE_PYTHON3=y, the default host Python version is
     Python 3.x, and host-python-setuptools is installed for
     host-python3.

 (3) When no target Python interpreter is selected, the default host
     Python version is Python 2.x, and host-python-setuptools is
     installed for host-python.

Situations (1) and (3) are problematic for host Python packages that
need Python 3.x. Such packages use <pkg>_NEEDS_HOST_PYTHON = python3,
but if they use setuptools as their setup type, they will not find
setuptools installed for host-python3 in situations (1) and (3)
described above.

We currently have a single package that sets <pkg>_NEEDS_HOST_PYTHON =
python3: host-meson. host-meson generally works because if setuptools
is not found, it falls back to distutils, which is part of the
standard Python library. However, if there is a setuptools version
installed system-wide, it may be picked up, but may not necessarily be
the same version as Buildroot setuptools, potentially causing
problems.

This commit makes the necessary change to the python-package
infrastructure to fix this behavior, by identifying the following
cases:

 - When a host Python package says <pkg>_NEEDS_HOST_PYTHON = python3,
   then we know it wants setuptools installed for host-python3, so we
   use host-python3-setuptools.

 - When a host Python package says <pkg>_NEEDS_HOST_PYTHON = python2,
   then we known it wants setuptools installed for host-python, so we
   use host-python-setuptools.

 - When BR2_PACKAGE_PYTHON3=y, and we have a target package, or a host
   package with no NEEDS_HOST_PYTHON option, then we want setuptools
   installed for host-python3, so we use host-python3-setuptools.

 - When BR2_PACKAGE_PYTHON=y or no target interpreter is enabled at
   all, and we have a target package, or a host package with no
   NEEDS_HOST_PYTHON option, then we want setuptools for host-python,
   so we use host-python-setuptools.

To make this happen, we use host-python3-setuptools introduced in a
previous commit, but we also change host-python-setuptools to force
its installation for host-python. The latter is needed if you build
with BR2_PACKAGE_PYTHON3=y but want to install a Python-based package
that has NEEDS_HOST_PYTHON=python2.

There is one single package that needs be adjusted following this:
lirc-tools, because it is not using the python-package
infrastructure. It directly depends on host-python-setuptools, which
no longer works because host-python-setuptools now only installs for
Python 2.x, while lirc-tools Python binding only supports Python
3.x. Switching to host-python3-setuptools solves this problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: Asaf Kahlon <asafka7@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2019-01-01 11:16:10 +01:00
..
2018-12-31 13:31:50 +01:00
2018-11-23 21:47:50 +01:00
2018-10-26 11:59:46 +02:00
2018-12-13 21:19:33 +01:00
2018-12-03 23:08:20 +01:00
2018-11-29 22:39:00 +01:00
2018-12-02 08:16:10 +01:00
2018-11-02 22:41:03 +01:00
2018-10-26 10:34:04 +02:00
2018-11-17 21:58:50 +01:00
2018-11-17 22:04:04 +01:00
2018-12-14 21:52:53 +01:00
2018-11-12 23:00:00 +01:00
2018-11-25 09:32:06 +01:00
2018-11-18 19:02:05 +01:00
2018-11-29 17:18:31 +01:00
2018-11-29 21:35:38 +01:00
2018-11-21 20:56:42 +01:00
2018-12-26 21:34:10 +01:00
2018-10-26 21:16:56 +02:00
2018-12-02 08:16:10 +01:00
2018-11-01 13:56:44 +01:00
2018-10-27 22:59:15 +02:00
2018-11-18 08:35:29 +01:00
2018-10-21 19:11:20 +02:00
2018-11-24 15:14:53 +01:00
2018-11-12 23:00:29 +01:00
2018-12-14 21:53:00 +01:00
2018-12-14 21:28:48 +01:00
2018-10-28 08:14:28 +01:00
2018-11-20 23:12:48 +01:00
2018-12-31 14:14:22 +01:00
2018-10-26 21:14:34 +02:00
2018-11-09 22:16:09 +01:00
2018-11-09 21:58:46 +01:00
2018-12-02 08:16:10 +01:00
2018-12-21 22:52:06 +01:00
2018-10-28 17:36:17 +01:00
2018-12-09 00:15:32 +01:00
2018-12-02 08:16:10 +01:00
2018-12-08 23:38:33 +01:00
2018-12-02 08:16:10 +01:00
2018-11-01 13:53:49 +01:00
2018-11-17 12:58:58 +01:00
2018-11-16 22:30:07 +01:00
2018-11-19 22:08:14 +01:00
2018-12-13 21:48:21 +01:00
2018-10-31 18:08:16 +01:00
2018-12-27 16:38:41 +01:00
2018-12-09 17:38:50 +01:00
2018-12-28 11:52:58 +01:00
2018-11-21 20:55:34 +01:00
2018-11-09 22:27:51 +01:00
2018-12-09 17:38:50 +01:00
2018-12-02 08:16:10 +01:00
2018-11-24 11:21:39 +01:00
2018-11-11 21:25:13 +01:00
2018-11-13 21:59:04 +01:00
2018-12-13 22:20:00 +01:00
2018-11-05 23:18:28 +01:00
2018-11-01 14:51:30 +01:00
2018-12-03 13:30:29 +01:00
2018-12-28 14:04:00 +01:00
2018-12-16 16:39:59 +01:00
2018-11-28 00:08:20 +01:00
2018-11-01 14:23:29 +01:00
2018-11-13 10:34:09 +01:00
2018-11-01 11:57:11 +01:00
2018-10-23 16:35:32 +02:00
2018-11-01 11:42:51 +01:00
2018-10-30 21:09:57 +01:00
2018-11-08 21:00:49 +01:00
2018-12-02 08:16:10 +01:00
2018-10-24 01:20:43 +02:00
2018-12-10 22:14:05 +01:00
2018-10-30 21:05:19 +01:00
2018-11-18 18:54:54 +01:00
2018-12-27 16:35:55 +01:00
2018-12-02 08:16:10 +01:00
2018-10-30 21:00:35 +01:00
2018-12-10 22:15:51 +01:00
2018-12-10 22:17:20 +01:00
2018-12-27 16:35:53 +01:00
2018-11-04 22:35:51 +01:00
2018-11-11 21:22:02 +01:00
2018-11-28 21:55:13 +01:00
2018-11-19 22:18:59 +01:00
2018-12-08 23:00:33 +01:00
2018-11-18 19:52:56 +01:00
2018-12-31 14:14:22 +01:00
2018-12-02 08:16:10 +01:00