summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-09-09 14:26:00 +0200
committerRemi Collet <remi@php.net>2022-09-09 14:26:00 +0200
commit49bb467d1ddc7c1b86fd76543973ed9b5bd1ef61 (patch)
tree0d109d2b7d999d3701e0c8228a3075a813afa134
parentdf65afac4eea4fa632c4f8d38f9a105b8f057439 (diff)
add patch for PHP 8.2 from
https://github.com/php/pecl-web_services-oauth/pull/24
-rw-r--r--oauth-php82.patch85
-rw-r--r--php-pecl-oauth.spec27
2 files changed, 99 insertions, 13 deletions
diff --git a/oauth-php82.patch b/oauth-php82.patch
new file mode 100644
index 0000000..ad8eb4a
--- /dev/null
+++ b/oauth-php82.patch
@@ -0,0 +1,85 @@
+From 66e8e9cf9805c96dd9aa6a7c08ec0da5c2c6b656 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Fri, 9 Sep 2022 14:03:57 +0200
+Subject: [PATCH] fix for php 8.2: declare used properties
+
+---
+ oauth.c | 1 +
+ provider.c | 13 +++++++++++++
+ tests/oauthprovider_001.phpt | 12 ++++++++----
+ 3 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/oauth.c b/oauth.c
+index f845893..46eccda 100644
+--- a/oauth.c
++++ b/oauth.c
+@@ -2781,6 +2781,7 @@ PHP_MINIT_FUNCTION(oauth)
+ soo_exception_ce = zend_register_internal_class_ex(&soo_ex_ce, zend_exception_get_default());
+ zend_declare_property_null(soo_exception_ce, "lastResponse", sizeof("lastResponse")-1, ZEND_ACC_PUBLIC);
+ zend_declare_property_null(soo_exception_ce, "debugInfo", sizeof("debugInfo")-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(soo_exception_ce, "additionalInfo", sizeof("additionalInfo")-1, ZEND_ACC_PUBLIC);
+
+ REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA1", OAUTH_SIG_METHOD_HMACSHA1, CONST_CS | CONST_PERSISTENT);
+ REGISTER_STRING_CONSTANT("OAUTH_SIG_METHOD_HMACSHA256", OAUTH_SIG_METHOD_HMACSHA256, CONST_CS | CONST_PERSISTENT);
+diff --git a/provider.c b/provider.c
+index 45880fb..43f2bc0 100644
+--- a/provider.c
++++ b/provider.c
+@@ -1184,6 +1184,19 @@ extern int oauth_provider_register_class(void) /* {{{ */
+ osce.create_object = oauth_provider_new;
+ oauthprovider = zend_register_internal_class(&osce);
+
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_KEY, sizeof(OAUTH_PROVIDER_CONSUMER_KEY)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CONSUMER_SECRET, sizeof(OAUTH_PROVIDER_CONSUMER_SECRET)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE, sizeof(OAUTH_PROVIDER_SIGNATURE)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_SIGNATURE_METHOD, sizeof(OAUTH_PROVIDER_SIGNATURE_METHOD)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN, sizeof(OAUTH_PROVIDER_TOKEN)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TOKEN_SECRET, sizeof(OAUTH_PROVIDER_TOKEN_SECRET)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_NONCE, sizeof(OAUTH_PROVIDER_NONCE)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_TIMESTAMP, sizeof(OAUTH_PROVIDER_TIMESTAMP)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERSION, sizeof(OAUTH_PROVIDER_VERSION)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_CALLBACK, sizeof(OAUTH_PROVIDER_CALLBACK)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, OAUTH_PROVIDER_VERIFIER, sizeof(OAUTH_PROVIDER_VERIFIER)-1, ZEND_ACC_PUBLIC);
++ zend_declare_property_null(oauthprovider, "request_token_endpoint", sizeof("request_token_endpoint")-1, ZEND_ACC_PUBLIC);
++
+ memcpy(&oauth_provider_obj_hndlrs, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ oauth_provider_obj_hndlrs.offset = XtOffsetOf(php_oauth_provider, zo);
+ oauth_provider_obj_hndlrs.free_obj = oauth_provider_free_storage;
+diff --git a/tests/oauthprovider_001.phpt b/tests/oauthprovider_001.phpt
+index e93af65..ab005c4 100644
+--- a/tests/oauthprovider_001.phpt
++++ b/tests/oauthprovider_001.phpt
+@@ -6,25 +6,29 @@ $provider = new OAuthProvider(['foo' => 'bar']);
+ var_dump($provider);
+
+ --EXPECT--
+-object(OAuthProvider)#1 (10) {
++object(OAuthProvider)#1 (12) {
+ ["consumer_key"]=>
+ NULL
+ ["consumer_secret"]=>
+ NULL
+- ["nonce"]=>
++ ["signature"]=>
++ NULL
++ ["signature_method"]=>
+ NULL
+ ["token"]=>
+ NULL
+ ["token_secret"]=>
+ NULL
++ ["nonce"]=>
++ NULL
+ ["timestamp"]=>
+ NULL
+ ["version"]=>
+ NULL
+- ["signature_method"]=>
+- NULL
+ ["callback"]=>
+ NULL
++ ["verifier"]=>
++ NULL
+ ["request_token_endpoint"]=>
+ bool(false)
+ }
diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec
index d9adb19..dc31488 100644
--- a/php-pecl-oauth.spec
+++ b/php-pecl-oauth.spec
@@ -12,7 +12,6 @@
%bcond_without tests
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
%scl_package php-pecl-oauth
%endif
@@ -20,14 +19,17 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
-Name: %{?sub_prefix}php-pecl-oauth
+Name: %{?scl_prefix}php-pecl-oauth
Version: 2.0.7
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: PHP OAuth consumer extension
License: BSD
URL: https://pecl.php.net/package/oauth
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Patch0: %{pecl_name}-php82.patch
+
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7
BuildRequires: %{?scl_prefix}php-pear
@@ -43,10 +45,6 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
@@ -70,12 +68,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version}
%endif
%endif
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
-
%description
OAuth is an authorization protocol built on top of HTTP which allows
@@ -98,6 +90,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .pr24
+
#sed -e '/PHP_OAUTH_VERSION/s/2.0.3-dev/2.0.3/' -i php_oauth.h
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h)
@@ -217,6 +211,13 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Sep 9 2022 Remi Collet <remi@remirepo.net> - 2.0.7-6
+- add patch for PHP 8.2 from
+ https://github.com/php/pecl-web_services-oauth/pull/24
+
+* Mon Sep 6 2021 Remi Collet <remi@remirepo.net> - 2.0.7-5
+- re-build
+
* Wed Sep 30 2020 Remi Collet <remi@remirepo.net> - 2.0.7-2
- rebuild for PHP 8.0.0RC1