A new DISTRO_FEATURE[_NATIVE] = "python_freethreading" sets
PYTHON_ABI[_NATIVE]. This enables PACKAGECONFIG[freethreading] for
python3 and allows building Python modules.

Also added PYTHON_MAINVERSION_NATIVE and PYTHON_DIR_NATIVE in
an anticipation that they may be different.

Signed-off-by: Zoltán Böszörményi <[email protected]>
---
 meta/classes-recipe/python3-dir.bbclass        | 5 ++++-
 meta/recipes-devtools/python/python3_3.14.3.bb | 6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/python3-dir.bbclass 
b/meta/classes-recipe/python3-dir.bbclass
index f3ad0a2d91..748ef3ec6e 100644
--- a/meta/classes-recipe/python3-dir.bbclass
+++ b/meta/classes-recipe/python3-dir.bbclass
@@ -5,8 +5,11 @@
 #
 
 PYTHON_BASEVERSION = "3.14"
-PYTHON_ABI = ""
+PYTHON_ABI = "${@bb.utils.contains('DISTRO_FEATURES', 'python_freethreading', 
't', '', d)}"
+PYTHON_ABI_NATIVE = "${@bb.utils.contains('DISTRO_FEATURES_NATIVE', 
'python_freethreading', 't', '', d)}"
 PYTHON_MAINVERSION = "${PYTHON_BASEVERSION}${PYTHON_ABI}"
+PYTHON_MAINVERSION_NATIVE = "${PYTHON_BASEVERSION}${PYTHON_ABI_NATIVE}"
 PYTHON_DIR = "python${PYTHON_MAINVERSION}"
+PYTHON_DIR_NATIVE = "python${PYTHON_MAINVERSION_NATIVE}"
 PYTHON_PN = "python3"
 PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/meta/recipes-devtools/python/python3_3.14.3.bb 
b/meta/recipes-devtools/python/python3_3.14.3.bb
index 12d1223d4c..f62ed5f0e2 100644
--- a/meta/recipes-devtools/python/python3_3.14.3.bb
+++ b/meta/recipes-devtools/python/python3_3.14.3.bb
@@ -109,7 +109,11 @@ CACHED_CONFIGUREVARS:append:libc-musl = "\
 "
 
 # PGO currently causes builds to not be reproducible so disable by default, 
see YOCTO #13407
-PACKAGECONFIG ??= "editline gdbm ${@bb.utils.filter('DISTRO_FEATURES', 'lto', 
d)}"
+# For freethreading, see the comment below.
+PACKAGECONFIG ??= "editline gdbm \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'lto', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'python_freethreading', 
'freethreading', '', d)} \
+"
 
 # Some LLVM/CLANG subprojects (e.g. lldb) and many Python modules
 # do not build when free-threading is enabled. Also, the support
-- 
2.53.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#234019): 
https://lists.openembedded.org/g/openembedded-core/message/234019
Mute This Topic: https://lists.openembedded.org/mt/118519867/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to