python-r1.eclass: Support python_check_deps() in python_setup
authorMichał Górny <mgorny@gentoo.org>
Fri, 19 May 2017 18:17:57 +0000 (20:17 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 29 May 2017 21:53:46 +0000 (23:53 +0200)
commit49c5d62485286040dd227d7f63200284da01a3af
treeb63391f8113b85b5cce4e7728d4bc8d90afbd8ff
parent4722066cb86aa5854d9e9f40544556d742d09c8b
python-r1.eclass: Support python_check_deps() in python_setup

Provide an alternate mode for python_setup() that behaves similarly to
python-any-r1 eclass. If python_check_deps() function is declared
by the ebuild, the python_setup logic switches to accepting any
implementation that is in PYTHON_COMPAT, installed and satisfies
python_check_deps() independently of USE flags.

This new logic makes it possible to replace some of the existing
REQUIRED_USE constraints for build-time dependencies with more friendly
any-of dependencies. For example, if a package supports both Python 2 &
Python 3 but has a purely Python 2 build-time dependency (e.g. for
building documentation) we had to force Python 2 being enabled via
REQUIRED_USE. Using python_check_deps() with appropriate any-of
dependency, we can use Python 2 for this task without actually forcing
the user to change USE flags or install the package for Python 2.
eclass/python-r1.eclass