i2pd: fix build on macOS <12

This commit is contained in:
aeiouaeiouaeiouaeiouaeiouaeiou
2026-04-28 01:04:45 +03:00
committed by Herby Gillot
parent 0afd5a892a
commit b769dbba08
2 changed files with 21 additions and 1 deletions
+10 -1
View File
@@ -8,10 +8,11 @@ PortGroup legacysupport 1.1
PortGroup openssl 1.0
# on <10.15 built-in libc++ has no support for std::filesystem
# uses number 19 due to a bug in macOS Catalina SDK
legacysupport.use_mp_libcxx \
yes
legacysupport.newest_darwin_requires_legacy \
18
19
github.setup PurpleI2P i2pd 2.60.0
revision 0
@@ -33,6 +34,14 @@ depends_lib-append port:zlib
patchfiles-append 0001-i2pd.conf-adjust-for-MacPorts.patch
# util.cpp:319:30: error: no viable conversion from
# 'std::string_view' (aka 'basic_string_view<char>')
# to 'const key_type' (aka 'const std::basic_string<char>')
# Clang <18 on macOS <12 supports C++20, but gets stuck at this section of code
if {${os.platform} eq "darwin" && ${os.major} < 21} {
patchfiles-append 0002-patch-util-cpp.patch
}
set i2pddir ${prefix}/var/db/${name}
post-patch {
@@ -0,0 +1,11 @@
--- libi2pd/util.cpp
+++ libi2pd/util.cpp
@@ -315,7 +315,7 @@ namespace util
bool Mapping::Contains (std::string_view param) const
{
-#if __cplusplus >= 202002L // C++20
+#if !defined(__clang__) && (__cplusplus >= 202002L) // C++20
return m_Options.contains (param);
#else
auto it = m_Options.find (param);