sharlatan pushed a commit to branch master
in repository guix.

commit 03c4dc54a72f787da597972b43ff6ae9309ebad8
Author: Nicolas Graves <[email protected]>
AuthorDate: Tue Apr 22 14:04:03 2025 +0200

    gnu: python-zeroc-ice-3.6: Fix build with [email protected].
    
    * gnu/packages/python-xyz.scm (python-zeroc-ice-3.6)
      [source]: Add patch.
    * gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch:
      Add patch.
    
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 ...ython-zeroc-ice-3.6.5-python-3.11-support.patch | 33 ++++++++++++++++++++++
 gnu/packages/python-xyz.scm                        |  5 +++-
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git 
a/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch 
b/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch
new file mode 100644
index 0000000000..17cae7297c
--- /dev/null
+++ b/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch
@@ -0,0 +1,33 @@
+Only in zeroc-ice-3.6.5: setup.py.orig
+diff --color -ur zeroc-ice-3.6.5.orig/src/Slice.cpp 
zeroc-ice-3.6.5/src/Slice.cpp
+--- zeroc-ice-3.6.5.orig/src/Slice.cpp 2019-07-31 21:49:38.000000000 +0200
++++ zeroc-ice-3.6.5/src/Slice.cpp      2023-10-12 10:52:07.029069937 +0200
+@@ -17,12 +17,6 @@
+ #include <Slice/Util.h>
+ #include <IceUtil/Options.h>
+ 
+-//
+-// Python headers needed for PyEval_EvalCode.
+-//
+-#include <compile.h>
+-#include <eval.h>
+-
+ using namespace std;
+ using namespace IcePy;
+ using namespace Slice;
+diff --color -ur zeroc-ice-3.6.5.orig/src/Util.cpp zeroc-ice-3.6.5/src/Util.cpp
+--- zeroc-ice-3.6.5.orig/src/Util.cpp  2019-07-31 21:49:38.000000000 +0200
++++ zeroc-ice-3.6.5/src/Util.cpp       2023-10-12 10:49:15.033366926 +0200
+@@ -214,7 +214,12 @@
+     //
+     // Get name of current function.
+     //
++    // Use PyEval_GetFrame with Pyhthon >= 3.11
++#if PY_VERSION_HEX >= 0x030B0000
++    PyFrameObject *f = PyEval_GetFrame();
++#else
+     PyFrameObject *f = PyThreadState_GET()->frame;
++#endif
+     PyObjectHandle code = 
PyObject_GetAttrString(reinterpret_cast<PyObject*>(f), STRCAST("f_code"));
+     assert(code.get());
+     PyObjectHandle func = PyObject_GetAttrString(code.get(), 
STRCAST("co_name"));
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ce0ae46ddc..e2f025c13b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -40606,7 +40606,10 @@ write text fast, and for various text generation, 
statistics, and modeling tasks
               (uri (pypi-uri "zeroc-ice" version))
               (sha256
                (base32
-                "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
+                "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))
+              (patches
+               (search-patches
+                "python-zeroc-ice-3.6.5-python-3.11-support.patch"))))))
 
 (define-public python-whenever
   (package

Reply via email to