[packages/php/PHP_8_0] upstream patch to fix build with icu >= 74

atler atler at pld-linux.org
Wed Jan 22 22:38:05 CET 2025


commit 8444eb505a8f2a5661a198b335c189196f69eabb
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jan 22 22:07:39 2025 +0100

    upstream patch to fix build with icu >= 74

 icu74.patch | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php.spec    | 72 ++++++++++++++++++++++++++++++-----------------------------
 2 files changed, 111 insertions(+), 35 deletions(-)
---
diff --git a/php.spec b/php.spec
index c1cda31..39bd668 100644
--- a/php.spec
+++ b/php.spec
@@ -204,6 +204,7 @@ Patch68:	php-mysql-ssl-context.patch
 Patch71:	libdb-info.patch
 Patch72:	openssl.patch
 Patch73:	missing-includes.patch
+Patch74:	icu74.patch
 URL:		https://www.php.net/
 %{?with_pdo_firebird:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -1866,42 +1867,43 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 %setup -q -n %{orgname}-%{version}%{?subver}
 
 cp -p php.ini-production php.ini
-%patch0 -p1
-%patch1 -p1
-#%patch2 -p1 -b .mail
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1 -b .sapi-ini-file
-%patch9 -p1
-%patch10 -p1 -b .ini
-%patch14 -p1
-%patch18 -p1
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch24 -p1 -b .zlib-for-getimagesize
-%patch25 -p1
-%patch27 -p1
-%patch29 -p1
-%patch31 -p1
-%patch39 -p1 -b .use-prog_sendmail
-%patch41 -p1
-%patch43 -p1
-%patch44 -p1
-%patch50 -p1
-%patch53 -p1
-%patch59 -p1 -b .systzdata
+%patch -P0 -p1
+%patch -P1 -p1
+#%patch -P2 -p1 -b .mail
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1 -b .sapi-ini-file
+%patch -P9 -p1
+%patch -P10 -p1 -b .ini
+%patch -P14 -p1
+%patch -P18 -p1
+%patch -P21 -p1
+%patch -P22 -p1
+%patch -P23 -p1
+%patch -P24 -p1 -b .zlib-for-getimagesize
+%patch -P25 -p1
+%patch -P27 -p1
+%patch -P29 -p1
+%patch -P31 -p1
+%patch -P39 -p1 -b .use-prog_sendmail
+%patch -P41 -p1
+%patch -P43 -p1
+%patch -P44 -p1
+%patch -P50 -p1
+%patch -P53 -p1
+%patch -P59 -p1 -b .systzdata
 %if %{with instantclient}
-%patch60 -p1 -b .instantclient
-%endif
-%patch66 -p1
-%patch67 -p1 -b .mysql-lib-ver-mismatch
-#%patch68 -p1 DROP or update to 7.0 APIs
-%patch71 -p1 -b .libdb-info
-%patch72 -p1
-%patch73 -p1
+%patch -P60 -p1 -b .instantclient
+%endif
+%patch -P66 -p1
+%patch -P67 -p1 -b .mysql-lib-ver-mismatch
+#%patch -P68 -p1 DROP or update to 7.0 APIs
+%patch -P71 -p1 -b .libdb-info
+%patch -P72 -p1
+%patch -P73 -p1
+%patch -P74 -p1
 
 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
       ext/ext_skel.php \
diff --git a/icu74.patch b/icu74.patch
new file mode 100644
index 0000000..01f5e88
--- /dev/null
+++ b/icu74.patch
@@ -0,0 +1,74 @@
+From cc46a4e6b5a413bab3e264c1dcaaf7052f54fbc4 Mon Sep 17 00:00:00 2001
+From: David Carlier <devnexen at gmail.com>
+Date: Sat, 17 Feb 2024 21:38:21 +0000
+Subject: [PATCH] ext/intl: level up c++ runtime std for icu 74 and onwards.
+
+to align with what is required to build icu 74 itself.
+
+Close GH-14002
+---
+ NEWS               |  3 +++
+ ext/intl/config.m4 | 11 ++++++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
+index dd687bcd97de3..48f5147ca7bbf 100644
+--- a/ext/intl/config.m4
++++ b/ext/intl/config.m4
+@@ -80,7 +80,16 @@ if test "$PHP_INTL" != "no"; then
+     breakiterator/codepointiterator_methods.cpp"
+ 
+   PHP_REQUIRE_CXX()
+-  PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
++
++  AC_MSG_CHECKING([if intl requires -std=gnu++17])
++  AS_IF([test "$PKG_CONFIG icu-uc --atleast-version=74"],[
++    AC_MSG_RESULT([yes])
++    PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
++  ],[
++    AC_MSG_RESULT([no])
++    PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
++  ])
++
+   PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS"
+   case $host_alias in
+   *cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L"
+From 4e21a26db24cfeb0c8a3ba43dba2d7d5599d2ee5 Mon Sep 17 00:00:00 2001
+From: Calvin Buckley <calvin at cmpct.info>
+Date: Fri, 10 May 2024 14:20:17 -0300
+Subject: [PATCH] Fix check for newer versions of ICU (#14186)
+
+* Fix check for newer versions of ICU
+
+The previous test would always trigger, even if the version of ICU
+installed didn't require C++17. This was because it incorrectly used
+the `test` program, which broke the build on systems without a C++17
+compiler.
+
+Tested with macOS 14 and i 7.2.
+
+* Fix broken ICU version check for definition
+
+Same as the previous fix for C++17.
+
+---------
+
+Co-authored-by: Peter Kokot <peterkokot at gmail.com>
+---
+ build/php.m4       | 5 ++---
+ ext/intl/config.m4 | 2 +-
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
+index 48f5147ca7bbf..78396dc416926 100644
+--- a/ext/intl/config.m4
++++ b/ext/intl/config.m4
+@@ -82,7 +82,7 @@ if test "$PHP_INTL" != "no"; then
+   PHP_REQUIRE_CXX()
+ 
+   AC_MSG_CHECKING([if intl requires -std=gnu++17])
+-  AS_IF([test "$PKG_CONFIG icu-uc --atleast-version=74"],[
++  AS_IF([$PKG_CONFIG icu-uc --atleast-version=74],[
+     AC_MSG_RESULT([yes])
+     PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
+   ],[
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/8444eb505a8f2a5661a198b335c189196f69eabb



More information about the pld-cvs-commit mailing list