php8: Support for icu 75
[feed/packages.git] / lang / php8 / patches / 1020-php-intl_unbreak_build_with_ICU_75.patch
1 From e680bd98d34a86302db434c5be23d0cf9d23df23 Mon Sep 17 00:00:00 2001
2 From: Jan Beich <jbeich@FreeBSD.org>
3 Date: Sat, 20 Apr 2024 23:49:22 +0200
4 Subject: devel/php*-intl: unbreak build with ICU 75
5
6 In file included from ext/intl/intl_convertcpp.cpp:17:
7 In file included from ./intl_convertcpp.h:22:
8 In file included from /usr/local/include/unicode/unistr.h:39:
9 /usr/local/include/unicode/stringpiece.h:133:29: error: no template named 'enable_if_t' in namespace 'std'
10 typename = std::enable_if_t<
11 ~~~~~^
12 /usr/local/include/unicode/stringpiece.h:134:23: error: no template named 'is_same_v' in namespace 'std'; did you mean 'is_same'?
13 (std::is_same_v<decltype(T().data()), const char*>
14 ~~~~~^
15 /usr/include/c++/v1/__type_traits/is_same.h:22:29: note: 'is_same' declared here
16 struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { };
17 ^
18 In file included from ext/intl/intl_convertcpp.cpp:17:
19 In file included from ./intl_convertcpp.h:22:
20 In file included from /usr/local/include/unicode/unistr.h:39:
21 /usr/local/include/unicode/stringpiece.h:139:17: error: use of address-of-label extension outside of a function body
22 std::is_same_v<decltype(T().size()), size_t>>>
23 ^
24 /usr/local/include/unicode/stringpiece.h:139:62: error: expected member name or ';' after declaration specifiers
25 std::is_same_v<decltype(T().size()), size_t>>>
26 ^
27 PR: 278420
28 Reported by: antoine (via exp-run)
29 ---
30
31 --- a/ext/intl/config.m4
32 +++ b/ext/intl/config.m4
33 @@ -80,7 +80,16 @@ if test "$PHP_INTL" != "no"; then
34 breakiterator/codepointiterator_methods.cpp"
35
36 PHP_REQUIRE_CXX()
37 - PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
38 +
39 + AC_MSG_CHECKING([if intl requires -std=gnu++17])
40 + AS_IF([test "$PKG_CONFIG icu-uc --atleast-version=74"],[
41 + AC_MSG_RESULT([yes])
42 + PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
43 + ],[
44 + AC_MSG_RESULT([no])
45 + PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
46 + ])
47 +
48 PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS"
49 case $host_alias in
50 *cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L"