commit: d665eb96ae193c1683b196461a39bdb8ae4039da Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Wed Apr 19 11:30:35 2023 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat Apr 22 06:17:04 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d665eb96
distutils-r1.eclass: Detect missing DISTUTILS_EXT Detect when Python packages install extensions and warn about missing DISTUTILS_EXT appropriately. Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/30650 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> eclass/distutils-r1.eclass | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 28a1f449e217..cef9d71e5593 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -2069,6 +2069,16 @@ _distutils-r1_post_python_install() { eerror "https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages" die "Failing install because of stray top-level files in site-packages" fi + + if [[ ! ${DISTUTILS_EXT} && ! ${_DISTUTILS_EXT_WARNED} ]]; then + if [[ $(find "${sitedir}" -name "*$(get_modname)" | head -n 1) ]] + then + eqawarn "Python extension modules (*$(get_modname)) found installed. Please set:" + eqawarn " DISTUTILS_EXT=1" + eqawarn "in the ebuild." + _DISTUTILS_EXT_WARNED=1 + fi + fi fi }
