From 5d6d40da80fa10d077dc91780d1c50a7d059cd07 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Nov 03 2021 11:24:35 +0000 Subject: rebuild for https://fedoraproject.org/wiki/Changes/php81 add patch for PHP 8.1 from https://github.com/zeromq/php-zmq/pull/222 --- diff --git a/222.patch b/222.patch new file mode 100644 index 0000000..b19a86e --- /dev/null +++ b/222.patch @@ -0,0 +1,52 @@ +From 9af012efcfb256dd96b72ea8d1ac1b8498903118 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 3 Nov 2021 12:10:19 +0100 +Subject: [PATCH] Fix for PHP 8.1 + +--- + tests/053-z85.phpt | 6 +++--- + zmq_pollset.c | 7 ++++++- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/tests/053-z85.phpt b/tests/053-z85.phpt +index f486815..549fa5f 100644 +--- a/tests/053-z85.phpt ++++ b/tests/053-z85.phpt +@@ -41,12 +41,12 @@ for ($i = 4; $i <= 256; $i += 4) { + + // Incorrect length + test_z85_encode('1234567', null); +-test_z85_encode(null, null); ++test_z85_encode('', null); + + test_z85_decode('1234567', null); +-test_z85_decode(null, null); ++test_z85_decode('', null); + + echo "OK"; + + --EXPECT-- +-OK +\ No newline at end of file ++OK +diff --git a/zmq_pollset.c b/zmq_pollset.c +index 3e4ed15..0bf1098 100644 +--- a/zmq_pollset.c ++++ b/zmq_pollset.c +@@ -169,10 +169,15 @@ static + zend_string *s_create_key(zval *entry) + { + if (Z_TYPE_P(entry) == IS_RESOURCE) { +- return strpprintf(0, "r:%d", Z_RES_P(entry)->handle); ++ /* zend_long since 8.1.0 */ ++ return strpprintf(0, "r:%ld", (long)Z_RES_P(entry)->handle); + } + else { ++#if PHP_VERSION_ID >= 80100 ++ zend_string *hash = php_spl_object_hash(Z_OBJ_P(entry)); ++#else + zend_string *hash = php_spl_object_hash(entry); ++#endif + zend_string *key = strpprintf(0, "o:%s", hash->val); + zend_string_release(hash); + return key; diff --git a/php-zmq.spec b/php-zmq.spec index 5fbbb1c..baff464 100644 --- a/php-zmq.spec +++ b/php-zmq.spec @@ -21,12 +21,13 @@ Summary: ZeroMQ messaging Name: php-%{pecl_name} Version: 1.1.3 -Release: 19%{?dist} +Release: 20%{?dist} License: BSD URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz Patch0: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/216.patch +Patch1: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/222.patch BuildRequires: make BuildRequires: gcc @@ -34,11 +35,6 @@ BuildRequires: php-devel > 5.2 BuildRequires: php-pear BuildRequires: zeromq-devel -%if 0%{?fedora} < 24 -Requires(post): %{__pecl} -Requires(postun): %{__pecl} -%endif - Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} @@ -64,6 +60,7 @@ mv %{pecl_name}-%{version} NTS cd NTS %patch0 -p1 -b .pr216 +%patch1 -p1 -b .pr222 cd .. %if %{with_zts} @@ -135,9 +132,8 @@ php --no-php-ini \ : upstream test suite for NTS extension export TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" export REPORT_EXIT_STATUS=1 -export NO_INTERACTION=1 export TEST_PHP_EXECUTABLE=%{_bindir}/php -%{_bindir}/php -n run-tests.php --show-diff +%{_bindir}/php -n run-tests.php -q --show-diff %endif %if %{with_zts} @@ -151,7 +147,7 @@ cd ../ZTS : upstream test suite for ZTS extension export TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" export TEST_PHP_EXECUTABLE=%{_bindir}/zts-php -%{_bindir}/zts-php -n run-tests.php --show-diff +%{_bindir}/zts-php -n run-tests.php -q --show-diff %endif %endif @@ -170,6 +166,10 @@ export TEST_PHP_EXECUTABLE=%{_bindir}/zts-php %changelog +* Wed Nov 3 2021 Remi Collet - 1.1.3-20 +- rebuild for https://fedoraproject.org/wiki/Changes/php81 +- add patch for PHP 8.1 from https://github.com/zeromq/php-zmq/pull/222 + * Tue Jul 27 2021 Fedora Release Engineering - 1.1.3-19 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild