diff options
Diffstat (limited to 'dev-python/pycairo')
-rw-r--r-- | dev-python/pycairo/Manifest | 3 | ||||
-rw-r--r-- | dev-python/pycairo/files/pycairo-1.25.0-init.patch | 43 | ||||
-rw-r--r-- | dev-python/pycairo/pycairo-1.25.0.ebuild | 77 |
3 files changed, 123 insertions, 0 deletions
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest index 5e9a6567343a..98365edb9fb1 100644 --- a/dev-python/pycairo/Manifest +++ b/dev-python/pycairo/Manifest @@ -1,3 +1,6 @@ +AUX pycairo-1.25.0-init.patch 1409 BLAKE2B 3d72e812e8f5fd25afbf210520bb0f4eabe3bc10e7363336d5ac02fc06527ba42a507012d7e9f29bd1ba978d25bdd14ced6f9e45afd04b66618ef1026b826e49 SHA512 e6f9c25f1959e91016b629fe2cdd8f993165c95664652ba9716965a158a938d556a3f69c0e1c7ad129589bd0c1b9d45fc8a70398d6c474039766d9b2e95f6f48 DIST pycairo-1.24.0.tar.gz 344850 BLAKE2B f1469254ccfcb96ee5e39af49fcae575717e2f0e9a3dc74a13408306b5c94f4557a9c6d6a448541cb1f6dd27781e484b37d5ea9f230dc87f9d3370fac31dfdba SHA512 bbc160bc9c3c9365018c680f6a69347bc222cdaec10ea48d18aedd0341048df74973d3299d783662adf02b414874824660da10943d88f64c30451d3fdccc63fb +DIST pycairo-1.25.0.tar.gz 347794 BLAKE2B d05c1f505059c181d176b533ff4753e90888189160b1904531da4d9e9b784976442acb8c848be48d23e04f1fd07fef88a05b374c833ecee1c0b0e2881dadd4d0 SHA512 f34df509d36fbc739e8ddb40e2ead473db6970eacb7a2b0ccad8b82fd41a5daa25c89a5d34e7f2b2b70c4bf74e4e9d87465414aa414280e0aa7a4787b05712da EBUILD pycairo-1.24.0.ebuild 1236 BLAKE2B aea95e9f30aaed453d16742bb76d65d14d4f096b072ac52ec17fb74e9abefed183a633dae265ce34e018f5c0f1fb96d6732c5f9ee75003ebd8e0cd13cd72e21b SHA512 fa792fc7a89962c9e0ccbfeabd0845838be04de7e46ee0a2601de8cd36bc8eb77fa0652f1cbb2255f66333db128cebe212cafe202a0861a444c4fdf76641e397 +EBUILD pycairo-1.25.0.ebuild 1583 BLAKE2B 47a86d883d8e8d335314a1a401e4cceee9162acb160c6b9686f8339df2fe58a1ad8ba1c7f050278f59e0bc8cfa46ed48244cbf3ee428a52d711c80f1d6db1aa3 SHA512 1559816a9d88ebb092882e33ba05aed2a9d2cbf0c403239607ed97ea90bd8ff1aa7980bb47ba77c9fe366de73dc6b1989f439c09f3b8534dec0c060c0f3fe2c4 MISC metadata.xml 368 BLAKE2B 5e0f85e23bc56113927d28072c7178d27fc058b1e90851150c55e9e713edb96dd5daa79df8423f6719032538c9448d8afa9b750961bd82a5bcfae2d5e228c6b6 SHA512 c1e81ed2f535c8050f18950a57b71aa871b965c57d1e5ca8e8a4c48ecd643bc9ec326e046c1aea9f3f41124b9fe765a0b9b46a541c28f325cae7038cea66d086 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; diff --git a/dev-python/pycairo/pycairo-1.25.0.ebuild b/dev-python/pycairo/pycairo-1.25.0.ebuild new file mode 100644 index 000000000000..855fe827c15a --- /dev/null +++ b/dev-python/pycairo/pycairo-1.25.0.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Python bindings for the cairo library" +HOMEPAGE=" + https://www.cairographics.org/pycairo/ + https://github.com/pygobject/pycairo/ + https://pypi.org/project/pycairo/ +" +SRC_URI=" + https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz +" + +LICENSE="|| ( LGPL-2.1 MPL-1.1 )" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="examples" + +BDEPEND=" + virtual/pkgconfig + test? ( + dev-python/hypothesis[${PYTHON_USEDEP}] + ) +" +RDEPEND=" + >=x11-libs/cairo-1.15.10[svg(+)] +" +DEPEND=" + ${RDEPEND} + x11-base/xorg-proto +" + +distutils_enable_sphinx docs \ + dev-python/sphinx-rtd-theme +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}/${P}-init.patch" +) + +python_test() { + esetup.py build_tests + epytest +} + +python_install() { + distutils-r1_python_install + + # we need to pass --root via install command, sigh + cat > "${T}/distutils-extra.cfg" <<-EOF || die + [install] + root = ${ED} + EOF + local -x DIST_EXTRA_CONFIG=${T}/distutils-extra.cfg + esetup.py \ + install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig" +} + +python_install_all() { + if use examples; then + dodoc -r examples + fi + + distutils-r1_python_install_all + + insinto /usr/include/pycairo + newins cairo/pycairo.h py3cairo.h +} |