diff options
-rw-r--r-- | 0001-fix-incompatible-pointer-type.patch | 39 | ||||
-rw-r--r-- | 0001-return-string-in-output-handler.patch | 31 | ||||
-rw-r--r-- | php-pecl-http.spec | 33 |
3 files changed, 99 insertions, 4 deletions
diff --git a/0001-fix-incompatible-pointer-type.patch b/0001-fix-incompatible-pointer-type.patch new file mode 100644 index 0000000..f10cbb2 --- /dev/null +++ b/0001-fix-incompatible-pointer-type.patch @@ -0,0 +1,39 @@ +From aa9b18e49f2c4e9033e6f32bc6af9cb11c44d332 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 23 Jan 2025 07:41:55 +0100 +Subject: [PATCH] fix incompatible pointer type + +--- + src/php_http_client_curl.h | 2 +- + src/php_http_client_curl_event.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/php_http_client_curl.h b/src/php_http_client_curl.h +index 61723b9..42feff7 100644 +--- a/src/php_http_client_curl.h ++++ b/src/php_http_client_curl.h +@@ -25,7 +25,7 @@ typedef struct php_http_client_curl_handle { + } php_http_client_curl_handle_t; + + typedef struct php_http_client_curl_ops { +- void *(*init)(); ++ void *(*init)(php_http_client_t *client, void *user_data); + void (*dtor)(void **ctx_ptr); + ZEND_RESULT_CODE (*once)(void *ctx); + ZEND_RESULT_CODE (*wait)(void *ctx, struct timeval *custom_timeout); +diff --git a/src/php_http_client_curl_event.c b/src/php_http_client_curl_event.c +index 2e663ed..b532e11 100644 +--- a/src/php_http_client_curl_event.c ++++ b/src/php_http_client_curl_event.c +@@ -242,7 +242,7 @@ static ZEND_RESULT_CODE php_http_client_curl_event_exec(void *context) + return SUCCESS; + } + +-static void *php_http_client_curl_event_init(php_http_client_t *client) ++static void *php_http_client_curl_event_init(php_http_client_t *client, void *user_data) + { + php_http_client_curl_t *curl = client->ctx; + php_http_client_curl_event_context_t *ctx; +-- +2.48.1 + diff --git a/0001-return-string-in-output-handler.patch b/0001-return-string-in-output-handler.patch new file mode 100644 index 0000000..717e603 --- /dev/null +++ b/0001-return-string-in-output-handler.patch @@ -0,0 +1,31 @@ +From 36201dbbe628f2bc40cb1ed6c22f4486f3468b27 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 18 Jul 2025 07:19:36 +0200 +Subject: [PATCH] return string in output handler + +Returning a non-string result from user output handler is deprecated + +From https://wiki.php.net/rfc/deprecations_php_8_4 + + A return value of true is treated like a context reset, + which is identical to returning an empty string. +--- + src/php_http_env_response.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/php_http_env_response.c b/src/php_http_env_response.c +index 3dba5b9..b44c58d 100644 +--- a/src/php_http_env_response.c ++++ b/src/php_http_env_response.c +@@ -1165,7 +1165,7 @@ static PHP_METHOD(HttpEnvResponse, __invoke) + } else { + php_http_message_body_append(obj->message->body, ob_str, ob_len); + } +- RETURN_TRUE; ++ RETURN_EMPTY_STRING(); + } + } + +-- +2.50.1 + diff --git a/php-pecl-http.spec b/php-pecl-http.spec index ba7b312..f68c0fc 100644 --- a/php-pecl-http.spec +++ b/php-pecl-http.spec @@ -3,9 +3,9 @@ # # Fedora spec file for php-pecl-http # -# Copyright (c) 2012-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2012-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -37,7 +37,7 @@ Name: %{?scl_prefix}php-pecl-http Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} -Release: 1%{?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;')}} Source0: https://pecl.php.net/get/%{proj_name}-%{upstream_version}%{?upstream_prever}.tgz Summary: Extended HTTP support @@ -47,6 +47,9 @@ URL: https://pecl.php.net/package/pecl_http # From http://www.php.net/manual/en/http.configuration.php Source1: %{proj_name}.ini +Patch0: 0001-fix-incompatible-pointer-type.patch +Patch1: 0001-return-string-in-output-handler.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 8.0 @@ -116,6 +119,9 @@ These are the files needed to compile programs using HTTP extension. sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml cd %{sources} +%patch -P0 -p1 +%patch -P1 -p1 + extver=$(sed -n '/#define PHP_PECL_HTTP_VERSION/{s/.* "//;s/".*$//;p}' php_http.h) if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then : Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}. @@ -207,6 +213,8 @@ rm tests/client021.phpt rm tests/client022.phpt rm tests/client025.phpt rm tests/client027.phpt +# broken with 8.5.0alpha3 +rm tests/querystring001_a.phpt export REPORT_EXIT_STATUS=1 @@ -272,6 +280,23 @@ TEST_PHP_ARGS="-n $modules -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \ %changelog +* Wed Jul 30 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-6 +- ignore 1 test with PHP 8.5.0apha3 reported as + https://github.com/m6w6/ext-http/issues/150 + +* Fri Jul 18 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-5 +- add patch for test suite with PHP 8.5.0apha2 from + https://github.com/m6w6/ext-http/pull/149 + +* Tue Jul 8 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-4 +- add patch for test suite with PHP 8.5.0alpha1 from + https://github.com/m6w6/ext-http/pull/148 + +* Thu Jan 23 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-3 +- fix incompatible pointer type FTBFS #2341063 + using patch from https://github.com/m6w6/ext-http/pull/143 +- re-license spec file to CECILL-2.1 + * Wed Nov 6 2024 Remi Collet <remi@remirepo.net> - 4.2.6-1 - update to 4.2.6 |