summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-fix-incompatible-pointer-type.patch39
-rw-r--r--0001-ignore-deprecated.patch33
-rw-r--r--PHPINFO8
-rw-r--r--REFLECTION18
-rw-r--r--pecl_http-build.patch22
-rw-r--r--pecl_http-php84.patch100
-rw-r--r--php-pecl-http.spec82
7 files changed, 121 insertions, 181 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-ignore-deprecated.patch b/0001-ignore-deprecated.patch
new file mode 100644
index 0000000..5f3b5d5
--- /dev/null
+++ b/0001-ignore-deprecated.patch
@@ -0,0 +1,33 @@
+From fd752f8aab924b4edf834e57fdcbe34375b2e975 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 8 Jul 2025 15:27:59 +0200
+Subject: [PATCH] ignore deprecated
+
+---
+ tests/skipif.inc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/skipif.inc b/tests/skipif.inc
+index 76c3bd7..53a2753 100644
+--- a/tests/skipif.inc
++++ b/tests/skipif.inc
+@@ -8,14 +8,14 @@ function _ext($ext) {
+ }
+
+ function utf8locale() {
+- $locale = setlocale(LC_CTYPE, null);
++ $locale = @setlocale(LC_CTYPE, null);
+ if (stristr($locale, "utf") && substr($locale, -1) === "8") {
+ return true;
+ }
+ if (stristr(setlocale(LC_CTYPE, "C.UTF-8"), "utf")) {
+ return true;
+ }
+- $locale = setlocale(LC_CTYPE, null);
++ $locale = @setlocale(LC_CTYPE, null);
+ if (stristr($locale, "utf") && substr($locale, -1) === "8") {
+ return true;
+ }
+--
+2.50.0
+
diff --git a/PHPINFO b/PHPINFO
index b554302..1217d27 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -2,13 +2,13 @@
http
HTTP Support => enabled
-Extension Version => 4.2.4
+Extension Version => 4.2.6
Used Library => Compiled => Linked
-libz => 1.2.12 => 1.2.12
-libcurl => 7.85.0 => 7.85.0
+libz => 1.2.13 => 1.2.13
+libcurl => 8.2.1 => 8.2.1
libevent => 2.1.12-stable => 2.1.12-stable
-libicu (IDNA2008/IDNA2003) => 72.1 => 72.1
+libicu (IDNA2008/IDNA2003) => 74.2 => 74.2
libidn2 (IDNA2008) => disabled => disabled
libidn (IDNA2003) => disabled => disabled
libidnkit2 (IDNA2008) => disabled => disabled
diff --git a/REFLECTION b/REFLECTION
index 9c05ddb..7737c82 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #114 http version 4.2.4 ] {
+Extension [ <persistent> extension #116 http version 4.2.6 ] {
- Dependencies {
Dependency [ raphf (Required) ]
@@ -12,7 +12,7 @@ Extension [ <persistent> extension #114 http version 4.2.4 ] {
}
- Constants [90] {
- Constant [ int http\Client\Curl\FEATURES ] { 1371522973 }
+ Constant [ int http\Client\Curl\FEATURES ] { 1362036621 }
Constant [ int http\Client\Curl\Features\IPV6 ] { 1 }
Constant [ int http\Client\Curl\Features\KERBEROS4 ] { 2 }
Constant [ int http\Client\Curl\Features\SSL ] { 4 }
@@ -39,15 +39,15 @@ Extension [ <persistent> extension #114 http version 4.2.4 ] {
Constant [ int http\Client\Curl\Features\ZSTD ] { 67108864 }
Constant [ int http\Client\Curl\Features\UNICODE ] { 134217728 }
Constant [ int http\Client\Curl\Features\HSTS ] { 268435456 }
- Constant [ string http\Client\Curl\VERSIONS ] { libcurl/7.85.0 OpenSSL/3.0.9 zlib/1.2.12 brotli/1.0.9 libidn2/2.3.4 libpsl/0.21.1 (+libidn2/2.3.3) libssh/0.10.5/openssl/zlib nghttp2/1.51.0 }
- Constant [ string http\Client\Curl\Versions\CURL ] { 7.85.0 }
- Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/3.0.9 }
- Constant [ string http\Client\Curl\Versions\LIBZ ] { 1.2.12 }
+ Constant [ string http\Client\Curl\VERSIONS ] { libcurl/8.2.1 OpenSSL/3.1.4 zlib/1.2.13 libidn2/2.3.7 nghttp2/1.55.1 }
+ Constant [ string http\Client\Curl\Versions\CURL ] { 8.2.1 }
+ Constant [ string http\Client\Curl\Versions\SSL ] { OpenSSL/3.1.4 }
+ Constant [ string http\Client\Curl\Versions\LIBZ ] { 1.2.13 }
Constant [ null http\Client\Curl\Versions\ARES ] { }
- Constant [ string http\Client\Curl\Versions\IDN ] { 2.3.4 }
+ Constant [ string http\Client\Curl\Versions\IDN ] { 2.3.7 }
Constant [ null http\Client\Curl\Versions\ICONV ] { }
- Constant [ string http\Client\Curl\Versions\BROTLI ] { 1.0.9 }
- Constant [ string http\Client\Curl\Versions\NGHTTP2 ] { 1.51.0 }
+ Constant [ null http\Client\Curl\Versions\BROTLI ] { }
+ Constant [ string http\Client\Curl\Versions\NGHTTP2 ] { 1.55.1 }
Constant [ null http\Client\Curl\Versions\QUIC ] { }
Constant [ string http\Client\Curl\Versions\CAINFO ] { /etc/pki/tls/certs/ca-bundle.crt }
Constant [ null http\Client\Curl\Versions\CAPATH ] { }
diff --git a/pecl_http-build.patch b/pecl_http-build.patch
deleted file mode 100644
index 887a6ed..0000000
--- a/pecl_http-build.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 88e279db21e25244ecb6b804af0a6565db4ecbf1 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Mon, 29 Jan 2024 16:10:26 +0100
-Subject: [PATCH] Fix incompatible pointer types
-
----
- src/php_http_url.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/php_http_url.c b/src/php_http_url.c
-index 943a436c..459396f3 100644
---- a/src/php_http_url.c
-+++ b/src/php_http_url.c
-@@ -73,7 +73,7 @@ static inline char *localhostname(void)
- static php_http_url_t *php_http_url_from_env(void)
- {
- zval *https, *zhost, *zport;
-- long port;
-+ zend_long port;
- php_http_buffer_t buf;
-
- php_http_buffer_init_ex(&buf, MAX(PHP_HTTP_BUFFER_DEFAULT_SIZE, sizeof(php_http_url_t)<<2), PHP_HTTP_BUFFER_INIT_PREALLOC);
diff --git a/pecl_http-php84.patch b/pecl_http-php84.patch
deleted file mode 100644
index 93ca5b1..0000000
--- a/pecl_http-php84.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 74984d42a8b71fefc6f3400e0a569f778a0f101e Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Tue, 9 Jul 2024 15:33:05 +0200
-Subject: [PATCH 1/2] Fix header name for 8.4
-
----
- src/php_http_message_body.c | 4 ++++
- src/php_http_misc.c | 4 ++++
- 2 files changed, 8 insertions(+)
-
-diff --git a/src/php_http_message_body.c b/src/php_http_message_body.c
-index 8bde1a77..105e369c 100644
---- a/src/php_http_message_body.c
-+++ b/src/php_http_message_body.c
-@@ -12,7 +12,11 @@
-
- #include "php_http_api.h"
-
-+#if PHP_VERSION_ID < 80400
- #include "ext/standard/php_lcg.h"
-+#else
-+#include "ext/random/php_random.h"
-+#endif
-
- #define BOUNDARY_OPEN(body) \
- do {\
-diff --git a/src/php_http_misc.c b/src/php_http_misc.c
-index 261387f6..d5da37fd 100644
---- a/src/php_http_misc.c
-+++ b/src/php_http_misc.c
-@@ -12,7 +12,11 @@
-
- #include "php_http_api.h"
-
-+#if PHP_VERSION_ID < 80400
- #include "ext/standard/php_lcg.h"
-+#else
-+#include "ext/random/php_random.h"
-+#endif
- #include "zend_exceptions.h"
-
- /* SLEEP */
-
-From e0919d1756b661573a248c8b83705cd05094c0c8 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Tue, 9 Jul 2024 15:33:22 +0200
-Subject: [PATCH 2/2] Fix tests for 8.4
-
----
- tests/client002.phpt | 2 +-
- tests/client028.phpt | 2 +-
- tests/info002.phpt | 4 ++--
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/tests/client002.phpt b/tests/client002.phpt
-index d020f16e..8849ae94 100644
---- a/tests/client002.phpt
-+++ b/tests/client002.phpt
-@@ -15,7 +15,7 @@ echo "Test\n";
- class Observer implements SplObserver
- {
- #[ReturnTypeWillChange]
-- function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
-+ function update(SplSubject $client, ?http\Client\Request $request = null, ?StdClass $progress = null) {
- echo "P";
- /* fence against buggy infof() calls in some curl versions */
- $compare = $client->getProgressInfo($request);
-diff --git a/tests/client028.phpt b/tests/client028.phpt
-index f14fb8e5..58adc685 100644
---- a/tests/client028.phpt
-+++ b/tests/client028.phpt
-@@ -80,7 +80,7 @@ class UserHandler implements http\Client\Curl\User
- return count($this->client);
- }
-
-- function wait(int $timeout_ms = null) {
-+ function wait(?int $timeout_ms = null) {
- echo "W";
-
- if ($timeout_ms === null) {
-diff --git a/tests/info002.phpt b/tests/info002.phpt
-index 4d034403..44172b8d 100644
---- a/tests/info002.phpt
-+++ b/tests/info002.phpt
-@@ -37,13 +37,13 @@ Test
- http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\057' at pos 4 of 'HTTP/1.1 99 Apples in my Basket' in %sinfo002.php:%d
- Stack trace:
- #0 %sinfo002.php(%d): http\Message->__construct('HTTP/1.1 99 App...')
--#1 %sinfo002.php(%d): {closure}()
-+#1 %sinfo002.php(%d): {closur%s}()
- #2 %sinfo002.php(%d): trap(Object(Closure))
- #3 {main}
- http\Exception\BadMessageException: http\Message::__construct(): Failed to parse headers: unexpected character '\040' at pos 7 of 'CONNECT HTTP/1.1' in %sinfo002.php:%d
- Stack trace:
- #0 %sinfo002.php(%d): http\Message->__construct('CONNECT HTTP/1....')
--#1 %sinfo002.php(%d): {closure}()
-+#1 %sinfo002.php(%d): {closur%s}()
- #2 %sinfo002.php(%d): trap(Object(Closure))
- #3 {main}
- HTTP/1.1 200
diff --git a/php-pecl-http.spec b/php-pecl-http.spec
index 793b4c2..468d518 100644
--- a/php-pecl-http.spec
+++ b/php-pecl-http.spec
@@ -3,57 +3,42 @@
#
# 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
#
%if 0%{?scl:1}
-%scl_package php-pecl-http
+%scl_package php-pecl-http
%else
%global _root_prefix %{_prefix}
%endif
-%bcond_without libbrotli
+%bcond_without libbrotli
+%bcond_without tests
%global gh_commit a84b499418ee7b8992fd9e7e2abc661735a869bd
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner m6w6
%global gh_project ext-http
-#global gh_date 20150928
# The project is pecl_http but the extension is only http
-%global proj_name pecl_http
-%global pecl_name http
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global proj_name pecl_http
+%global pecl_name http
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
# after 40-raphf
-%global ini_name 50-%{pecl_name}.ini
-%ifarch %{arm}
-# Test suite disabled because of erratic results on slow ARM (timeout)
-%bcond_with tests
-%else
-%bcond_without tests
-%endif
+%global ini_name 50-%{pecl_name}.ini
-%global upstream_version 4.2.4
+%global upstream_version 4.2.6
#global upstream_prever beta1
#global upstream_lower beta1
-%if 0%{?gh_date:1}
-%global sources %{gh_project}-%{gh_commit}
-%else
%global sources %{proj_name}-%{upstream_version}%{?upstream_prever}
-%endif
%global _configure ../%{sources}/configure
Name: %{?scl_prefix}php-pecl-http
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
-%if 0%{?gh_date:1}
-Release: 0.10.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz
-%else
-Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?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
-%endif
Summary: Extended HTTP support
License: BSD-2-Clause
@@ -62,8 +47,8 @@ URL: https://pecl.php.net/package/pecl_http
# From http://www.php.net/manual/en/http.configuration.php
Source1: %{proj_name}.ini
-Patch0: %{proj_name}-build.patch
-Patch1: %{proj_name}-php84.patch
+Patch0: 0001-fix-incompatible-pointer-type.patch
+Patch1: 0001-ignore-deprecated.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -130,9 +115,6 @@ These are the files needed to compile programs using HTTP extension.
%prep
%setup -c -q
-%if 0%{?gh_date}
-mv NTS/package.xml .
-%endif
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
@@ -141,8 +123,8 @@ cd %{sources}
%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}%{?gh_date:dev}"; then
- : Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}%{?gh_date:dev}.
+if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
+ : Error: Upstream HTTP version is now ${extver}, expecting %{upstream_version}%{?upstream_prever}.
: Update the pdover macro and rebuild.
exit 1
fi
@@ -152,7 +134,6 @@ cp %{SOURCE1} %{ini_name}
mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
mkdir ZTS
%endif
@@ -184,22 +165,23 @@ grep IDNA config.h
cd %{sources}
%{__phpize}
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global
cd ../NTS
peclconf %{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
peclconf %{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# Install XML package description
install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
@@ -208,7 +190,7 @@ install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -271,13 +253,6 @@ TEST_PHP_ARGS="-n $modules -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
$modules \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
-
-%if %{with tests}
-: Upstream test suite ZTS extension
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n $modules -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
-%{__ztsphp} -n run-tests.php -q --show-diff
-%endif
%endif
@@ -303,6 +278,21 @@ TEST_PHP_ARGS="-n $modules -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
%changelog
+* Tue Jul 8 2025 Remi Collet <remi@fedoraproject.org> - 4.2.6-4
+- add patch for test suite with PHP 8.5 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
+
+* Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 4.2.4-6
+- add upstream patch for libcurl 8.9
+
* Tue Jul 9 2024 Remi Collet <remi@remirepo.net> - 4.2.4-5
- Fix build with PHP 8.4 using patch from
https://github.com/m6w6/ext-http/pull/135