From 31535433d7c199457ae5928d60a79ed68fd156d5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 11 Jun 2021 13:49:06 +0200 Subject: add patch for PHP 8.1 (send upstream by email) --- event-php81.patch | 30 ++++++++++++++++++++++++++++++ php-pecl-event.spec | 12 +++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 event-php81.patch diff --git a/event-php81.patch b/event-php81.patch new file mode 100644 index 0000000..f4144a1 --- /dev/null +++ b/event-php81.patch @@ -0,0 +1,30 @@ +From d4bf4d70181dea17985af1bd52748b0f678a4b8c Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 11 Jun 2021 12:56:43 +0200 +Subject: [PATCH] Fix deprecated: strlen(): Passing null to parameter... + +--- + tests/29-buffer-pullup.phpt | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/tests/29-buffer-pullup.phpt b/tests/29-buffer-pullup.phpt +index b62b440..32bae4a 100644 +--- a/tests/29-buffer-pullup.phpt ++++ b/tests/29-buffer-pullup.phpt +@@ -14,7 +14,12 @@ foreach ($a as $s) { + $b = new $eventBuffereClass(); + $b->add($s); + $s_pullup = $b->pullup(-1); +- var_dump(strlen($s_pullup) == strlen($s) && $s_pullup == $s); ++ if (is_null($s_pullup)) { ++ // pullup return null when no data availble+ ++ var_dump(empty($s)); ++ } else { ++ var_dump(strlen($s_pullup) == strlen($s) && $s_pullup == $s); ++ } + } + ?> + --EXPECT-- +-- +2.31.1 + diff --git a/php-pecl-event.spec b/php-pecl-event.spec index fbbe229..e1f50bc 100644 --- a/php-pecl-event.spec +++ b/php-pecl-event.spec @@ -38,11 +38,13 @@ Summary: Provides interface to libevent library Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}%{?upstream_postver:+%{upstream_postver}} -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;')}} License: PHP URL: https://pecl.php.net/package/event Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}%{?upstream_postver}.tgz +Patch0: %{pecl_name}-php81.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel @@ -80,6 +82,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 @@ -108,6 +113,8 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{upstream_version}%{?upstream_prever}%{?upstream_postver} NTS cd NTS +%patch0 -p1 + # Sanity check, really often broken DIR=$(%{__php} -r 'echo "php" . PHP_MAJOR_VERSION;') sed -e '/PHP_EVENT_VERSION/s/2.4.2/2.4.3/' -i $DIR/php_event.h @@ -262,6 +269,9 @@ fi %changelog +* Fri Jun 11 2021 Remi Collet - 3.0.4-2 +- add patch for PHP 8.1 (send upstream by email) + * Tue Apr 20 2021 Remi Collet - 3.0.4-1 - update to 3.0.4 -- cgit