]> TLD Linux GIT Repositories - packages/php.git/commitdiff
- fix build with icu >= 74 (from PLD) PHP_8_1
authorMarcin Krol <hawk@tld-linux.org>
Thu, 17 Apr 2025 17:28:50 +0000 (19:28 +0200)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 17 Apr 2025 17:28:50 +0000 (19:28 +0200)
icu74.patch [new file with mode: 0644]
php.spec

diff --git a/icu74.patch b/icu74.patch
new file mode 100644 (file)
index 0000000..01f5e88
--- /dev/null
@@ -0,0 +1,74 @@
+From cc46a4e6b5a413bab3e264c1dcaaf7052f54fbc4 Mon Sep 17 00:00:00 2001
+From: David Carlier <devnexen@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@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@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)
+   ],[
index 473e2067ebf2823382732c53f2bcf9f4dbb7919b..5cf2cdc88e9df6b8f52873ba1162832561257cac 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -175,6 +175,7 @@ Patch67:    mysql-lib-ver-mismatch.patch
 # https://bugs.php.net/bug.php?id=68344
 Patch68:       php-mysql-ssl-context.patch
 Patch71:       libdb-info.patch
+Patch72:       icu74.patch
 URL:           http://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}
@@ -1818,6 +1819,7 @@ cp -p php.ini-production php.ini
 %patch -P67 -p1
 #%patch -P68 -p1 DROP or update to 7.0 APIs
 %patch -P71 -p1
+%patch -P72 -p1
 
 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{_bindir}/\1%{php_suffix},' \
       ext/ext_skel.php \
@@ -2039,11 +2041,6 @@ export CPPFLAGS="-DDEBUG_FASTCGI -DHAVE_STRNDUP %{rpmcppflags}"
 export CXXFLAGS="%{rpmcxxflags} -fPIC -DPIC"
 export CFLAGS="%{rpmcflags} -fPIC -DPIC"
 
-%if %{with intl}
-# icu 59+ C++ API requires C++ >= 11
-CXXFLAGS="$CXXFLAGS -std=c++11"
-%endif
-
 sapis="
 cli
 %if %{with cgi}