git: 2ba9528464b9 - main - math/py-triangle: unbreak with Python 3.13

From: Diane Bruce <db_at_FreeBSD.org>
Date: Tue, 20 Oct 2026 20:05:17 UTC
The branch main has been updated by db:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2ba9528464b9a0bfbeb23827c28725835cede6b4

commit 2ba9528464b9a0bfbeb23827c28725835cede6b4
Author:     Diane Bruce <db@FreeBSD.org>
AuthorDate: 2026-10-20 20:01:55 +0000
Commit:     Diane Bruce <db@FreeBSD.org>
CommitDate: 2026-10-20 20:01:55 +0000

    math/py-triangle: unbreak with Python 3.13
    
    math/py-triangle 20230923 does not build with Python 3.13. In the
    Python 3.13 exp-run of 2026-07-13 it failed in the build phase:
    
        triangle/core.c:31640:67: error: too few arguments to function call, expected 6, have 5
         31638 |                 ret = _PyLong_AsByteArray((PyLongObject *)v,
         31639 |                                            bytes, sizeof(val),
         31640 |                                            is_little, !is_unsigned);
    
    Log: https://pkg-status.freebsd.org/gohan06/data/150amd64-default-foo/2026-07-13_05h37m51s/logs/errors/py313-triangle-20230923_1.log
    
    The release ships a core.c generated by an older Cython, which calls
    _PyLong_AsByteArray() with the old argument list; Python 3.13 added a
    sixth argument.
    
    20250106 (uploaded to PyPI 2025-01-07) is the next release; the only
    change is that the bundled core.c was regenerated with Cython 3.0.11.
    The patch updates the port to it.
    
    Changes: https://github.com/drufat/triangle/compare/v20230923...v20250106
    
    Misc changes:
    - python is added to CATEGORIES
    - the port builds with pep517 (setuptools, wheel, and USE_PYTHON=cython
      for the build-system Cython check)
    - the numpy runtime dependency upstream declares is added
    - concurrent is added to USE_PYTHON
    - portlint warnings are fixed
    - pkg-descr is expanded
    
    Impact: no ports depend on it.
    
    Tested: poudriere bulk -C -t on amd64, both with Python 3.12 and with
    DEFAULT_VERSIONS+=python=3.13: builds, passes check-plist, and all 6
    modules import from the built package.
    
    Nothing to send upstream (fixed in 20250106, still the latest
    release).
    
    PR:             299538
    Reported by:    patrick@crandol.com
---
 math/py-triangle/Makefile  | 13 +++++++------
 math/py-triangle/distinfo  |  6 +++---
 math/py-triangle/pkg-descr |  7 ++++---
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/math/py-triangle/Makefile b/math/py-triangle/Makefile
index b6a1b8afaf44..ebecbdd38b63 100644
--- a/math/py-triangle/Makefile
+++ b/math/py-triangle/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	triangle
 DISTVERSIONPREFIX=	v
-DISTVERSION=	20230923
-PORTREVISION=	1
-CATEGORIES=	math
+DISTVERSION=	20250106
+CATEGORIES=	math python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -12,15 +11,17 @@ WWW=		https://rufat.be/triangle
 
 LICENSE=	LGPL3
 LICENSE_FILE=	${WRKSRC}/LICENSE
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=61:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} \
+		triangle>0:math/triangle
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}numpy>0:math/py-numpy@${PY_FLAVOR}
 
 USES=		compiler:c++11-lang python
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	drufat
 GH_TUPLE=	drufat:triangle-c:8b9e104:triangle/c
-USE_PYTHON=	distutils autoplist
-
-BUILD_DEPENDS=	triangle>0:math/triangle
+USE_PYTHON=	autoplist concurrent cython pep517
 
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/triangle/core*.so
diff --git a/math/py-triangle/distinfo b/math/py-triangle/distinfo
index 7c69ff4618fd..16fe19c1c245 100644
--- a/math/py-triangle/distinfo
+++ b/math/py-triangle/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1704470771
-SHA256 (drufat-triangle-v20230923_GH0.tar.gz) = 5fd7ff55c65601d6a1b8ac6485f413633c930685c4eaae950131f3a99868bc97
-SIZE (drufat-triangle-v20230923_GH0.tar.gz) = 1449399
+TIMESTAMP = 1791679925
+SHA256 (drufat-triangle-v20250106_GH0.tar.gz) = 79fd8d47da786aa97223140336662fd4ab8b387b742848e37163fc42c3ad182d
+SIZE (drufat-triangle-v20250106_GH0.tar.gz) = 1450918
 SHA256 (drufat-triangle-c-8b9e104_GH0.tar.gz) = e8f0c1523c016b017a4e47967360c6e6d97b8d6ac27290fd384bebc458e2e7bf
 SIZE (drufat-triangle-c-8b9e104_GH0.tar.gz) = 153986
diff --git a/math/py-triangle/pkg-descr b/math/py-triangle/pkg-descr
index 5921209d2fc8..4a88c1a7fa15 100644
--- a/math/py-triangle/pkg-descr
+++ b/math/py-triangle/pkg-descr
@@ -1,3 +1,4 @@
-*Triangle* is a python wrapper around Jonathan Richard Shewchuk's two-dimensional
-quality mesh generator and delaunay triangulator library.
-This implementation utilizes Cython_ to wrap the C API as closely as possible.
+Triangle is a python wrapper around Jonathan Richard Shewchuk's
+two-dimensional quality mesh generator and delaunay triangulator library.
+This implementation utilizes Cython to wrap the C API as closely as
+possible.