From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E0FDB158046 for ; Wed, 9 Oct 2024 12:00:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85B3DE2A25; Wed, 9 Oct 2024 11:58:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3EB3EE2A22 for ; Wed, 9 Oct 2024 11:58:08 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 7/9] python-utils-r1.eclass: Support python3_13t (freethreading) target Date: Wed, 9 Oct 2024 13:47:14 +0200 Message-ID: <20241009115754.584070-8-mgorny@gentoo.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241009115754.584070-1-mgorny@gentoo.org> References: <20241009115754.584070-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: ab77943a-c2af-42b0-a133-db28a0b5cab4 X-Archives-Hash: c12f3cda82871c679ce1ce0d75dead1d Signed-off-by: Michał Górny --- 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