summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-09-09 16:40:14 +0200
committerRemi Collet <remi@remirepo.net>2021-09-09 16:40:14 +0200
commitf31ac11b452d9aec0521de6a7a6166603a49562a (patch)
tree5cd014f2e3c0d96a801f00f3889cf95dbb22b74f
parent20baf5574a6d0c4c7f0105ba9d884e19090c6c2e (diff)
add patch for PHP 8.1 from
https://github.com/weltling/parle/pull/28
-rw-r--r--parle-php81.patch52
-rw-r--r--php-pecl-parle.spec12
2 files changed, 63 insertions, 1 deletions
diff --git a/parle-php81.patch b/parle-php81.patch
new file mode 100644
index 0000000..7025a4f
--- /dev/null
+++ b/parle-php81.patch
@@ -0,0 +1,52 @@
+From 2d3c09723b0571250b58d717076214da9721e8a9 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 9 Sep 2021 16:37:04 +0200
+Subject: [PATCH] Use ZEND_ACC_NOT_SERIALIZABLE for 8.1
+
+---
+ parle.cpp | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/parle.cpp b/parle.cpp
+index b2b6819..b966ab6 100644
+--- a/parle.cpp
++++ b/parle.cpp
+@@ -2818,8 +2818,12 @@ PHP_MINIT_FUNCTION(parle)
+ zend_declare_property_long(ce, "state", sizeof("state")-1, 0, ZEND_ACC_PUBLIC);
+ zend_declare_property_long(ce, "marker", sizeof("marker")-1, Z_L(-1), ZEND_ACC_PUBLIC);
+ zend_declare_property_long(ce, "cursor", sizeof("cursor")-1, Z_L(-1), ZEND_ACC_PUBLIC);
++#if PHP_VERSION_ID < 80100
+ ce->serialize = zend_class_serialize_deny;
+ ce->unserialize = zend_class_unserialize_deny;
++#else
++ ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
++#endif
+ };
+
+ memcpy(&parle_lexer_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+@@ -2865,8 +2869,12 @@ PHP_MINIT_FUNCTION(parle)
+ #undef DECL_CONST
+ zend_declare_property_long(ce, "action", sizeof("action")-1, 0, ZEND_ACC_PUBLIC);
+ zend_declare_property_long(ce, "reduceId", sizeof("reduceId")-1, 0, ZEND_ACC_PUBLIC);
++#if PHP_VERSION_ID < 80100
+ ce->serialize = zend_class_serialize_deny;
+ ce->unserialize = zend_class_unserialize_deny;
++#else
++ ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
++#endif
+ };
+
+ memcpy(&parle_parser_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+@@ -2915,8 +2923,12 @@ PHP_MINIT_FUNCTION(parle)
+ zend_declare_property_bool(ParleStack_ce, "empty", sizeof("empty")-1, 0, ZEND_ACC_PUBLIC);
+ zend_declare_property_long(ParleStack_ce, "size", sizeof("size")-1, 0, ZEND_ACC_PUBLIC);
+ zend_declare_property_long(ParleStack_ce, "top", sizeof("top")-1, 0, ZEND_ACC_PUBLIC);
++#if PHP_VERSION_ID < 80100
+ ParleStack_ce->serialize = zend_class_serialize_deny;
+ ParleStack_ce->unserialize = zend_class_unserialize_deny;
++#else
++ ParleStack_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE;
++#endif
+
+ INIT_CLASS_ENTRY(ce, "Parle\\LexerException", NULL);
+ ParleLexerException_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default());
diff --git a/php-pecl-parle.spec b/php-pecl-parle.spec
index c48a380..5b7ac4a 100644
--- a/php-pecl-parle.spec
+++ b/php-pecl-parle.spec
@@ -24,12 +24,14 @@
Summary: Parsing and lexing
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 0.8.2
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
# Extension is BSD, libraries are Boost
License: BSD and Boost
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: %{pecl_name}-php81.patch
+
BuildRequires: make
%if 0%{?rhel} == 7 && 0%{?dtsversion} == 0
# Always use DTS as c++14 is required
@@ -74,6 +76,9 @@ Obsoletes: php74-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "8.0"
Obsoletes: php80-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "8.1"
+Obsoletes: php81-pecl-%{pecl_name} <= %{version}
+%endif
%endif
@@ -103,6 +108,7 @@ mv NTS/lib/parsertl14/parsertl/licence_1_0.txt NTS/LICENSE.parsertl14
%endif
cd NTS
+%patch0 -p1 -b .php81
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_PARLE_VERSION/{s/.* "//;s/".*$//;p}' php_parle.h)
@@ -234,6 +240,10 @@ fi
######### TODO : use --enable-parle-utf32 ?
%changelog
+* Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 0.8.2-2
+- add patch for PHP 8.1 from
+ https://github.com/weltling/parle/pull/28
+
* Mon Jan 18 2021 Remi Collet <remi@remirepo.net> - 0.8.2-1
- update to 0.8.2
- drop patches merged upstream