git: cfabb36203d9 - main - www/pecl-solr: Unbreak on PHP 8.5

From: Li-Wen Hsu <lwhsu_at_FreeBSD.org>
Date: Tue, 11 Nov 2025 18:46:05 UTC
The branch main has been updated by lwhsu:

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

commit cfabb36203d9e2e84f93a544c67a5e38c5368289
Author:     Hung-Yi Chen <gaod@hychen.org>
AuthorDate: 2025-11-11 18:45:02 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2025-11-11 18:45:02 +0000

    www/pecl-solr: Unbreak on PHP 8.5
    
    PR:             290953
---
 www/pecl-solr/Makefile                    |  9 ++++++++-
 www/pecl-solr/files/extra-src__php_solr.h | 11 +++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/www/pecl-solr/Makefile b/www/pecl-solr/Makefile
index 99e85ddeaf97..31c99f777898 100644
--- a/www/pecl-solr/Makefile
+++ b/www/pecl-solr/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	solr
 PORTVERSION=	2.8.1
+PORTREVISION=	1
 CATEGORIES=	www
 
 MAINTAINER=	gaod@hychen.org
@@ -17,4 +18,10 @@ USE_GNOME=	libxml2
 CONFIGURE_ARGS=	LIBXML_CFLAGS=-I${LOCALBASE}/include/libxml2 \
 		LIBXML_LIBS=-L${LOCALBASE}/include/libxml2
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${PHP_VER} >= 85
+EXTRA_PATCHES=	${PATCHDIR}/extra-src__php_solr.h
+.  endif
+
+.include <bsd.port.post.mk>
diff --git a/www/pecl-solr/files/extra-src__php_solr.h b/www/pecl-solr/files/extra-src__php_solr.h
new file mode 100644
index 000000000000..00fde3640747
--- /dev/null
+++ b/www/pecl-solr/files/extra-src__php_solr.h
@@ -0,0 +1,11 @@
+--- src/php_solr.h.orig	2025-11-11 22:20:54.799208000 +0800
++++ src/php_solr.h	2025-11-11 22:21:15.328071000 +0800
+@@ -126,7 +126,7 @@
+ #define solr_ce_Serializable zend_ce_serializable
+ #define solr_ce_ArrayAccess  zend_ce_arrayaccess
+ #define solr_ce_Iterator     zend_ce_iterator
+-#define solr_ce_Exception    zend_exception_get_default()
++#define solr_ce_Exception    zend_ce_exception
+ /* }}} */
+ 
+ extern zend_object_handlers solr_object_handlers;