diff options
Diffstat (limited to 'dev-python/pycairo/files/pycairo-1.25.0-init.patch')
-rw-r--r-- | dev-python/pycairo/files/pycairo-1.25.0-init.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dev-python/pycairo/files/pycairo-1.25.0-init.patch b/dev-python/pycairo/files/pycairo-1.25.0-init.patch new file mode 100644 index 000000000000..cc670618a261 --- /dev/null +++ b/dev-python/pycairo/files/pycairo-1.25.0-init.patch @@ -0,0 +1,43 @@ +From 1ef1ea2f0ba3854309114a2395734c34a1e158d8 Mon Sep 17 00:00:00 2001 +From: Tycho Andersen <tycho@tycho.pizza> +Date: Mon, 16 Oct 2023 20:01:52 -0600 +Subject: [PATCH] module: reorder cairo script surface initialization + +PyType_Ready() expects subclasses to be initialized after base classes. +Since ScriptSurface inherits from Surface, Surface must be initialized +first. + +This causes a segfault in pypy3.10, and the fix was suggested here: + +https://foss.heptapod.net/pypy/pypy/-/issues/4017#note_332375 + +This fixes the seg fault for me. + +Signed-off-by: Tycho Andersen <tycho@tycho.pizza> +--- + cairo/cairomodule.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/cairo/cairomodule.c b/cairo/cairomodule.c +index 0026a0e..f27330f 100644 +--- a/cairo/cairomodule.c ++++ b/cairo/cairomodule.c +@@ -210,6 +210,9 @@ PYCAIRO_MODINIT_FUNC PyInit__cairo(void) + if (PyType_Ready(&PycairoTextExtents_Type) < 0) + return NULL; + ++ if (PyType_Ready(&PycairoSurface_Type) < 0) ++ return NULL; ++ + #ifdef CAIRO_HAS_SCRIPT_SURFACE + if (PyType_Ready(&PycairoScriptDevice_Type) < 0) + return NULL; +@@ -223,8 +226,6 @@ PYCAIRO_MODINIT_FUNC PyInit__cairo(void) + if (PyType_Ready(&PycairoScaledFont_Type) < 0) + return NULL; + +- if (PyType_Ready(&PycairoSurface_Type) < 0) +- return NULL; + #ifdef CAIRO_HAS_IMAGE_SURFACE + if (PyType_Ready(&PycairoImageSurface_Type) < 0) + return NULL; |