commit:     ea02deeec1ffec0e391c400cf458939ebdf41d9c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 12 23:45:35 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 13 00:08:32 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea02deee

dev-lang/micropython: respect python-any-r1 more

The Makefiles call $(PYTHON) in places which defaults to 'python3' and
tests have their own variable.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/micropython/micropython-1.25.0.ebuild | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/dev-lang/micropython/micropython-1.25.0.ebuild 
b/dev-lang/micropython/micropython-1.25.0.ebuild
index 2632c621e07e..c6f41ebfd277 100644
--- a/dev-lang/micropython/micropython-1.25.0.ebuild
+++ b/dev-lang/micropython/micropython-1.25.0.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{9..13} )
+PYTHON_COMPAT=( python3_{11..13} )
 
 inherit toolchain-funcs python-any-r1
 
@@ -17,10 +17,10 @@ KEYWORDS="~amd64 ~arm64 ~x86"
 IUSE="test"
 RESTRICT="!test? ( test )"
 
-DEPEND="
-       dev-libs/libffi:=
-       virtual/pkgconfig
+DEPEND="dev-libs/libffi:="
+BDEPEND="
        ${PYTHON_DEPS}
+       virtual/pkgconfig
 "
 
 src_prepare() {
@@ -50,7 +50,7 @@ src_compile() {
        einfo ""
        einfo "Building the mpy-crosscompiler."
        einfo ""
-       emake V=1 -C mpy-cross CC="$(tc-getCC)"
+       emake V=1 -C mpy-cross PYTHON="${EPYTHON}" CC="$(tc-getCC)"
 
        # Finally, build the unix port.
        einfo ""
@@ -58,15 +58,23 @@ src_compile() {
        einfo ""
        # Empty `STRIP=` leaves symbols + debug info intact. Let portage handle 
it.
        # 
https://github.com/micropython/micropython/tree/master/ports/unix/README.md
-       emake V=1 -C ports/unix CC="$(tc-getCC)" STRIP=
+       emake V=1 -C ports/unix PYTHON="${EPYTHON}" CC="$(tc-getCC)" STRIP=
 }
 
 src_test() {
-       emake V=1 -C ports/unix CC="$(tc-getCC)" test
+       emake V=1 -C ports/unix \
+               PYTHON="${EPYTHON}" \
+               MICROPY_CPYTHON3="${EPYTHON}" \
+               CC="$(tc-getCC)" \
+               test
 }
 
 src_install() {
-       emake V=1 -C ports/unix CC="$(tc-getCC)" DESTDIR="${D}" install
+       emake V=1 -C ports/unix \
+               PYTHON="${EPYTHON}" \
+               CC="$(tc-getCC)" \
+               DESTDIR="${D}" \
+               install
 
        # remove .git files
        find tools -type f -name '.git*' -delete || die

Reply via email to