With a new DISTRO_FEATURE ("python_freethreading"), set PYTHON_ABI.

Added a new variable called PYTHON_MAINVERSION which is a
combination of PYTHON_BASEVERSION and PYTHON_ABI.

Set PYTHON_DIR so it also contains the ABI. Python build helper
classes use this variable, so it's important to set it correctly.

Support different settings for target and native.

Signed-off-by: Zoltán Böszörményi <[email protected]>
---
 meta/classes-recipe/python3-dir.bbclass | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes-recipe/python3-dir.bbclass 
b/meta/classes-recipe/python3-dir.bbclass
index 3eb0dea9b2..2b81b776cb 100644
--- a/meta/classes-recipe/python3-dir.bbclass
+++ b/meta/classes-recipe/python3-dir.bbclass
@@ -5,7 +5,12 @@
 #
 
 PYTHON_BASEVERSION = "3.14"
-PYTHON_ABI = ""
-PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+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"
+PYTHON_SITEPACKAGES_DIR_NATIVE = "${libdir}/${PYTHON_DIR_NATIVE}/site-packages"
-- 
2.53.0

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

Reply via email to