Do not apply PATCHES and user patches (either via the EAPI 6 default or
pre-EAPI 5 code) when DISTUTILS_OPTIONAL is being used. In this case,
distutils functions are usually called conditionally, in a subdirectory,
while both PATCHES and user patches are usually intended to be applied
top-level.
There is no ebuild relying on distutils-r1_src_prepare applying patches
with DISTUTILS_OPTIONAL. In fact, there are ebuilds which work around
this behavior.
distutils-r1_python_prepare_all() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EAPI} != [45] ]]; then
- default
- else
- [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
- epatch_user
+ if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
+ if [[ ${EAPI} != [45] ]]; then
+ default
+ else
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+ epatch_user
+ fi
fi
# by default, use in-source build if python_prepare() is used