summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--7c692b9880aa6a501b6627d923bbc8ed1da1465f.patch190
-rw-r--r--php-pecl-parle.spec22
2 files changed, 208 insertions, 4 deletions
diff --git a/7c692b9880aa6a501b6627d923bbc8ed1da1465f.patch b/7c692b9880aa6a501b6627d923bbc8ed1da1465f.patch
new file mode 100644
index 0000000..5b81584
--- /dev/null
+++ b/7c692b9880aa6a501b6627d923bbc8ed1da1465f.patch
@@ -0,0 +1,190 @@
+From 7c692b9880aa6a501b6627d923bbc8ed1da1465f Mon Sep 17 00:00:00 2001
+From: Anatol Belski <ab@php.net>
+Date: Sat, 1 Jun 2019 14:12:31 +0200
+Subject: [PATCH] Fix 7.4+ compatibility
+
+---
+ parle.cpp | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 79 insertions(+), 6 deletions(-)
+
+diff --git a/parle.cpp b/parle.cpp
+index 6a46e4d..087de5e 100644
+--- a/parle.cpp
++++ b/parle.cpp
+@@ -1771,7 +1771,12 @@ php_parle_rlexer_read_property(zval *object, zval *member, int type, void **cach
+ return php_parle_lex_read_property<ze_parle_rlexer_obj>(object, member, type, cache_slot, rv);
+ }/*}}}*/
+
+-template <typename lexer_obj_type> void
++template <typename lexer_obj_type>
++#if PHP_VERSION_ID >= 70400
++zval *
++#else
++void
++#endif
+ php_parle_lex_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
+ lexer_obj_type *zplo;
+@@ -1796,11 +1801,20 @@ php_parle_lex_write_property(zval *object, zval *member, zval *value, void **cac
+ }
+ } else if (PARLE_IS_PROP("flags")) {
+ lex.rules.flags(zval_get_long(value));
+- } else PARLE_LEX_CHECK_THROW_RO_PROP("state")
++ }
++#if PHP_VERSION_ID >= 70400
++ else PARLE_LEX_CHECK_THROW_RET_RO_PROP("state")
++ else PARLE_LEX_CHECK_THROW_RET_RO_PROP("cursor")
++ else PARLE_LEX_CHECK_THROW_RET_RO_PROP("marker")
++ else PARLE_LEX_CHECK_THROW_RET_RO_PROP("line")
++ else PARLE_LEX_CHECK_THROW_RET_RO_PROP("column")
++#else
++ else PARLE_LEX_CHECK_THROW_RO_PROP("state")
+ else PARLE_LEX_CHECK_THROW_RO_PROP("cursor")
+ else PARLE_LEX_CHECK_THROW_RO_PROP("marker")
+ else PARLE_LEX_CHECK_THROW_RO_PROP("line")
+ else PARLE_LEX_CHECK_THROW_RO_PROP("column")
++#endif
+ else {
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
+ }
+@@ -1808,17 +1822,35 @@ php_parle_lex_write_property(zval *object, zval *member, zval *value, void **cac
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
++
++#if PHP_VERSION_ID >= 70400
++ return value;
++#endif
+ }/*}}}*/
+
++#if PHP_VERSION_ID >= 70400
++static zval *
++#else
+ static void
++#endif
+ php_parle_lexer_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
++#if PHP_VERSION_ID >= 70400
++ return
++#endif
+ php_parle_lex_write_property<ze_parle_lexer_obj>(object, member, value, cache_slot);
+ }/*}}}*/
+
++#if PHP_VERSION_ID >= 70400
++static zval *
++#else
+ static void
++#endif
+ php_parle_rlexer_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
++#if PHP_VERSION_ID >= 70400
++ return
++#endif
+ php_parle_lex_write_property<ze_parle_rlexer_obj>(object, member, value, cache_slot);
+ }/*}}}*/
+
+@@ -2061,7 +2093,12 @@ php_parle_rparser_read_property(zval *object, zval *member, int type, void **cac
+ return php_parle_par_read_property<ze_parle_parser_obj>(object, member, type, cache_slot, rv);
+ }/*}}}*/
+
+-template <typename parser_obj_type> void
++template <typename parser_obj_type>
++#if PHP_VERSION_ID >= 70400
++zval *
++#else
++void
++#endif
+ php_parle_par_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
+ zval tmp_member;
+@@ -2073,8 +2110,13 @@ php_parle_par_write_property(zval *object, zval *member, zval *value, void **cac
+ cache_slot = NULL;
+ }
+
++#if PHP_VERSION_ID >= 70400
++ PARLE_PAR_CHECK_THROW_RET_RO_PROP("action")
++ else PARLE_PAR_CHECK_THROW_RET_RO_PROP("reduceId")
++#else
+ PARLE_PAR_CHECK_THROW_RO_PROP("action")
+ else PARLE_PAR_CHECK_THROW_RO_PROP("reduceId")
++#endif
+ else {
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
+ }
+@@ -2082,18 +2124,36 @@ php_parle_par_write_property(zval *object, zval *member, zval *value, void **cac
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
++
++#if PHP_VERSION_ID >= 70400
++ return value;
++#endif
+ }/*}}}*/
+
++#if PHP_VERSION_ID >= 70400
++static zval *
++#else
+ static void
++#endif
+ php_parle_parser_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
+- return php_parle_par_write_property<ze_parle_parser_obj>(object, member, value, cache_slot);
++#if PHP_VERSION_ID >= 70400
++ return
++#endif
++ php_parle_par_write_property<ze_parle_parser_obj>(object, member, value, cache_slot);
+ }/*}}}*/
+
++#if PHP_VERSION_ID >= 70400
++static zval *
++#else
+ static void
++#endif
+ php_parle_rparser_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
+- return php_parle_par_write_property<ze_parle_rparser_obj>(object, member, value, cache_slot);
++#if PHP_VERSION_ID >= 70400
++ return
++#endif
++ php_parle_par_write_property<ze_parle_rparser_obj>(object, member, value, cache_slot);
+ }/*}}}*/
+
+ template <typename parser_obj_type> HashTable *
+@@ -2303,7 +2363,11 @@ php_parle_stack_read_property(zval *object, zval *member, int type, void **cache
+ return retval;
+ }/*}}}*/
+
++#if PHP_VERSION_ID >= 70400
++static zval *
++#else
+ static void
++#endif
+ php_parle_stack_write_property(zval *object, zval *member, zval *value, void **cache_slot) noexcept
+ {/*{{{*/
+ ze_parle_stack_obj *zpso;
+@@ -2336,8 +2400,14 @@ php_parle_stack_write_property(zval *object, zval *member, zval *value, void **c
+ zval_ptr_dtor(old);
+ efree(old);
+ }
+- } else PARLE_STACK_CHECK_THROW_RO_PROP("empty")
++ }
++#if PHP_VERSION_ID >= 70400
++ else PARLE_STACK_CHECK_THROW_RET_RO_PROP("empty")
++ else PARLE_STACK_CHECK_THROW_RET_RO_PROP("size")
++#else
++ else PARLE_STACK_CHECK_THROW_RO_PROP("empty")
+ else PARLE_STACK_CHECK_THROW_RO_PROP("size")
++#endif
+ else {
+ (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot);
+ }
+@@ -2345,6 +2415,9 @@ php_parle_stack_write_property(zval *object, zval *member, zval *value, void **c
+ if (member == &tmp_member) {
+ zval_dtor(member);
+ }
++#if PHP_VERSION_ID >= 70400
++ return value;
++#endif
+ }/*}}}*/
+
+ static HashTable *
diff --git a/php-pecl-parle.spec b/php-pecl-parle.spec
index 1b02412..b351a1c 100644
--- a/php-pecl-parle.spec
+++ b/php-pecl-parle.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-pecl-parle
#
-# Copyright (c) 2017-2018 Remi Collet
+# Copyright (c) 2017-2019 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -21,7 +21,7 @@
# After json
%global ini_name 40-%{pecl_name}.ini
-%if 0%{?rhel}
+%if 0%{?rhel} == 6 || 0%{?rhel} == 7
# Always use DTS as c++14 is required
BuildRequires: devtoolset-6-toolchain
%global dtsenable source /opt/rh/devtoolset-6/enable
@@ -31,12 +31,14 @@ BuildRequires: devtoolset-6-toolchain
Summary: Parsing and lexing
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 0.8.1
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
# Extension is BSD, libraries are Boost
License: BSD and Boost
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: https://github.com/weltling/parle/commit/7c692b9880aa6a501b6627d923bbc8ed1da1465f.patch
+
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
@@ -75,9 +77,13 @@ Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.3"
-Obsoletes: php73u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php73-pecl-%{pecl_name} <= %{version}
Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.4"
+Obsoletes: php74-pecl-%{pecl_name} <= %{version}
+Obsoletes: php74w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -113,6 +119,8 @@ mv NTS/lib/parsertl14/parsertl/licence_1_0.txt NTS/LICENSE.parsertl14
%endif
cd NTS
+%patch0 -p1 -b .up
+
# 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
@@ -242,6 +250,12 @@ fi
%changelog
+* Tue Jun 4 2019 Remi Collet <remi@remirepo.net> - 0.8.1-6
+- add upstream patch for 7.4
+
+* Wed Dec 12 2018 Remi Collet <remi@remirepo.net> - 0.8.1-5
+- cleanup for EL-8
+
* Thu Aug 16 2018 Remi Collet <remi@remirepo.net> - 0.8.1-4
- rebuild for 7.3.0beta2 new ABI