diff options
-rw-r--r-- | 57.patch | 46 | ||||
-rw-r--r-- | php-pecl-gnupg.spec | 12 |
2 files changed, 57 insertions, 1 deletions
diff --git a/57.patch b/57.patch new file mode 100644 index 0000000..7f033ae --- /dev/null +++ b/57.patch @@ -0,0 +1,46 @@ +From 3f159064025dbde3aa0a4004cc4777a8032092b0 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 17 Jul 2025 14:50:00 +0200 +Subject: [PATCH] use zend_ce_exception instead of zend_exception_get_default() + for 8.5 + +--- + gnupg.c | 4 ++-- + gnupg_keylistiterator.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gnupg.c b/gnupg.c +index 2693539..475d16e 100644 +--- a/gnupg.c ++++ b/gnupg.c +@@ -64,7 +64,7 @@ PHPC_OBJ_DEFINE_HANDLER_VAR(gnupg); + break; \ + case 2: \ + zend_throw_exception(\ +- zend_exception_get_default(TSRMLS_C), \ ++ zend_ce_exception, \ + (char*) error, \ + 0 TSRMLS_CC \ + ); \ +@@ -169,7 +169,7 @@ static void php_gnupg_this_make(PHPC_THIS_DECLARE(gnupg), zval *options TSRMLS_D + if (gpgme_ctx_set_engine_info( + ctx, GPGME_PROTOCOL_OpenPGP, file_name, home_dir) != GPG_ERR_NO_ERROR) { + zend_throw_exception( +- zend_exception_get_default(TSRMLS_C), ++ zend_ce_exception, + (char*) "Setting engine info failed", + 0 TSRMLS_CC + ); +diff --git a/gnupg_keylistiterator.c b/gnupg_keylistiterator.c +index 9b285ee..020e941 100644 +--- a/gnupg_keylistiterator.c ++++ b/gnupg_keylistiterator.c +@@ -201,7 +201,7 @@ PHP_METHOD(gnupg_keylistiterator, rewind) + + if ((PHPC_THIS->err = gpgme_op_keylist_start( + PHPC_THIS->ctx, PHPC_THIS->pattern ? PHPC_THIS->pattern : "", 0)) != GPG_ERR_NO_ERROR){ +- zend_throw_exception(zend_exception_get_default(TSRMLS_C), (char *)gpg_strerror(PHPC_THIS->err), 1 TSRMLS_CC); ++ zend_throw_exception(zend_ce_exception, (char *)gpg_strerror(PHPC_THIS->err), 1 TSRMLS_CC); + } + if ((PHPC_THIS->err = gpgme_op_keylist_next(PHPC_THIS->ctx, &PHPC_THIS->gpgkey)) != GPG_ERR_NO_ERROR){ + RETURN_FALSE; diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec index 40af0a0..fb93bf2 100644 --- a/php-pecl-gnupg.spec +++ b/php-pecl-gnupg.spec @@ -33,12 +33,14 @@ Summary: Wrapper around the gpgme library Name: %{?scl_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-2-Clause URL: https://pecl.php.net/package/gnupg Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Patch0: 57.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel @@ -82,6 +84,10 @@ extension=%{pecl_name}.so EOF cd %{sources} +%if "%{php_version}" > "7.0" +%patch -P0 -p1 +%endif + # 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 @@ -198,6 +204,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Thu Jul 17 2025 Remi Collet <remi@remirepo.net> - 1.5.3-2 +- add fix for PHP 8.5.0alpha2 using patch from + https://github.com/php-gnupg/php-gnupg/pull/57 + * Tue Jun 3 2025 Remi Collet <remi@remirepo.net> - 1.5.3-1 - update to 1.5.3 - drop patch merged upstream |