<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/d0a0814d1455e162b4258b215f1514ac263d355f">https://github.com/macports/macports-ports/commit/d0a0814d1455e162b4258b215f1514ac263d355f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit d0a0814d1455e162b4258b215f1514ac263d355f
</span>Author: Sergey Fedorov <vital.had@gmail.com>
AuthorDate: Mon Aug 15 00:47:06 2022 +0700
<span style='display:block; white-space:pre;color:#404040;'> wangle: allow build with gcc and on older systems
</span>---
devel/wangle/Portfile | 31 ++++++++++------
devel/wangle/files/patch-tcp.diff | 75 +++++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+), 11 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/wangle/Portfile b/devel/wangle/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 705a136fae4..de8b12a99e8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/wangle/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/wangle/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -27,16 +27,6 @@ github.tarball_from releases
</span> distname ${name}-v${version}
extract.mkdir yes
<span style='display:block; white-space:pre;background:#ffe0e0;'>-platform darwin {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.major} < 16} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- known_fail yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pre-fetch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "${subport} requires macOS 10.12 or later"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "incompatible macOS version"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> set port_libfmt libfmt9
cmake.module_path-append \
${prefix}/lib/${port_libfmt}/cmake
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -53,6 +43,10 @@ depends_lib-append port:double-conversion \
</span>
cmake.source_dir ${worksrcpath}/${name}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+if {${os.platform} eq "darwin" && ${os.major} < 15} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles-append patch-tcp.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # Fix error: invalid output constraint '=@ccc' in asm
compiler.blacklist-append \
{clang < 1200}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -65,4 +59,19 @@ configure.args-append \
</span> -DBUILD_SHARED_LIBS=ON
legacysupport.newest_darwin_requires_legacy 19
<span style='display:block; white-space:pre;background:#ffe0e0;'>-legacysupport.use_mp_libcxx yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[string match *clang* ${configure.compiler}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Don’t use libcxx with gcc.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ legacysupport.use_mp_libcxx yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+platform darwin {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # https://kumasento.github.io/2020-06-12-glog-gflags-and-c-abi/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${os.major} < 16} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-append -D_GLIBCXX_USE_CXX11_ABI=0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match *gcc* ${configure.compiler}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # ___atomic_fetch_sub_8, ___atomic_compare_exchange_8, ___atomic_store_8, ___atomic_load_8, ___atomic_fetch_add_8
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.ldflags-append -latomic
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/wangle/files/patch-tcp.diff b/devel/wangle/files/patch-tcp.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..961370e165c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/wangle/files/patch-tcp.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,75 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- wangle/acceptor/TransportInfo.h.orig 2022-08-15 00:36:09.000000000 +0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ wangle/acceptor/TransportInfo.h 2022-08-15 00:29:03.000000000 +0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -114,11 +114,11 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int32_t maxPacingRate{-1};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ typedef tcp_connection_info tcp_info;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * TCP information as fetched from getsockopt(2)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -352,7 +352,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ static int64_t readRTT(const folly::AsyncSocket* sock);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ * perform the getsockopt(2) syscall to fetch TCP info for a given socket
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- wangle/acceptor/TransportInfo.cpp.orig 2022-08-08 08:24:55.000000000 +0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ wangle/acceptor/TransportInfo.cpp 2022-08-15 00:28:35.000000000 +0700
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -27,12 +27,12 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ namespace wangle {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool TransportInfo::initWithSocket(const folly::AsyncSocket* sock) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!TransportInfo::readTcpInfo(&tcpinfo, sock)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tcpinfoErrno = errno;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return false;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rtt = microseconds(tcpinfo.tcpi_srtt * 1000);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rtt_var = tcpinfo.tcpi_rttvar * 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ rto = tcpinfo.tcpi_rto * 1000;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -127,7 +127,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif // defined(__linux__) || defined(__FreeBSD__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ int64_t TransportInfo::readRTT(const folly::AsyncSocket* sock) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tcp_info tcpinfo;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!TransportInfo::readTcpInfo(&tcpinfo, sock)) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -135,7 +135,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #if defined(__linux__) || defined(__FreeBSD__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return tcpinfo.tcpi_rtt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#elif (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return tcpinfo.tcpi_srtt;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ (sock); // unused
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -143,11 +143,11 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef __APPLE__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #define TCP_INFO TCP_CONNECTION_INFO
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ bool TransportInfo::readTcpInfo(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ tcp_info* tcpinfo,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ const folly::AsyncSocket* sock) {
</span></pre><pre style='margin:0'>
</pre>