From fcad8ef289c8bdac39d4a042540de704a7b2a8ad Mon Sep 17 00:00:00 2001 From: BjarneDM Date: Fri, 17 Oct 2025 01:12:04 +0200 Subject: [PATCH] php-svm: patched for php >= 8.5 --- php/php-svm/Portfile | 11 +++++--- .../files/patch_zend-ce-exception.diff | 25 +++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 php/php-svm/files/patch_zend-ce-exception.diff diff --git a/php/php-svm/Portfile b/php/php-svm/Portfile index 216248ce75b..017ec5b8b1f 100644 --- a/php/php-svm/Portfile +++ b/php/php-svm/Portfile @@ -5,19 +5,24 @@ PortGroup php 1.1 name php-svm categories-append math -maintainers {ryandesign @ryandesign} openmaintainer +maintainers {ryandesign @ryandesign} {mathiesen.info:macintosh BjarneDMat} license BSD -php.branches 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 +php.branches 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 php.pecl yes php.pecl.prerelease yes if {[vercmp ${php.branch} >= 7.0]} { version 0.2.3 - revision 4 + revision 5 checksums rmd160 0df66ac9fb15b82efbf8de56439aabc7cfca4e69 \ sha256 80cf414942cc558a6934d0a508f056daaaa7399df5bd8dc556bff5ee1ebf5c9a \ size 130776 + + patch.pre_args-replace -p0 -p1 + patchfiles-append \ + patch_zend-ce-exception.diff + } elseif {[vercmp ${php.branch} >= 5.2]} { version 0.1.9 revision 5 diff --git a/php/php-svm/files/patch_zend-ce-exception.diff b/php/php-svm/files/patch_zend-ce-exception.diff new file mode 100644 index 00000000000..08e3b2d7a5e --- /dev/null +++ b/php/php-svm/files/patch_zend-ce-exception.diff @@ -0,0 +1,25 @@ +From 0c26d905421b2a7e4df3b00c7093b15e9dee34a8 Mon Sep 17 00:00:00 2001 +From: Jean-Baptiste Nahan <814683+macintoshplus@users.noreply.github.com> +Date: Tue, 7 Oct 2025 17:52:13 +0200 +Subject: [PATCH] Fix zend_ce_exception for PHP 8.5 + +--- + svm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/svm.c b/svm.c +index bdc8da4..6607882 100755 +--- a/svm.c ++++ b/svm.c +@@ -1373,7 +1373,11 @@ PHP_MINIT_FUNCTION(svm)/*{{{*/ + php_svm_model_sc_entry = zend_register_internal_class(&ce); + + INIT_CLASS_ENTRY(ce, "svmexception", NULL); ++#if PHP_VERSION_ID < 80500 + php_svm_exception_sc_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default()); ++#else ++ php_svm_exception_sc_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); ++#endif + php_svm_exception_sc_entry->ce_flags |= ZEND_ACC_FINAL; + + /* Redirect the lib svm output */