From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Support python3_13t (freethreading) target
Date: Wed, 9 Oct 2024 13:47:14 +0200 [thread overview]
Message-ID: <20241009115754.584070-8-mgorny@gentoo.org> (raw)
In-Reply-To: <20241009115754.584070-1-mgorny@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 10 +++++++---
eclass/tests/python-utils-r1.sh | 8 ++++----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 796be7ab456a..ffaa0708ed5b 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -41,6 +41,7 @@ inherit multiprocessing toolchain-funcs
_PYTHON_ALL_IMPLS=(
pypy3
python3_{10..13}
+ python3_13t
)
readonly _PYTHON_ALL_IMPLS
@@ -136,7 +137,7 @@ _python_set_impls() {
# please keep them in sync with _PYTHON_ALL_IMPLS
# and _PYTHON_HISTORICAL_IMPLS
case ${i} in
- pypy3|python3_9|python3_1[0-3])
+ pypy3|python3_9|python3_1[0-3]|python3_13t)
;;
jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-9])
obsolete+=( "${i}" )
@@ -232,7 +233,7 @@ _python_impl_matches() {
return 0
;;
3.8|3.9|3.1[1-3])
- [[ ${impl} == python${pattern/./_} ]] && return 0
+ [[ ${impl%t} == python${pattern/./_} ]] && return 0
;;
*)
# unify value style to allow lax matching
@@ -435,7 +436,7 @@ _python_export() {
or "")
EOF
)
- val=${PYTHON}${flags}-config
+ val=${PYTHON%t}${flags}-config
;;
*)
die "${impl}: obtaining ${var} not supported"
@@ -448,6 +449,9 @@ _python_export() {
PYTHON_PKG_DEP)
local d
case ${impl} in
+ python*t)
+ PYTHON_PKG_DEP="dev-lang/python-freethreading:${impl#python}"
+ ;;
python*)
PYTHON_PKG_DEP="dev-lang/python:${impl#python}"
;;
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 93cea324a3df..f0318305031e 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -64,7 +64,7 @@ tmpfile=$(mktemp)
inherit python-utils-r1
-for minor in {10..13}; do
+for minor in {10..13} 13t; do
ebegin "Testing python3.${minor}"
eindent
test_var EPYTHON "python3_${minor}" "python3.${minor}"
@@ -72,9 +72,9 @@ for minor in {10..13}; do
if [[ -x /usr/bin/python3.${minor} ]]; then
abiflags=$(/usr/bin/python3.${minor} -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS"))')
test_var PYTHON_SITEDIR "python3_${minor}" "/usr/lib*/python3.${minor}/site-packages"
- test_var PYTHON_INCLUDEDIR "python3_${minor}" "/usr/include/python3.${minor}${abiflags}"
- test_var PYTHON_LIBPATH "python3_${minor}" "/usr/lib*/libpython3.${minor}${abiflags}$(get_libname)"
- test_var PYTHON_CONFIG "python3_${minor}" "/usr/bin/python3.${minor}${abiflags}-config"
+ test_var PYTHON_INCLUDEDIR "python3_${minor}" "/usr/include/python3.${minor%t}${abiflags}"
+ test_var PYTHON_LIBPATH "python3_${minor}" "/usr/lib*/libpython3.${minor%t}${abiflags}$(get_libname)"
+ test_var PYTHON_CONFIG "python3_${minor}" "/usr/bin/python3.${minor%t}${abiflags}-config"
test_var PYTHON_CFLAGS "python3_${minor}" "*-I/usr/include/python3.${minor}*"
test_var PYTHON_LIBS "python3_${minor}" "*-lpython3.${minor}*"
fi
--
2.47.0
next prev parent reply other threads:[~2024-10-09 12:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 11:47 [gentoo-dev] [PATCH 0/9] Python 3.13 freethreading support Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 1/9] dev-lang/python: Remove old Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 2/9] dev-lang/python: Remove freethreading support Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 3/9] profiles: Copy dev-lang/python entries for python-freethreading Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 4/9] dev-lang/python-freethreading: New package, 3.13.0 Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 5/9] profiles: Add python3_13t (freethreading) target Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 6/9] install-qa-check.d: Support dev-lang/python-freethreading Michał Górny
2024-10-09 11:47 ` Michał Górny [this message]
2024-10-09 11:47 ` [gentoo-dev] [PATCH 8/9] app-portage/gpyutils: Add python3.13t Michał Górny
2024-10-09 11:47 ` [gentoo-dev] [PATCH 9/9] distutils-r1.eclass: Do not use stable ABI wheels in freethreading Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241009115754.584070-8-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox