diff options
| -rw-r--r-- | 59.patch | 56 | ||||
| -rw-r--r-- | php-pecl-parle.spec | 56 |
2 files changed, 76 insertions, 36 deletions
diff --git a/59.patch b/59.patch new file mode 100644 index 0000000..9373643 --- /dev/null +++ b/59.patch @@ -0,0 +1,56 @@ +From e28a0a6af688bca4714924aa0996f3f8697ae913 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 17 Jul 2025 15:31:42 +0200 +Subject: [PATCH 1/2] use zend_ce_exception instead of + zend_exception_get_default() for 8.5 + +--- + parle.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/parle.cpp b/parle.cpp +index 782c591..a1e2c2b 100644 +--- a/parle.cpp ++++ b/parle.cpp +@@ -3145,11 +3145,11 @@ PHP_MINIT_FUNCTION(parle) + #endif + + INIT_CLASS_ENTRY(ce, "Parle\\LexerException", NULL); +- ParleLexerException_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); ++ ParleLexerException_ce = zend_register_internal_class_ex(&ce, zend_ce_exception); + INIT_CLASS_ENTRY(ce, "Parle\\ParserException", NULL); +- ParleParserException_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); ++ ParleParserException_ce = zend_register_internal_class_ex(&ce, zend_ce_exception); + INIT_CLASS_ENTRY(ce, "Parle\\StackException", NULL); +- ParleStackException_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default()); ++ ParleStackException_ce = zend_register_internal_class_ex(&ce, zend_ce_exception); + + REGISTER_NS_BOOL_CONSTANT("Parle", "INTERNAL_UTF32", PARLE_U32, CONST_PERSISTENT | CONST_CS); + + +From efda0c5bac49a49e694d2eb8fc0d71f2c17f5e69 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 4 Sep 2025 11:04:59 +0200 +Subject: [PATCH 2/2] Fix Deprecated: Case statements followed by a semicolon + +--- + tests/lexer_position_tracking_001.phpt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/lexer_position_tracking_001.phpt b/tests/lexer_position_tracking_001.phpt +index 131e518..4fd3bd0 100644 +--- a/tests/lexer_position_tracking_001.phpt ++++ b/tests/lexer_position_tracking_001.phpt +@@ -43,10 +43,10 @@ do { + case Parser::ACTION_REDUCE: + //echo "Trace: ", $par->trace(), PHP_EOL; + switch ($par->reduceId) { +- case $prod_0; ++ case $prod_0: + echo " Match: '", $par->sigil(0), "', token: '", substr($in, $lex->marker, $lex->cursor - $lex->marker), "'", PHP_EOL; + break; +- case $prod_1; ++ case $prod_1: + echo " Match: '", $par->sigil(1), "', token: '", substr($in, $lex->marker, $lex->cursor - $lex->marker), "'", PHP_EOL; + break; + } diff --git a/php-pecl-parle.spec b/php-pecl-parle.spec index 023b5a1..4441c2a 100644 --- a/php-pecl-parle.spec +++ b/php-pecl-parle.spec @@ -1,15 +1,12 @@ # remirepo spec file for php-pecl-parle # -# 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 # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %bcond_without tests %{?scl:%scl_package php-pecl-parle} @@ -23,19 +20,15 @@ Summary: Parsing and lexing Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 0.8.5 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} # Extension is BSD, libraries are Boost License: BSD-2-Clause AND BSL-1.0 URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Patch0: 59.patch + BuildRequires: make -%if 0%{?rhel} == 7 && 0%{?dtsversion} == 0 -# Always use DTS as c++14 is required -BuildRequires: devtoolset-8-toolchain -%global dtsenable source /opt/rh/devtoolset-8/enable -%global dtsprefix devtoolset-8- -%endif BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ BuildRequires: %{?dtsprefix}libstdc++-devel @@ -75,14 +68,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO sed -e '/tests/s/role="test"/role="src"/'\ -i package.xml -%if 0%{?_licensedir:1} sed -e '/LICENSE/s/role="doc"/role="src"/;/licence/s/role="doc"/role="src"/' \ -i package.xml mv %{sources}/lib/parsertl14/include/parsertl/licence_1_0.txt %{sources}/LICENSE.lexert14 mv %{sources}/lib/lexertl14/include/lexertl/licence_1_0.txt %{sources}/LICENSE.parsertl14 -%endif cd %{sources} +%patch -P0 -p1 # Sanity check, really often broken extver=$(sed -n '/#define PHP_PARLE_VERSION/{s/.* "//;s/".*$//;p}' php_parle.h) if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then @@ -175,28 +167,8 @@ make test "TESTS=--show-diff -q %{?_smp_mflags}" %endif -%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 - - %files -%{?_licensedir:%license %{sources}/LICENSE*} +%license %{sources}/LICENSE* %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -211,6 +183,18 @@ fi ######### TODO : use --enable-parle-utf32 ? %changelog +* Thu Sep 4 2025 Remi Collet <remi@remirepo.net> - 0.8.5-4 +- more fix for PHP 8.5.0beta2 using patch from + https://github.com/weltling/parle/pull/59 + +* Thu Jul 17 2025 Remi Collet <remi@remirepo.net> - 0.8.5-3 +- add fix for PHP 8.5.0alpha2 using patch from + https://github.com/weltling/parle/pull/59 +- re-license spec file to CECILL-2.1 + +* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 0.8.5-2 +- rebuild for PHP 8.3.0RC1 + * Sun Jul 2 2023 Remi Collet <remi@remirepo.net> - 0.8.5-1 - update to 0.8.5 - build out of sources tree |
