git: 12f258128338 - main - devel/py-lxml: fix build with libxml 2.13

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Tue, 25 Jun 2024 20:20:59 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=12f25812833887fbdfdc82c3747f9f8b0e808ae3

commit 12f25812833887fbdfdc82c3747f9f8b0e808ae3
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2024-06-25 16:38:23 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2024-06-25 19:13:58 +0000

    devel/py-lxml: fix build with libxml 2.13
    
    PR:             279798
    Reported by:    diizzy
---
 devel/py-lxml/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/devel/py-lxml/Makefile b/devel/py-lxml/Makefile
index ca21958269f5..0f756bd2fcfb 100644
--- a/devel/py-lxml/Makefile
+++ b/devel/py-lxml/Makefile
@@ -31,6 +31,12 @@ PYDISTUTILS_BUILDARGS=		--inplace
 post-extract:
 	@${FIND} ${WRKSRC} -name "*.c" -delete
 
+pre-configure: # remove with update to 5.x
+	@if ! xml2-config --version | ${GREP} -q ^2\.11; then \
+		${REINPLACE_CMD} -e 's|, xmlerror.xmlError\*|, const xmlerror.xmlError*|' \
+			${WRKSRC}/src/lxml/*.pxi; \
+	fi
+
 post-install:
 	@${FIND} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} \
 		-name '*.so' -exec ${STRIP_CMD} {} +