diff --git a/mingw-w64-python-shapely/0001-shapely-2.0.4-const-cast.patch b/mingw-w64-python-shapely/0001-shapely-2.0.4-const-cast.patch new file mode 100644 index 0000000000..6f59778694 --- /dev/null +++ b/mingw-w64-python-shapely/0001-shapely-2.0.4-const-cast.patch @@ -0,0 +1,12 @@ +diff -Naur shapely-2.0.4.orig/src/ufuncs.c shapely-2.0.4/src/ufuncs.c +--- shapely-2.0.4.orig/src/ufuncs.c 2024-05-22 22:05:04.162021200 +0300 ++++ shapely-2.0.4/src/ufuncs.c 2024-05-22 22:05:30.642070100 +0300 +@@ -2202,7 +2202,7 @@ + n_geoms++; + } + +- GEOSGeometry* ret_ptr = GEOSPolygonize_r(ctx, geoms, n_geoms); ++ GEOSGeometry* ret_ptr = GEOSPolygonize_r(ctx, (const GEOSGeometry *const*)geoms, n_geoms); + if (ret_ptr == NULL) { + errstate = PGERR_GEOS_EXCEPTION; + goto finish; diff --git a/mingw-w64-python-shapely/PKGBUILD b/mingw-w64-python-shapely/PKGBUILD new file mode 100644 index 0000000000..41e7210035 --- /dev/null +++ b/mingw-w64-python-shapely/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Konstantin Podsvirov + +_realname=shapely +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") +pkgver=2.0.4 +pkgrel=1 +pkgdesc='Manipulation and analysis of geometric objects in the Cartesian plane (mingw-w64)' +arch=('any') +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') +url='https://shapely.readthedocs.io' +msys2_repository_url='https://github.com/shapely/shapely' +msys2_references=( + 'pypi: shapely' +) +license=('BSD') +depends=("${MINGW_PACKAGE_PREFIX}-geos" + "${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-numpy") +makedepends=("${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-cython" + "${MINGW_PACKAGE_PREFIX}-python-build" + "${MINGW_PACKAGE_PREFIX}-python-installer" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-wheel") +options=('!strip') +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz" + '0001-shapely-2.0.4-const-cast.patch') +sha256sums=('5dc736127fac70009b8d309a0eeb74f3e08979e530cf7017f2f507ef62e6cfb8' + 'f46450fc9c59d5553e42337fbba53421c2184ae13d6fa26c899532b2f6c3a555') + +prepare() { + cd "${srcdir}" + rm -rf "python-build-${MSYSTEM}" | true + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" + + cd "python-build-${MSYSTEM}" + patch -p1 -i "${srcdir}/0001-shapely-2.0.4-const-cast.patch" +} + +build() { + cd "${srcdir}/python-build-${MSYSTEM}" + + GEOS_INCLUDE_PATH=${MINGW_PREFIX}/include \ + GEOS_LIBRARY_PATH=${MINGW_PREFIX}/lib \ + ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation +} + +package() { + cd "${srcdir}/python-build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=" \ + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl + + install -Dm644 LICENSE.txt \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.txt" +}