From 5cedd79a568566e79f0667d47960c614ed59a50a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 3 Dec 2024 10:15:50 +0100 Subject: [PATCH] update to 3.3.1 for PHP 8.3 Related: RHELPLAN-170960 --- .gitignore | 1 + php-pecl-xdebug3.spec | 49 ++++++++++++++++++++++++++--------------- sources | 2 +- xdebug-deprecated.patch | 28 ----------------------- 4 files changed, 33 insertions(+), 47 deletions(-) delete mode 100644 xdebug-deprecated.patch diff --git a/.gitignore b/.gitignore index ade111f..b233156 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /xdebug-3.1.4-d7f4cdf.tar.gz /xdebug-3.2.2-a909eb0.tar.gz +/xdebug-3.3.1-1943c47.tar.gz diff --git a/php-pecl-xdebug3.spec b/php-pecl-xdebug3.spec index 53c6094..c27e4a7 100644 --- a/php-pecl-xdebug3.spec +++ b/php-pecl-xdebug3.spec @@ -11,18 +11,13 @@ %bcond_without tests -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build - %global pecl_name xdebug %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}) # version/release -%global upstream_version 3.2.2 -#global upstream_prever RC1 -#global upstream_lower rc1 +%global upstream_version 3.3.1 # XDebug should be loaded after opcache %global ini_name 15-%{pecl_name}.ini @@ -30,11 +25,9 @@ Name: php-pecl-xdebug3 Summary: Provides functions for function traces and profiling 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 -Patch0: %{pecl_name}-deprecated.patch - License: Xdebug-1.03 URL: https://xdebug.org/ @@ -45,6 +38,7 @@ BuildRequires: php-pear BuildRequires: php-simplexml BuildRequires: libtool BuildRequires: php-soap +BuildRequires: pkgconfig(zlib) >= 1.2.9 Requires: php(zend-abi) = %{php_zend_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 cd NTS -%patch -P0 -p1 -b .deprecated - # Check extension version ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h) if test "$ver" != "%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then @@ -103,15 +95,16 @@ cd .. cp -pr NTS ZTS %endif -cat << 'EOF' | tee %{ini_name} +cat << 'EOF' >%{ini_name} ; Enable xdebug extension module zend_extension=%{pecl_name}.so ; Configuration ; See https://xdebug.org/docs/all_settings - 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 @@ -119,6 +112,7 @@ cd NTS %{_bindir}/phpize %configure \ --enable-xdebug \ + --with-xdebug-compression \ --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} @@ -127,6 +121,7 @@ cd ../ZTS %{_bindir}/zts-phpize %configure \ --enable-xdebug \ + --with-xdebug-compression \ --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} %endif @@ -166,11 +161,26 @@ for mod in simplexml; do fi done -# only check if build extension can be loaded -%{_bindir}/php \ +: check if NTS extension can be loaded +%{__php} \ --no-php-ini \ --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} %{_bindir}/zts-php \ @@ -219,6 +229,9 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Tue Dec 3 2024 Remi Collet - 3.3.1-1 +- update to 3.3.1 for PHP 8.3 + * Wed Nov 29 2023 Remi Collet - 3.2.2-2 - drop inet_ntoa usage using upstream patch diff --git a/sources b/sources index 396460d..dc1326c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (xdebug-3.2.2-a909eb0.tar.gz) = 4189405250d343a644f2dc874979724f632bf016f729219d3b6460938953ffa3a87d00ec3ecb1800ca861c47084304591b0f93ad94c943b0f893d9272dfdf4f5 +SHA512 (xdebug-3.3.1-1943c47.tar.gz) = 98d3e3fba14df2301bf13b27e973e14321074faad38d963e3a6108e6b2b9c727004a93a8986be46e6de4ab86579da963175179266666a5de6119dabe73348c30 diff --git a/xdebug-deprecated.patch b/xdebug-deprecated.patch deleted file mode 100644 index 82dd3d1..0000000 --- a/xdebug-deprecated.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aa79e6e4eff65e722ef66ab61cb6aa20805a7dec Mon Sep 17 00:00:00 2001 -From: Remi Collet -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;