Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] python-sip: fix compile error
@ 2023-12-12 16:01 Ralf Dragon
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ralf Dragon @ 2023-12-12 16:01 UTC (permalink / raw)
  To: buildroot; +Cc: Ralf Dragon, gwenhael.goavec-merou, yann.morin.1998, asafka7

Without the patch, python-sip fails to compile with:

siplib.c: In function ‘sip_api_get_frame’:
siplib.c:13750:22: error: invalid use of undefined type ‘struct _frame’
13750 |         frame = frame->f_back;

This likely fixes bug 15201 [1].



[1] https://bugs.buildroot.org/show_bug.cgi?id=15201


Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
---
Backport to: 2023.02.x

 package/python-sip/0002-fixframe.patch | 55 ++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 package/python-sip/0002-fixframe.patch

diff --git a/package/python-sip/0002-fixframe.patch b/package/python-sip/0002-fixframe.patch
new file mode 100644
index 0000000000..befe76fc73
--- /dev/null
+++ b/package/python-sip/0002-fixframe.patch
@@ -0,0 +1,55 @@
+siplib: fix build with python >= 3.11
+
+With python 3.11, the PyFrameObject structure members have been
+removed from the public C API:
+
+https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-c-api-porting
+https://docs.python.org/3.11/whatsnew/3.11.html#pyframeobject-3-11-hiding
+
+This patch migrates to the opaque PyFrameObject.
+
+Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
+Upstream: N/A as SIP v4 is no longer supported. 4.19.25 is the last release.
+
+--- host-python-sip-4.19.25.orig/siplib/sip.h
++++ host-python-sip-4.19.25/siplib/sip.h
+@@ -1799,7 +1799,7 @@
+     int (*api_get_time)(PyObject *, sipTimeDef *);
+     PyObject *(*api_from_time)(const sipTimeDef *);
+     int (*api_is_user_type)(const sipWrapperType *);
+-    struct _frame *(*api_get_frame)(int);
++    PyFrameObject *(*api_get_frame)(int);
+     int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
+     PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
+     void (*api_unicode_write)(int, void *, int, unsigned);
+
+
+--- host-python-sip-4.19.25.orig/siplib/siplib.c
++++ host-python-sip-4.19.25/siplib/siplib.c
+@@ -448,7 +448,7 @@
+ static int sip_api_get_time(PyObject *obj, sipTimeDef *time);
+ static PyObject *sip_api_from_time(const sipTimeDef *time);
+ static int sip_api_is_user_type(const sipWrapperType *wt);
+-static struct _frame *sip_api_get_frame(int);
++static PyFrameObject *sip_api_get_frame(int);
+ static int sip_api_check_plugin_for_type(const sipTypeDef *td,
+         const char *name);
+ static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar,
+@@ -13741,13 +13741,13 @@
+ /*
+  * Return a frame from the execution stack.
+  */
+-static struct _frame *sip_api_get_frame(int depth)
++static PyFrameObject *sip_api_get_frame(int depth)
+ {
+-    struct _frame *frame = PyEval_GetFrame();
++    PyFrameObject *frame = PyEval_GetFrame();
+ 
+     while (frame != NULL && depth > 0)
+     {
+-        frame = frame->f_back;
++        frame = PyFrame_GetBack(frame);
+         --depth;
+     }
+ 
+
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-10 13:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
2023-12-17 22:07   ` Thomas Petazzoni via buildroot
2023-12-18 18:22     ` Ralf Dragon
2023-12-18 19:51       ` Thomas Petazzoni via buildroot
     [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
2023-12-19 19:36           ` Ralf Dragon
2024-01-02 21:48           ` Ralf Dragon
2023-12-18 18:58     ` Ralf Dragon
2024-01-10 19:21     ` Julien Olivain
2024-01-10 19:58       ` Thomas Petazzoni via buildroot
2024-03-10 13:25   ` Julien Olivain
2023-12-17 22:03 ` [Buildroot] [PATCH 1/2] python-sip: fix compile error Thomas Petazzoni via buildroot
2024-01-05 12:41 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox