summaryrefslogtreecommitdiff
path: root/dev-python/pybind11
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pybind11')
-rw-r--r--dev-python/pybind11/Manifest3
-rw-r--r--dev-python/pybind11/files/pybind11-2.13.6-pypy311.patch31
-rw-r--r--dev-python/pybind11/pybind11-2.13.6.ebuild12
3 files changed, 43 insertions, 3 deletions
diff --git a/dev-python/pybind11/Manifest b/dev-python/pybind11/Manifest
index 1c96dfaf972e..00349bb73a4b 100644
--- a/dev-python/pybind11/Manifest
+++ b/dev-python/pybind11/Manifest
@@ -1,3 +1,4 @@
+AUX pybind11-2.13.6-pypy311.patch 1511 BLAKE2B 5a507b63278b0b2f7574e15634c683b4dac178fdadd9366530fce07981cdfa9bfd7881c84d0d57a8ba358498a28ca7986742b4d0f7bc333f39c09162b627fef3 SHA512 bdd23fe427f1983e7ac03f848480c95ff1cec2eb7537569a45ac623e9499a2b6c0fbde47626754d878aabdfe3ce2a8302e99c0571148fed6fbf80664957c9581
DIST pybind11-2.13.6.gh.tar.gz 800804 BLAKE2B 1f2efa05727ebbcd8e439b83bacfebb21d26a6f8f719e0a627633abdcae59837936e37e6441196e097e0075c9f922048d4e88146bb627d97ada28c48165bddb7 SHA512 497c25b33b09a9c42f67131ab82e35d689e8ce089dd7639be997305ff9a6d502447b79c824508c455d559e61f0186335b54dd2771d903a7c1621833930622d1a
-EBUILD pybind11-2.13.6.ebuild 1537 BLAKE2B 6cb5838cc0cc1de7f9f3af2dd3c9fa986cbc80d478c0b1c20a0cdb55ffa2a989d36660ea38706bb2f9e506f6cb2f671555632dac3bb0409d41bbe25489a707ac SHA512 117e8abb518d5b4df0685ad98222cb2df6dd180ce28a9ef2526303f1d43cf0971fa9b58213537b6fba2f092739fc76c5124e976c4378640141fb00f44591da9e
+EBUILD pybind11-2.13.6.ebuild 1713 BLAKE2B 37cb27bee59af96635b297954b49d6d49b72cc78fdbe156ed22baf09b1fdcda9bd41793fc20eebee7073331239fbfcc4f969bab3ba5cdaed5b7b398872897151 SHA512 6c4f76ed5b4604b03881132085011259197da9b9a6ae893d33b8ddab1c02d43969242536dee77ed138e956adeaba2e171bc75533acb7354ace3e859deea30aac
MISC metadata.xml 475 BLAKE2B faf317a1197850acb0d16546a303bd50ee1bfe6fc3aaf592e6c147c6612fd20b809f1c911d79ca9a356cfa0c4166d2b155fcbd593f8b55e0d7dd75ff6444073b SHA512 5779adcc9f25c15fd999aa6c91d3144fc14535270e57925bfb8ac67f45448c144a142af2ea9a321ec6ffbf568713f663cef85a0be3d4a056e58b1782a5fc9a41
diff --git a/dev-python/pybind11/files/pybind11-2.13.6-pypy311.patch b/dev-python/pybind11/files/pybind11-2.13.6-pypy311.patch
new file mode 100644
index 000000000000..debc7b7c55e2
--- /dev/null
+++ b/dev-python/pybind11/files/pybind11-2.13.6-pypy311.patch
@@ -0,0 +1,31 @@
+diff --git a/include/pybind11/attr.h b/include/pybind11/attr.h
+index 1044db94..89d418cc 100644
+--- a/include/pybind11/attr.h
++++ b/include/pybind11/attr.h
+@@ -351,7 +351,8 @@ struct type_record {
+
+ bases.append((PyObject *) base_info->type);
+
+-#if PY_VERSION_HEX < 0x030B0000
++// Keep in sync with enable_dynamic_attributes() in detail/class.h
++#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION)
+ dynamic_attr |= base_info->type->tp_dictoffset != 0;
+ #else
+ dynamic_attr |= (base_info->type->tp_flags & Py_TPFLAGS_MANAGED_DICT) != 0;
+diff --git a/include/pybind11/detail/class.h b/include/pybind11/detail/class.h
+index b990507d..e97d48b2 100644
+--- a/include/pybind11/detail/class.h
++++ b/include/pybind11/detail/class.h
+@@ -560,9 +560,9 @@ extern "C" inline int pybind11_clear(PyObject *self) {
+ inline void enable_dynamic_attributes(PyHeapTypeObject *heap_type) {
+ auto *type = &heap_type->ht_type;
+ type->tp_flags |= Py_TPFLAGS_HAVE_GC;
+-#if PY_VERSION_HEX < 0x030B0000
+- type->tp_dictoffset = type->tp_basicsize; // place dict at the end
+- type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
++#if PY_VERSION_HEX < 0x030B0000 || defined(PYPY_VERSION) // For PyPy see PR #5508
++ type->tp_dictoffset = type->tp_basicsize; // place dict at the end
++ type->tp_basicsize += (ssize_t) sizeof(PyObject *); // and allocate enough space for it
+ #else
+ type->tp_flags |= Py_TPFLAGS_MANAGED_DICT;
+ #endif
diff --git a/dev-python/pybind11/pybind11-2.13.6.ebuild b/dev-python/pybind11/pybind11-2.13.6.ebuild
index 7f5daedfa762..dea8590f1058 100644
--- a/dev-python/pybind11/pybind11-2.13.6.ebuild
+++ b/dev-python/pybind11/pybind11-2.13.6.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..13} pypy3 )
+PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 )
inherit cmake distutils-r1
@@ -39,7 +39,15 @@ EPYTEST_XDIST=1
distutils_enable_tests pytest
python_prepare_all() {
+ local PATCHES=(
+ # https://github.com/pybind/pybind11/pull/5508
+ # https://github.com/pybind/pybind11/pull/5537
+ "${FILESDIR}/${P}-pypy311.patch"
+ )
+
cmake_src_prepare
+
+ PATCHES=()
distutils-r1_python_prepare_all
}