From b9eccdca7c701717cf7a128c02307a75adc5de66 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Thu, 10 Nov 2022 14:25:12 -0500 Subject: [PATCH] boost: add patch to support Python 3.11. --- .../boost/patches/Py_TPFLAGS_HAVE_GC.patch | 37 +++++++++++++++++++ srcpkgs/boost/template | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/boost/patches/Py_TPFLAGS_HAVE_GC.patch diff --git a/srcpkgs/boost/patches/Py_TPFLAGS_HAVE_GC.patch b/srcpkgs/boost/patches/Py_TPFLAGS_HAVE_GC.patch new file mode 100644 index 00000000000..37cff5ec6fe --- /dev/null +++ b/srcpkgs/boost/patches/Py_TPFLAGS_HAVE_GC.patch @@ -0,0 +1,37 @@ +From ae5da2a7e8f1111757d8a474095486a5b22aa12d Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Mon, 25 Apr 2022 10:51:46 +0200 +Subject: [PATCH] Fix enum_type_object type on Python 3.11 + +The enum_type_object type inherits from PyLong_Type which is not tracked +by the GC. Instances doesn't have to be tracked by the GC: remove the +Py_TPFLAGS_HAVE_GC flag. + +The Python C API documentation says: + + "To create a container type, the tp_flags field of the type object + must include the Py_TPFLAGS_HAVE_GC and provide an implementation of + the tp_traverse handler." + +https://docs.python.org/dev/c-api/gcsupport.html + +The new exception was introduced in Python 3.11 by: +https://github.com/python/cpython/issues/88429 + +Upstream: https://github.com/boostorg/python/pull/385 +--- + libs/python/src/object/enum.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/object/enum.cpp b/src/object/enum.cpp +index 293e705899..5753b32e07 100644 +--- a/libs/python/src/object/enum.cpp ++++ b/libs/python/src/object/enum.cpp +@@ -113,7 +113,6 @@ static PyTypeObject enum_type_object = { + #if PY_VERSION_HEX < 0x03000000 + | Py_TPFLAGS_CHECKTYPES + #endif +- | Py_TPFLAGS_HAVE_GC + | Py_TPFLAGS_BASETYPE, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ diff --git a/srcpkgs/boost/template b/srcpkgs/boost/template index a3da2dc4ca2..fb01417cea1 100644 --- a/srcpkgs/boost/template +++ b/srcpkgs/boost/template @@ -1,7 +1,7 @@ # Template file for 'boost' pkgname=boost version=1.80.0 -revision=5 +revision=6 hostmakedepends="which bzip2-devel icu-devel python3-devel pkg-config" makedepends="zlib-devel bzip2-devel icu-devel python3-devel liblzma-devel libzstd-devel"