commit:     734538c21f9703bca82c85907d44609160764613
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 14 18:36:39 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 14 19:10:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=734538c2

dev-lang/python: Support building without GIL

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/python/metadata.xml                  | 4 ++++
 dev-lang/python/python-3.13.0_beta1_p1.ebuild | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml
index 22ce986e0676..97c6bd965b9f 100644
--- a/dev-lang/python/metadata.xml
+++ b/dev-lang/python/metadata.xml
@@ -14,6 +14,10 @@
                        to bootstrap pip and setuptools (if disabled, it will
                        be only possible to use venv `--without-pip`)
                </flag>
+               <flag name="gil">
+                       Build with Global Interpreter Lock.  Disable to use
+                       the experimental freethreading mode.
+               </flag>
                <flag name="jit">
                        Enable experimental Just-In-Time compilation support.
                </flag>

diff --git a/dev-lang/python/python-3.13.0_beta1_p1.ebuild 
b/dev-lang/python/python-3.13.0_beta1_p1.ebuild
index 173b5bd44506..7226cd952199 100644
--- a/dev-lang/python/python-3.13.0_beta1_p1.ebuild
+++ b/dev-lang/python/python-3.13.0_beta1_p1.ebuild
@@ -33,7 +33,7 @@ LICENSE="PSF-2"
 SLOT="${PYVER}"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
 IUSE="
-       bluetooth build debug +ensurepip examples gdbm jit libedit
+       bluetooth build debug +ensurepip examples gdbm +gil jit libedit
        +ncurses pgo +readline +sqlite +ssl test tk valgrind
 "
 REQUIRED_USE="jit? ( ${LLVM_REQUIRED_USE} )"
@@ -300,6 +300,7 @@ src_configure() {
                --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip
 
                $(use_with debug assertions)
+               $(use_enable gil)
                $(use_enable jit experimental-jit)
                $(use_enable pgo optimizations)
                $(use_with readline readline "$(usex libedit editline 
readline)")

Reply via email to