* Re: [PR PATCH] [Updated] root: add upstream patch to fix pyroot for python 3.11
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40402@inbox.vuxu.org>
2022-11-09 8:42 ` root: add upstream patch to fix pyroot for python 3.11 classabbyamp
@ 2022-11-09 18:09 ` BenJarg
2022-11-09 18:11 ` BenJarg
2022-11-10 7:44 ` [PR PATCH] [Merged]: " classabbyamp
3 siblings, 0 replies; 4+ messages in thread
From: BenJarg @ 2022-11-09 18:09 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
There is an updated pull request by BenJarg against master on the void-packages repository
https://github.com/BenJarg/void-packages root-python3.11-fix
https://github.com/void-linux/void-packages/pull/40402
root: add upstream patch to fix pyroot for python 3.11
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
Added patch taken from upstream to fix a breaking issue in pyroot from python 3.11. See root-project/root#11457
A patch file from https://github.com/void-linux/void-packages/pull/40402.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-root-python3.11-fix-40402.patch --]
[-- Type: text/x-diff, Size: 5663 bytes --]
From 4f4feefc0fac943133e7a50afc9403acd4b90c24 Mon Sep 17 00:00:00 2001
From: Ben Jargowsky <benjar63@gmail.com>
Date: Tue, 8 Nov 2022 17:15:03 -0800
Subject: [PATCH] root: add upstream patch to fix pyroot for python 3.11
---
srcpkgs/root/patches/python3.11_2.patch | 81 +++++++++++++++++++++++++
srcpkgs/root/template | 2 +-
2 files changed, 82 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/root/patches/python3.11_2.patch
diff --git a/srcpkgs/root/patches/python3.11_2.patch b/srcpkgs/root/patches/python3.11_2.patch
new file mode 100644
index 000000000000..feecf3a53c07
--- /dev/null
+++ b/srcpkgs/root/patches/python3.11_2.patch
@@ -0,0 +1,81 @@
+Patch is from: https://github.com/root-project/root/pull/11457
+
+diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx
+index 73fb8099b5..f2eea396af 100644
+--- a/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx
++++ b/bindings/pyroot/cppyy/CPyCppyy/src/CPPInstance.cxx
+@@ -764,7 +764,6 @@ PyTypeObject CPPInstance_Type = {
+ 0, // tp_as_buffer
+ Py_TPFLAGS_DEFAULT |
+ Py_TPFLAGS_BASETYPE |
+- Py_TPFLAGS_HAVE_GC |
+ Py_TPFLAGS_CHECKTYPES, // tp_flags
+ (char*)"cppyy object proxy (internal)", // tp_doc
+ 0, // tp_traverse
+diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
+index 97ce06daa7..ed41b1637c 100644
+--- a/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
++++ b/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
+@@ -78,8 +78,7 @@ PyTypeObject TypedefPointerToClass_Type = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ (ternaryfunc)tpc_call, // tp_call
+ 0, 0, 0, 0,
+- Py_TPFLAGS_DEFAULT |
+- Py_TPFLAGS_HAVE_GC, // tp_flags
++ Py_TPFLAGS_DEFAULT, // tp_flags
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ #if PY_VERSION_HEX >= 0x02030000
+ , 0 // tp_del
+diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
+index f9e92f9c8c..510d65f88a 100644
+--- a/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
++++ b/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
+@@ -45,7 +45,7 @@ struct InitCPyCppyy_NoneType_t {
+ ((PyVarObject&)CPyCppyy_NoneType).ob_size = 0;
+
+ CPyCppyy_NoneType.tp_name = const_cast<char*>("CPyCppyy_NoneType");
+- CPyCppyy_NoneType.tp_flags = Py_TPFLAGS_HAVE_RICHCOMPARE | Py_TPFLAGS_HAVE_GC;
++ CPyCppyy_NoneType.tp_flags = Py_TPFLAGS_HAVE_RICHCOMPARE;
+
+ CPyCppyy_NoneType.tp_traverse = (traverseproc)0;
+ CPyCppyy_NoneType.tp_clear = (inquiry)0;
+@@ -135,6 +135,7 @@ bool CPyCppyy::MemoryRegulator::RecursiveRemove(
+ CPyCppyy_NoneType.tp_traverse = Py_TYPE(pyobj)->tp_traverse;
+ CPyCppyy_NoneType.tp_clear = Py_TYPE(pyobj)->tp_clear;
+ CPyCppyy_NoneType.tp_free = Py_TYPE(pyobj)->tp_free;
++ CPyCppyy_NoneType.tp_flags = Py_TYPE(pyobj)->tp_flags;
+ } else if (CPyCppyy_NoneType.tp_traverse != Py_TYPE(pyobj)->tp_traverse) {
+ // TODO: SystemError?
+ std::cerr << "in CPyCppyy::MemoryRegulater, unexpected object of type: "
+diff --git a/bindings/pyroot/cppyy/patches/gc_flags.patch b/bindings/pyroot/cppyy/patches/gc_flags.patch
+new file mode 100644
+index 0000000000..68f0718629
+--- /dev/null
++++ b/bindings/pyroot/cppyy/patches/gc_flags.patch
+@@ -0,0 +1,26 @@
++diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
++index 97ce06daa7..ed41b1637c 100644
++--- a/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
+++++ b/bindings/pyroot/cppyy/CPyCppyy/src/CustomPyTypes.cxx
++@@ -78,8 +78,7 @@ PyTypeObject TypedefPointerToClass_Type = {
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ (ternaryfunc)tpc_call, // tp_call
++ 0, 0, 0, 0,
++- Py_TPFLAGS_DEFAULT |
++- Py_TPFLAGS_HAVE_GC, // tp_flags
+++ Py_TPFLAGS_DEFAULT, // tp_flags
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
++ #if PY_VERSION_HEX >= 0x02030000
++ , 0 // tp_del
++diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
++index f9e92f9c8c..510d65f88a 100644
++--- a/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
+++++ b/bindings/pyroot/cppyy/CPyCppyy/src/MemoryRegulator.cxx
++@@ -135,6 +135,7 @@ bool CPyCppyy::MemoryRegulator::RecursiveRemove(
++ CPyCppyy_NoneType.tp_traverse = Py_TYPE(pyobj)->tp_traverse;
++ CPyCppyy_NoneType.tp_clear = Py_TYPE(pyobj)->tp_clear;
++ CPyCppyy_NoneType.tp_free = Py_TYPE(pyobj)->tp_free;
+++ CPyCppyy_NoneType.tp_flags = Py_TYPE(pyobj)->tp_flags;
++ } else if (CPyCppyy_NoneType.tp_traverse != Py_TYPE(pyobj)->tp_traverse) {
++ // TODO: SystemError?
++ std::cerr << "in CPyCppyy::MemoryRegulater, unexpected object of type: "
diff --git a/srcpkgs/root/template b/srcpkgs/root/template
index 713df0d2cd01..a8e9644ad5c3 100644
--- a/srcpkgs/root/template
+++ b/srcpkgs/root/template
@@ -1,7 +1,7 @@
# Template file for 'root'
pkgname=root
version=6.26.06
-revision=1
+revision=2
# Only i686 and x86_64 seem to be officially supported
archs="i686* x86_64*"
build_style=cmake
^ permalink raw reply [flat|nested] 4+ messages in thread