From 7be14e8a2d638f53fc2f2084a9c61934a2a57993 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Oct 2024 12:17:35 +0200 Subject: fix PHP 8.4 build using patch from https://github.com/laruence/yaf/pull/594 --- 0001-remove-trailing-space.patch | 25 ++++++++++++++++++++++ 0002-relax-test-expectations-for-8.4.patch | 34 ++++++++++++++++++++++++++++++ php-pecl-yaf.spec | 30 ++++++++++++++------------ 3 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 0001-remove-trailing-space.patch create mode 100644 0002-relax-test-expectations-for-8.4.patch diff --git a/0001-remove-trailing-space.patch b/0001-remove-trailing-space.patch new file mode 100644 index 0000000..69f8efe --- /dev/null +++ b/0001-remove-trailing-space.patch @@ -0,0 +1,25 @@ +From 6553d00c0d103b1abe530c9dfdc2e37a6f8875f9 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 1 Oct 2024 12:00:16 +0200 +Subject: [PATCH] remove trailing space + +--- + config.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config.m4 b/config.m4 +index 73f8097..68f14fa 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -56,7 +56,7 @@ if test "$PHP_YAF" != "no"; then + routes/yaf_route_simple.c \ + routes/yaf_route_supervar.c \ + routes/yaf_route_regex.c \ +- routes/yaf_route_rewrite.c \ ++ routes/yaf_route_rewrite.c \ + routes/yaf_route_map.c \ + yaf_loader.c \ + yaf_registry.c \ +-- +2.46.2 + diff --git a/0002-relax-test-expectations-for-8.4.patch b/0002-relax-test-expectations-for-8.4.patch new file mode 100644 index 0000000..977d26d --- /dev/null +++ b/0002-relax-test-expectations-for-8.4.patch @@ -0,0 +1,34 @@ +From 5ddaa82f4c43eeac372b8c1ebe606ebff43829a8 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 1 Oct 2024 12:04:15 +0200 +Subject: [PATCH 2/2] relax test expectations for 8.4 + +--- + tests/038.phpt | 2 +- + tests/039.phpt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/038.phpt b/tests/038.phpt +index 0a28166..603a75e 100755 +--- a/tests/038.phpt ++++ b/tests/038.phpt +@@ -34,4 +34,4 @@ require "build.inc"; + shutdown(); + ?> + --EXPECTF-- +-Parse error: syntax error, unexpected %s}%c in %sfoo.phtml on line %d +\ No newline at end of file ++Parse error: syntax error, unexpected %s in %sfoo.phtml on line %d +diff --git a/tests/039.phpt b/tests/039.phpt +index bac421d..2564aa9 100755 +--- a/tests/039.phpt ++++ b/tests/039.phpt +@@ -45,4 +45,4 @@ require "build.inc"; + shutdown(); + ?> + --EXPECTF-- +-syntax error, unexpected %s}%c ++syntax error, unexpected %s +-- +2.46.2 + diff --git a/php-pecl-yaf.spec b/php-pecl-yaf.spec index 50109f8..3600747 100644 --- a/php-pecl-yaf.spec +++ b/php-pecl-yaf.spec @@ -24,13 +24,15 @@ Summary: Yet Another Framework Name: %{?scl_prefix}php-pecl-yaf Version: 3.3.6 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP-3.01 URL: https://pecl.php.net/package/yaf Source0: https://pecl.php.net/get/%{sources}%{?prever}.tgz Source1: %{pecl_name}.ini Patch0: %{pecl_name}-upstream.patch +Patch1: 0001-remove-trailing-space.patch +Patch2: 0002-relax-test-expectations-for-8.4.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -66,6 +68,8 @@ sed -e 's/role="test"/role="src"/' \ cd %{sources} %patch -P0 -p1 +%patch -P1 -p1 +%patch -P2 -p1 # Sanity check, really often broken extver=$(sed -n '/#define PHP_YAF_VERSION/{s/.*\t"//;s/".*$//;p}' php_yaf.h ) @@ -84,17 +88,21 @@ mkdir ZTS %build %{?dtsenable} +export CFLAGS="%{optflags} -Wno-duplicate-decl-specifier" + cd %{sources} %{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS %configure --with-php-config=%{__phpconfig} -make %{?_smp_mflags} +%make_build %if %{with_zts} cd ../ZTS %configure --with-php-config=%{__ztsphpconfig} -make %{?_smp_mflags} +%make_build %endif @@ -102,12 +110,12 @@ make %{?_smp_mflags} %{?dtsenable} # Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/%{ini_name} # Install the ZTS stuff %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -145,14 +153,6 @@ REPORT_EXIT_STATUS=1 \ %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' - -%if %{with tests} -: Upstream test suite for NTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="$OPTS -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php -q --show-diff -%endif %endif @@ -171,6 +171,10 @@ REPORT_EXIT_STATUS=1 \ %changelog +* Tue Oct 1 2024 Remi Collet - 3.3.6-3 +- fix PHP 8.4 build using patch from + https://github.com/laruence/yaf/pull/594 + * Wed Jul 10 2024 Remi Collet - 3.3.6-2 - add upstream patch for PHP 8.4 -- cgit