summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-Fix-iterator-prototypes-for-PHP-8.1.patch62
-rw-r--r--php-pecl-gnupg.spec13
2 files changed, 74 insertions, 1 deletions
diff --git a/0001-Fix-iterator-prototypes-for-PHP-8.1.patch b/0001-Fix-iterator-prototypes-for-PHP-8.1.patch
new file mode 100644
index 0000000..f566a09
--- /dev/null
+++ b/0001-Fix-iterator-prototypes-for-PHP-8.1.patch
@@ -0,0 +1,62 @@
+From 0e35e0bbf81cdbb5346fcdc0a52e022b55075e58 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 9 Sep 2021 11:59:22 +0200
+Subject: [PATCH] Fix iterator prototypes for PHP 8.1
+
+---
+ gnupg_keylistiterator.c | 36 +++++++++++++++++++++++++++++++-----
+ 1 file changed, 31 insertions(+), 5 deletions(-)
+
+diff --git a/gnupg_keylistiterator.c b/gnupg_keylistiterator.c
+index 215aaa0..7390edd 100644
+--- a/gnupg_keylistiterator.c
++++ b/gnupg_keylistiterator.c
+@@ -90,14 +90,40 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gnupg_void_iterator_method, 0, 0, 0)
+ ZEND_END_ARG_INFO()
+ /* }}} */
+
++#if PHP_VERSION_ID < 80100
++
++#define arginfo_gnupg_current arginfo_gnupg_void_iterator_method
++#define arginfo_gnupg_key arginfo_gnupg_void_iterator_method
++#define arginfo_gnupg_valid arginfo_gnupg_void_iterator_method
++#define arginfo_gnupg_next arginfo_gnupg_void_iterator_method
++#define arginfo_gnupg_rewind arginfo_gnupg_void_iterator_method
++
++#else
++
++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_current, 0, 0, IS_MIXED, 0)
++ZEND_END_ARG_INFO()
++
++#define arginfo_gnupg_key arginfo_gnupg_current
++
++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_valid, 0, 0, _IS_BOOL, 0)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_next, 0, 0, IS_VOID, 0)
++ZEND_END_ARG_INFO()
++
++#define arginfo_gnupg_rewind arginfo_gnupg_next
++
++#endif
++
++
+ /* {{{ method list gnupg_keylistiterator */
+ static zend_function_entry gnupg_keylistiterator_methods[] = {
+ PHP_ME(gnupg_keylistiterator, __construct, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
+- PHP_ME(gnupg_keylistiterator, current, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
+- PHP_ME(gnupg_keylistiterator, key, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
+- PHP_ME(gnupg_keylistiterator, next, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
+- PHP_ME(gnupg_keylistiterator, rewind, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
+- PHP_ME(gnupg_keylistiterator, valid, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC)
++ PHP_ME(gnupg_keylistiterator, current, arginfo_gnupg_current, ZEND_ACC_PUBLIC)
++ PHP_ME(gnupg_keylistiterator, key, arginfo_gnupg_key, ZEND_ACC_PUBLIC)
++ PHP_ME(gnupg_keylistiterator, next, arginfo_gnupg_next, ZEND_ACC_PUBLIC)
++ PHP_ME(gnupg_keylistiterator, rewind, arginfo_gnupg_rewind, ZEND_ACC_PUBLIC)
++ PHP_ME(gnupg_keylistiterator, valid, arginfo_gnupg_valid, ZEND_ACC_PUBLIC)
+ PHPC_FE_END
+ };
+ /* }}} */
+--
+2.31.1
+
diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec
index cd2eed0..2db4bbf 100644
--- a/php-pecl-gnupg.spec
+++ b/php-pecl-gnupg.spec
@@ -25,12 +25,14 @@
Summary: Wrapper around the gpgme library
Name: %{?sub_prefix}php-pecl-gnupg
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: BSD
URL: https://pecl.php.net/package/gnupg
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Patch0: 0001-Fix-iterator-prototypes-for-PHP-8.1.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -72,6 +74,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
@@ -99,6 +104,8 @@ EOF
mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
cd NTS
+%patch0 -p1 -b .php81
+
# Check extension version
extver=$(sed -n '/#define PHP_GNUPG_VERSION/{s/.* "//;s/".*$//;p}' php_gnupg.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -235,6 +242,10 @@ cd ../ZTS
%changelog
+* Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 1.5.0-2
+- add patch for PHP 8.1 from
+ https://github.com/php-gnupg/php-gnupg/pull/35
+
* Mon Apr 12 2021 Remi Collet <remi@remirepo.net> - 1.5.0-1
- Update to 1.5.0