Skip to content

Commit

Permalink
Try to fix support for icu 75.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Sep 11, 2024
1 parent 6775955 commit 264d067
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
13 changes: 7 additions & 6 deletions patches/intl/intl-icu-75.1-php7.1-8.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,31 @@ Subject: [PATCH] [PATCH] ext/intl: level up c++ runtime std for icu 74 and
onwards.

---
ext/intl/config.m4 | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index 4b9f469b38..7b5a9dd658 100644
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -89,6 +89,16 @@ if test "$PHP_INTL" != "no"; then
@@ -89,7 +89,19 @@ if test "$PHP_INTL" != "no"; then
breakiterator/rulebasedbreakiterator_methods.cpp \
breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp"
- PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
+
+ 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)
+ ],[
+ AC_MSG_RESULT([no])
+ PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
+ ])
+
PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $ICU_CXXFLAGS"
+ PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS"
if test "$ext_shared" = "no"; then
PHP_ADD_SOURCES(PHP_EXT_DIR(intl), $PHP_INTL_CXX_SOURCES, $PHP_INTL_CXX_FLAGS)
else
--
2.45.2

1 change: 0 additions & 1 deletion patches/intl/series-php5.6
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ intl-icu-73.1-php5.6-8.0.patch
intl-icu-73.2-php5.6-8.0.patch
intl-icu-74.1-php5.6-8.0.patch
intl-icu-74.2-php5.6-8.0.patch
intl-icu-75.1-php5.6-7.0.patch
intl-icu-75.1-php5.6-8.0.patch
1 change: 0 additions & 1 deletion patches/intl/series-php7.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ intl-icu-73.1-php5.6-8.0.patch
intl-icu-73.2-php5.6-8.0.patch
intl-icu-74.1-php5.6-8.0.patch
intl-icu-74.2-php5.6-8.0.patch
intl-icu-75.1-php7.1-8.0.patch
intl-icu-75.1-php5.6-8.0.patch
1 change: 0 additions & 1 deletion patches/intl/series-php7.2
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ intl-icu-73.1-php5.6-8.0.patch
intl-icu-73.2-php5.6-8.0.patch
intl-icu-74.1-php5.6-8.0.patch
intl-icu-74.2-php5.6-8.0.patch
intl-icu-75.1-php7.1-8.0.patch
intl-icu-75.1-php5.6-8.0.patch
1 change: 0 additions & 1 deletion patches/intl/series-php7.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ intl-icu-73.1-php5.6-8.0.patch
intl-icu-73.2-php5.6-8.0.patch
intl-icu-74.1-php5.6-8.0.patch
intl-icu-74.2-php5.6-8.0.patch
intl-icu-75.1-php7.1-8.0.patch
intl-icu-75.1-php5.6-8.0.patch
1 change: 0 additions & 1 deletion patches/intl/series-php7.4
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ intl-icu-73.2-php5.6-8.0.patch
intl-icu-74.1-php5.6-8.0.patch
intl-icu-74.2-php5.6-8.0.patch
intl-icu-75.1-php7.4-8.1.patch
intl-icu-75.1-php5.6-8.0.patch
5 changes: 3 additions & 2 deletions src/build-intl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ install_intl() {
while read patch || [[ $patch ]]; do
[[ "$patch" =~ $ICU ]] && patch -d /tmp/php-src -N -p1 -s < "patches/intl/$patch"
done < patches/intl/series-php"$VERSION"
cd "/tmp/php-src/ext/intl" || exit 1
cd "/tmp/php-src/ext/intl" || exit 1
phpize && sudo ./configure --with-php-config="$(command -v php-config)" --enable-intl
echo "#define FALSE 0" >> config.h
echo "#define TRUE 1" >> config.h
make CXXFLAGS="-O2 -std=c++11 -DU_USING_ICU_NAMESPACE=1 -DTRUE=1 -DFALSE=0 $CXXFLAGS"
[[ "${ICU%.*}" -ge 75 ]] && CXX=17 || CXX=11
make CXXFLAGS="-O2 -std=c++$CXX -DU_USING_ICU_NAMESPACE=1 -DTRUE=1 -DFALSE=0 $CXXFLAGS"
sudo cp ./modules/* "$ext_dir/"
enable_extension intl extension
)
Expand Down

0 comments on commit 264d067

Please sign in to comment.