diff options
| -rw-r--r-- | 69.patch | 22 | ||||
| -rw-r--r-- | php-pecl-mustache.spec | 71 | 
2 files changed, 42 insertions, 51 deletions
diff --git a/69.patch b/69.patch new file mode 100644 index 0000000..6cbdffe --- /dev/null +++ b/69.patch @@ -0,0 +1,22 @@ +From b7dca6820a2e90b64fde3f0fe2af35f4cbffae6f Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 18 Jul 2025 06:31:34 +0200 +Subject: [PATCH] drop zend_exception_get_default usage + +--- + mustache_exceptions.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mustache_exceptions.cpp b/mustache_exceptions.cpp +index bae387c..6e90437 100644 +--- a/mustache_exceptions.cpp ++++ b/mustache_exceptions.cpp +@@ -18,7 +18,7 @@ zend_class_entry * MustacheParserException_ce_ptr; + PHP_MINIT_FUNCTION(mustache_exceptions) + { +   try { +-    zend_class_entry * exception_ce = zend_exception_get_default(); ++    zend_class_entry * exception_ce = zend_ce_exception; +  +     // MustacheException +     zend_class_entry mustache_exception_ce; diff --git a/php-pecl-mustache.spec b/php-pecl-mustache.spec index 5dea509..abf796a 100644 --- a/php-pecl-mustache.spec +++ b/php-pecl-mustache.spec @@ -1,8 +1,8 @@  # remirepo spec file for php-pecl-mustache  # -# Copyright (c) 2017-2023 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText:  Copyright 2017-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt  #  # Please, preserve the changelog entries  # @@ -22,21 +22,19 @@  Summary:        Mustache templating language  Name:           %{?scl_prefix}php-pecl-%{pecl_name}  Version:        %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release:        2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release:        3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}  License:        MIT  URL:            https://pecl.php.net/package/%{pecl_name}  Source0:        https://pecl.php.net/get/%{sources}.tgz +Patch0:         69.patch +  BuildRequires:  make  BuildRequires:  %{?dtsprefix}gcc  BuildRequires:  %{?scl_prefix}php-devel >= 7.0  BuildRequires:  %{?scl_prefix}php-pear  BuildRequires:  pkgconfig(mustache) >= 0.5.0 -%if 0%{?rhel} == 7 -BuildRequires:  devtoolset-6-toolchain -%else  BuildRequires:  gcc-c++ -%endif  Requires:       %{?scl_prefix}php(zend-abi) = %{php_zend_api}  Requires:       %{?scl_prefix}php(api) = %{php_core_api} @@ -59,10 +57,12 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO  # Don't install/register tests  sed -e 's/role="test"/role="src"/' \ -    %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ +    -e '/LICENSE/s/role="doc"/role="src"/' \      -i package.xml  cd %{sources} +%patch -P0 -p1 +  # Sanity check, really often broken  extver=$(sed -n '/PHP_MUSTACHE_VERSION/{s/.* "//;s/".*$//;p}' php_mustache.h)  if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -84,11 +84,6 @@ EOF  %build -%if 0%{?rhel} == 7 -source /opt/rh/devtoolset-6/enable -g++ --version -%endif -  cd %{sources}  %{__phpize} @@ -112,10 +107,6 @@ make %{?_smp_mflags}  %install -%if 0%{?rhel} == 7 -source /opt/rh/devtoolset-6/enable -%endif -  make -C NTS install INSTALL_ROOT=%{buildroot}  # install config file @@ -136,26 +127,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i  done -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then -    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then -    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then -    %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - -  %check  cd %{sources} @@ -166,12 +137,15 @@ cd %{sources}  %if %{with tests} +OPTS="-P -q --show-diff %{?_smp_mflags}" +%if "%{php_version}" > "7.4" +OPTS="$OPTS %{?_smp_mflags}" +%endif +  # Upstream test suite -TEST_PHP_EXECUTABLE=%{__php} \  TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \  REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff +%{__php} -n run-tests.php $OPTS  %endif  %if %{with_zts} @@ -179,20 +153,10 @@ REPORT_EXIT_STATUS=1 \  %{__ztsphp} --no-php-ini \      --define extension=../ZTS/modules/%{pecl_name}.so \      --modules | grep '^%{pecl_name}$' - -%if %{with tests} -# Upstream test suite -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff -%endif  %endif  %files -%{!?_licensedir:%global license %%doc}  %license %{sources}/LICENSE.md  %doc %{pecl_docdir}/%{pecl_name}  %{pecl_xmldir}/%{name}.xml @@ -207,6 +171,11 @@ REPORT_EXIT_STATUS=1 \  %changelog +* Fri Jul 18 2025 Remi Collet <remi@remirepo.net> - 0.9.3-3 +- add fix for PHP 8.5.0alpha2 using patch from +  https://github.com/jbboehr/php-mustache/pull/69 +- re-license spec file to CECILL-2.1 +  * Fri Sep  1 2023 Remi Collet <remi@remirepo.net> - 0.9.3-2  - build out of sources tree  | 
