From b769dbba08e00b7ea30af9573927ae4332008372 Mon Sep 17 00:00:00 2001 From: aeiouaeiouaeiouaeiouaeiouaeiou Date: Tue, 28 Apr 2026 01:04:45 +0300 Subject: [PATCH] i2pd: fix build on macOS <12 --- security/i2pd/Portfile | 11 ++++++++++- security/i2pd/files/0002-patch-util-cpp.patch | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 security/i2pd/files/0002-patch-util-cpp.patch diff --git a/security/i2pd/Portfile b/security/i2pd/Portfile index bb2df6ddb00..74596e6b52f 100644 --- a/security/i2pd/Portfile +++ b/security/i2pd/Portfile @@ -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') +# to 'const key_type' (aka 'const std::basic_string') +# 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 { diff --git a/security/i2pd/files/0002-patch-util-cpp.patch b/security/i2pd/files/0002-patch-util-cpp.patch new file mode 100644 index 00000000000..10bac2c036e --- /dev/null +++ b/security/i2pd/files/0002-patch-util-cpp.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);