commit:     35e6eb22a520d6e8ea2148f6d92b9b48083f7a1f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  4 07:18:07 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec  4 07:32:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e6eb22

dev-python/shapely: fix modern c pointer types

Bug: https://bugs.gentoo.org/885633
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/shapely/files/shapely-2.0.2-c99.patch | 19 +++++++++
 dev-python/shapely/shapely-2.0.2-r1.ebuild       | 50 ++++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/dev-python/shapely/files/shapely-2.0.2-c99.patch 
b/dev-python/shapely/files/shapely-2.0.2-c99.patch
new file mode 100644
index 000000000000..a51fc8883103
--- /dev/null
+++ b/dev-python/shapely/files/shapely-2.0.2-c99.patch
@@ -0,0 +1,19 @@
+https://github.com/shapely/shapely/pull/1945
+
+From 9795506bba84e96418466ae84573c0cf8654bbeb Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <c...@musicinmybrain.net>
+Date: Sun, 3 Dec 2023 11:36:36 -0500
+Subject: [PATCH] Fix incompatible pointer type passed to GEOSPolygonize_r
+
+--- a/src/ufuncs.c
++++ b/src/ufuncs.c
+@@ -2160,7 +2160,7 @@ static void polygonize_func(char** args, const npy_intp* 
dimensions, const npy_i
+ 
+   GEOS_INIT;
+ 
+-  GEOSGeometry** geoms = malloc(sizeof(void*) * dimensions[1]);
++  const GEOSGeometry** geoms = malloc(sizeof(void*) * dimensions[1]);
+   if (geoms == NULL) {
+     errstate = PGERR_NO_MALLOC;
+     goto finish;
+

diff --git a/dev-python/shapely/shapely-2.0.2-r1.ebuild 
b/dev-python/shapely/shapely-2.0.2-r1.ebuild
new file mode 100644
index 000000000000..794dd6b9b43e
--- /dev/null
+++ b/dev-python/shapely/shapely-2.0.2-r1.ebuild
@@ -0,0 +1,50 @@
+# 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} )
+
+inherit distutils-r1
+
+MY_P=${P/_p/.post}
+DESCRIPTION="Geometric objects, predicates, and operations"
+HOMEPAGE="
+       https://pypi.org/project/shapely/
+       https://github.com/shapely/shapely/
+"
+SRC_URI="
+       https://github.com/shapely/shapely/archive/${PV/_p/.post}.tar.gz
+               -> ${MY_P}.gh.tar.gz
+"
+S=${WORKDIR}/${MY_P}
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+DEPEND="
+       >=sci-libs/geos-3.9
+"
+RDEPEND="
+       ${DEPEND}
+       dev-python/numpy[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       ${DEPEND}
+       >=dev-python/cython-0.29.32[${PYTHON_USEDEP}]
+       dev-python/packaging[${PYTHON_USEDEP}]
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.0.2-c99.patch
+)
+
+distutils_enable_tests pytest
+
+python_test() {
+       rm -rf shapely || die
+       epytest --pyargs shapely
+}

Reply via email to