update to 3.3.1 for PHP 8.3

Related: RHELPLAN-170960
This commit is contained in:
Remi Collet 2024-12-03 10:15:50 +01:00
parent 01319b2faf
commit 5cedd79a56
4 changed files with 33 additions and 47 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/xdebug-3.1.4-d7f4cdf.tar.gz /xdebug-3.1.4-d7f4cdf.tar.gz
/xdebug-3.2.2-a909eb0.tar.gz /xdebug-3.2.2-a909eb0.tar.gz
/xdebug-3.3.1-1943c47.tar.gz

View File

@ -11,18 +11,13 @@
%bcond_without tests %bcond_without tests
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
%global pecl_name xdebug %global pecl_name xdebug
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global gh_commit a909eb088ad9fd8c8e09fcc71d892fa54b957b31 %global gh_commit 1943c479139008da3f9d26a4e2a6005e75c5ab34
%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_short %(c=%{gh_commit}; echo ${c:0:7})
# version/release # version/release
%global upstream_version 3.2.2 %global upstream_version 3.3.1
#global upstream_prever RC1
#global upstream_lower rc1
# XDebug should be loaded after opcache # XDebug should be loaded after opcache
%global ini_name 15-%{pecl_name}.ini %global ini_name 15-%{pecl_name}.ini
@ -30,11 +25,9 @@
Name: php-pecl-xdebug3 Name: php-pecl-xdebug3
Summary: Provides functions for function traces and profiling Summary: Provides functions for function traces and profiling
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}} Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
Release: 2%{?dist} Release: 1%{?dist}
Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{gh_commit}/%{pecl_name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{gh_commit}/%{pecl_name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
Patch0: %{pecl_name}-deprecated.patch
License: Xdebug-1.03 License: Xdebug-1.03
URL: https://xdebug.org/ URL: https://xdebug.org/
@ -45,6 +38,7 @@ BuildRequires: php-pear
BuildRequires: php-simplexml BuildRequires: php-simplexml
BuildRequires: libtool BuildRequires: libtool
BuildRequires: php-soap BuildRequires: php-soap
BuildRequires: pkgconfig(zlib) >= 1.2.9
Requires: php(zend-abi) = %{php_zend_api} Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api} Requires: php(api) = %{php_core_api}
@ -88,8 +82,6 @@ mv NTS/package.xml .
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
cd NTS cd NTS
%patch -P0 -p1 -b .deprecated
# Check extension version # Check extension version
ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h) ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h)
if test "$ver" != "%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then if test "$ver" != "%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then
@ -103,15 +95,16 @@ cd ..
cp -pr NTS ZTS cp -pr NTS ZTS
%endif %endif
cat << 'EOF' | tee %{ini_name} cat << 'EOF' >%{ini_name}
; Enable xdebug extension module ; Enable xdebug extension module
zend_extension=%{pecl_name}.so zend_extension=%{pecl_name}.so
; Configuration ; Configuration
; See https://xdebug.org/docs/all_settings ; See https://xdebug.org/docs/all_settings
EOF EOF
sed -e '1d' NTS/%{pecl_name}.ini >>%{ini_name} sed -e '1,2d' ZTS/%{pecl_name}.ini >>%{ini_name}
head -n15 <%{ini_name}
%build %build
@ -119,6 +112,7 @@ cd NTS
%{_bindir}/phpize %{_bindir}/phpize
%configure \ %configure \
--enable-xdebug \ --enable-xdebug \
--with-xdebug-compression \
--with-php-config=%{_bindir}/php-config --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags} make %{?_smp_mflags}
@ -127,6 +121,7 @@ cd ../ZTS
%{_bindir}/zts-phpize %{_bindir}/zts-phpize
%configure \ %configure \
--enable-xdebug \ --enable-xdebug \
--with-xdebug-compression \
--with-php-config=%{_bindir}/zts-php-config --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags} make %{?_smp_mflags}
%endif %endif
@ -166,11 +161,26 @@ for mod in simplexml; do
fi fi
done done
# only check if build extension can be loaded : check if NTS extension can be loaded
%{_bindir}/php \ %{__php} \
--no-php-ini \ --no-php-ini \
--define zend_extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --define zend_extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep Xdebug --modules | grep '^Xdebug$'
: check if provided config file is usable
%{__php} \
--no-php-ini \
-d extension_dir=%{buildroot}%{php_extdir} \
-c %{buildroot}%{php_inidir}/%{ini_name} -v
%{__php} \
--no-php-ini \
-d extension_dir=%{buildroot}%{php_extdir} \
-c %{buildroot}%{php_inidir}/%{ini_name} -v 2>err.log \
| grep 'with Xdebug v%{upstream_version}%{?upstream_prever}'
if [ -s err.log ]; then
cat err.log
exit 1
fi
%if %{with_zts} %if %{with_zts}
%{_bindir}/zts-php \ %{_bindir}/zts-php \
@ -219,6 +229,9 @@ REPORT_EXIT_STATUS=1 \
%changelog %changelog
* Tue Dec 3 2024 Remi Collet <rcollet@redhat.com> - 3.3.1-1
- update to 3.3.1 for PHP 8.3
* Wed Nov 29 2023 Remi Collet <rcollet@redhat.com> - 3.2.2-2 * Wed Nov 29 2023 Remi Collet <rcollet@redhat.com> - 3.2.2-2
- drop inet_ntoa usage using upstream patch - drop inet_ntoa usage using upstream patch

View File

@ -1 +1 @@
SHA512 (xdebug-3.2.2-a909eb0.tar.gz) = 4189405250d343a644f2dc874979724f632bf016f729219d3b6460938953ffa3a87d00ec3ecb1800ca861c47084304591b0f93ad94c943b0f893d9272dfdf4f5 SHA512 (xdebug-3.3.1-1943c47.tar.gz) = 98d3e3fba14df2301bf13b27e973e14321074faad38d963e3a6108e6b2b9c727004a93a8986be46e6de4ab86579da963175179266666a5de6119dabe73348c30

View File

@ -1,28 +0,0 @@
From aa79e6e4eff65e722ef66ab61cb6aa20805a7dec Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 29 Nov 2023 08:59:52 +0100
Subject: [PATCH] Fixed issue #2217: Replace inet_ntoa with inet_ntop to
support IPv6 with xdebug://gateway
---
src/debugger/ip_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/debugger/ip_info.c b/src/debugger/ip_info.c
index 143fd722c..abe858c4a 100644
--- a/src/debugger/ip_info.c
+++ b/src/debugger/ip_info.c
@@ -222,11 +222,12 @@ char *xdebug_get_gateway_ip(void)
{
in_addr_t addr = 0;
char iface[IF_NAMESIZE];
+ char addrbuf[INET6_ADDRSTRLEN];
memset(iface, 0, sizeof(iface));
if (get_gateway_and_iface(&addr, iface)) {
- return xdstrdup(inet_ntoa(*(struct in_addr *) &addr));
+ return xdstrdup(inet_ntop(AF_INET, &addr, addrbuf, sizeof(addrbuf)));
}
return NULL;