From nobody Mon Nov 07 08:04:31 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N5P000ycQz4hJW4; Mon, 7 Nov 2022 08:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N5Nzz6zyFz3pNp; Mon, 7 Nov 2022 08:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667808272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfzJW2jrGSRLQgDQB30JajbLRb/YUQcMo1sien9cYfQ=; b=C466z59GD4LIkHuiflVvzZjtzaUvkTj9/WADSniwQMTDxMoYxG7IaFz7aZMZFbf2Zb0KbG bzQIQRzGWcvJuZbb/I46clBLbb2Q4yNixEsQlDU0FnS+jpcDxunjaX5bBUmu96d6IzsYjb 6pYvcFRf2ydY48JDtCgYZJjksiMwVDI+8H9ZSBd1oQjNVZ6UVG6G5qto/RLdbSZdghxk02 5+jIuXy67HKi/kBNTfYfqT/lo7Bl59VMZQFKyd8Yz+ZoTMJ2rq50zk8f7nxr4fb+ASp1pP HVZaYUjG3ZARoyDqKqftHRyW0wqhveG7NzjH/YG3TCUXto2+Ns2jrKdkSKpfAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N5Nzz5XTvztDs; Mon, 7 Nov 2022 08:04:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2A784Vum009972; Mon, 7 Nov 2022 08:04:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A784VEQ009971; Mon, 7 Nov 2022 08:04:31 GMT (envelope-from git) Date: Mon, 7 Nov 2022 08:04:31 GMT Message-Id: <202211070804.2A784VEQ009971@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 9b44be3b710b - main - net/brynet: New port: Header-only cross-platform C++ TCP network library List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b44be3b710b380eb2c5bfa8b9870f4dc961df8f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667808272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TfzJW2jrGSRLQgDQB30JajbLRb/YUQcMo1sien9cYfQ=; b=U3s/E3+G3ma0t69kBP9BbSRzcwNGmypUC85ZzHT8VsMoYGamBpHq7IReJ/zTT/NXNOg2YJ 37SrGVZSb/vzYZb2wRTMKl6/jI2NYIvDoF7Y99IFIxpq2a+PyHHAFSKmVsOK6MJlzUga8L 3/ukzBvurHWiT25ZpcsMtt4gr0RKjyB5W9Bh/S6/ZImcAUeKxNxa6b6EZVjB2WbE+fF8AQ xFDfhClWausEvDqHbFCaEuh53Jen7UFOlN2IcglkUVepnrat1/T9E1RmFyb9X0SMuLoiVm LQYs28Ru9YUd1s+HuhHDVRrsKKbO4RIf/7GH3wsMoZY41FLN5EbfOuVct+AfOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667808272; a=rsa-sha256; cv=none; b=ysKLwWRVnschEcMDDRC/v6wNyPPTUtqkVyEjoMhn7UJjrFcOkD/G/HHB6pxq0JEoEIEPUI E+oiLM+dGwMAYzSNChmZiPnDbFz8hqvVWBWu4C98niMepv3NFhlM0pATU1URb/40xtANd3 GQ2R+ugW6xlSKN8CTN9uKMAnzoD6lDYL5N5/ifSnSWu4wL3UbRtO5avJCKmfuXlreXtM0p dU9yjDCp5r7yetu1Pz2C9x8HGsAkHt/LUqKWgniCppX3d6yDtjeGPSbAFFTEbwjKD1b+QF 7DFwdpuBGRcnsF+3WOA8gBQgCsuXDMyhPxcOJoJT3xh7RtriiowyHCbD6e/Zog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=9b44be3b710b380eb2c5bfa8b9870f4dc961df8f commit 9b44be3b710b380eb2c5bfa8b9870f4dc961df8f Author: Yuri Victorovich AuthorDate: 2022-11-07 06:52:27 +0000 Commit: Yuri Victorovich CommitDate: 2022-11-07 08:04:27 +0000 net/brynet: New port: Header-only cross-platform C++ TCP network library --- net/Makefile | 1 + net/brynet/Makefile | 28 +++++++++++++ net/brynet/distinfo | 3 ++ .../files/patch-include_brynet_base_Platform.hpp | 11 +++++ .../patch-include_brynet_net_CurrentThread.hpp | 31 ++++++++++++++ .../files/patch-include_brynet_net_EventLoop.hpp | 14 +++++++ net/brynet/pkg-descr | 2 + net/brynet/pkg-plist | 48 ++++++++++++++++++++++ 8 files changed, 138 insertions(+) diff --git a/net/Makefile b/net/Makefile index a27797afb95c..6804034f2554 100644 --- a/net/Makefile +++ b/net/Makefile @@ -63,6 +63,7 @@ SUBDIR += bosh-cli SUBDIR += bounce SUBDIR += bredbandskollen + SUBDIR += brynet SUBDIR += bsdec2-image-upload SUBDIR += bsdrcmds SUBDIR += bwi-firmware-kmod diff --git a/net/brynet/Makefile b/net/brynet/Makefile new file mode 100644 index 000000000000..582577373686 --- /dev/null +++ b/net/brynet/Makefile @@ -0,0 +1,28 @@ +PORTNAME= brynet +DISTVERSIONPREFIX= v +DISTVERSION= 1.12.1-4 +DISTVERSIONSUFFIX= -g2e7d54d +CATEGORIES= net devel + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Header-only cross-platform C++ TCP network library +WWW= https://github.com/IronsDu/brynet + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= cmake:testing compiler:c++17-lang + +USE_GITHUB= yes +GH_ACCOUNT= IronsDu + +CMAKE_OFF= brynet_BUILD_EXAMPLES brynet_BUILD_TESTS +CMAKE_TESTING_ON= brynet_BUILD_TESTS # tests are built but not run, see https://github.com/IronsDu/brynet/issues/130 + +NO_BUILD= yes +NO_ARCH= yes + +pre-patch: + @${FIND} ${WRKSRC} -name "*.hpp" | ${XARGS} ${REINPLACE_CMD} -i '' -e 's/defined BRYNET_PLATFORM_DARWIN/& || defined BRYNET_PLATFORM_FREEBSD/' + +.include diff --git a/net/brynet/distinfo b/net/brynet/distinfo new file mode 100644 index 000000000000..f6e96e136ec6 --- /dev/null +++ b/net/brynet/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1667801389 +SHA256 (IronsDu-brynet-v1.12.1-4-g2e7d54d_GH0.tar.gz) = cde787bf10b9496b2af04d89d10d79a466d9bd14cde5cf495e6f70c1d4cf9210 +SIZE (IronsDu-brynet-v1.12.1-4-g2e7d54d_GH0.tar.gz) = 232439 diff --git a/net/brynet/files/patch-include_brynet_base_Platform.hpp b/net/brynet/files/patch-include_brynet_base_Platform.hpp new file mode 100644 index 000000000000..4c178deab84e --- /dev/null +++ b/net/brynet/files/patch-include_brynet_base_Platform.hpp @@ -0,0 +1,11 @@ +--- include/brynet/base/Platform.hpp.orig 2022-11-07 05:36:34 UTC ++++ include/brynet/base/Platform.hpp +@@ -5,6 +5,8 @@ + #pragma comment(lib, "ws2_32") + #elif defined __APPLE_CC__ || defined __APPLE__ + #define BRYNET_PLATFORM_DARWIN ++#elif defined __FreeBSD__ ++#define BRYNET_PLATFORM_FREEBSD + #else + #define BRYNET_PLATFORM_LINUX + #endif diff --git a/net/brynet/files/patch-include_brynet_net_CurrentThread.hpp b/net/brynet/files/patch-include_brynet_net_CurrentThread.hpp new file mode 100644 index 000000000000..9b31c50db90a --- /dev/null +++ b/net/brynet/files/patch-include_brynet_net_CurrentThread.hpp @@ -0,0 +1,31 @@ +--- include/brynet/net/CurrentThread.hpp.orig 2022-11-07 05:56:13 UTC ++++ include/brynet/net/CurrentThread.hpp +@@ -23,7 +23,11 @@ namespace brynet { namespace net { namespace current_t + #ifdef BRYNET_PLATFORM_WINDOWS + using THREAD_ID_TYPE = DWORD; + #elif defined BRYNET_PLATFORM_LINUX || defined BRYNET_PLATFORM_DARWIN || defined BRYNET_PLATFORM_FREEBSD ++# if defined BRYNET_PLATFORM_FREEBSD ++using THREAD_ID_TYPE = pthread_t; ++# else + using THREAD_ID_TYPE = int; ++# endif + #endif + + static THREAD_ID_TYPE& tid() +@@ -41,12 +45,16 @@ static THREAD_ID_TYPE& tid() + #elif defined BRYNET_PLATFORM_LINUX + cachedTid = static_cast(::syscall(SYS_gettid)); + #elif defined BRYNET_PLATFORM_DARWIN || defined BRYNET_PLATFORM_FREEBSD ++# if defined BRYNET_PLATFORM_FREEBSD ++ cachedTid = pthread_self(); ++# else + // warning: 'syscall' is deprecated: + // first deprecated in macOS 10.12 - syscall(2) is unsupported; + // please switch to a supported interface. + uint64_t tid64; + pthread_threadid_np(NULL, &tid64); + cachedTid = (pid_t) tid64; ++# endif + #endif + } + diff --git a/net/brynet/files/patch-include_brynet_net_EventLoop.hpp b/net/brynet/files/patch-include_brynet_net_EventLoop.hpp new file mode 100644 index 000000000000..26ead00fbb2b --- /dev/null +++ b/net/brynet/files/patch-include_brynet_net_EventLoop.hpp @@ -0,0 +1,14 @@ +--- include/brynet/net/EventLoop.hpp.orig 2022-11-07 05:58:53 UTC ++++ include/brynet/net/EventLoop.hpp +@@ -72,7 +72,11 @@ class EventLoop : public brynet::base::NonCopyable (pu + mIsInBlock = true; + + reAllocEventSize(1024); ++#if defined BRYNET_PLATFORM_FREEBSD ++ mSelfThreadID = nullptr; ++#else + mSelfThreadID = -1; ++#endif + mTimer = std::make_shared(); + mSelfThreadIDIsInitialized.store(false); + } diff --git a/net/brynet/pkg-descr b/net/brynet/pkg-descr new file mode 100644 index 000000000000..d536220cf3fc --- /dev/null +++ b/net/brynet/pkg-descr @@ -0,0 +1,2 @@ +Brynet is a header-only cross platform high performance TCP network library +using C++11. diff --git a/net/brynet/pkg-plist b/net/brynet/pkg-plist new file mode 100644 index 000000000000..7b39dd6973a0 --- /dev/null +++ b/net/brynet/pkg-plist @@ -0,0 +1,48 @@ +include/brynet/Version.hpp +include/brynet/base/Any.hpp +include/brynet/base/AppStatus.hpp +include/brynet/base/Array.hpp +include/brynet/base/Buffer.hpp +include/brynet/base/CPP_VERSION.hpp +include/brynet/base/Noexcept.hpp +include/brynet/base/NonCopyable.hpp +include/brynet/base/Packet.hpp +include/brynet/base/Platform.hpp +include/brynet/base/Stack.hpp +include/brynet/base/Timer.hpp +include/brynet/base/WaitGroup.hpp +include/brynet/base/crypto/Base64.hpp +include/brynet/base/crypto/SHA1.hpp +include/brynet/base/endian/Endian.hpp +include/brynet/net/AsyncConnector.hpp +include/brynet/net/Channel.hpp +include/brynet/net/CurrentThread.hpp +include/brynet/net/EventLoop.hpp +include/brynet/net/Exception.hpp +include/brynet/net/ListenThread.hpp +include/brynet/net/Poller.hpp +include/brynet/net/PromiseReceive.hpp +include/brynet/net/SSLHelper.hpp +include/brynet/net/SendableMsg.hpp +include/brynet/net/Socket.hpp +include/brynet/net/SocketLibFunction.hpp +include/brynet/net/SocketLibTypes.hpp +include/brynet/net/TcpConnection.hpp +include/brynet/net/TcpService.hpp +include/brynet/net/detail/ConnectionOption.hpp +include/brynet/net/detail/ConnectorDetail.hpp +include/brynet/net/detail/ConnectorWorkInfo.hpp +include/brynet/net/detail/IOLoopData.hpp +include/brynet/net/detail/ListenThreadDetail.hpp +include/brynet/net/detail/TCPServiceDetail.hpp +include/brynet/net/detail/WakeupChannel.hpp +include/brynet/net/http/HttpFormat.hpp +include/brynet/net/http/HttpParser.hpp +include/brynet/net/http/HttpService.hpp +include/brynet/net/http/WebSocketFormat.hpp +include/brynet/net/http/http_parser.h +include/brynet/net/port/Win.hpp +include/brynet/net/wrapper/ConnectionBuilder.hpp +include/brynet/net/wrapper/HttpConnectionBuilder.hpp +include/brynet/net/wrapper/HttpServiceBuilder.hpp +include/brynet/net/wrapper/ServiceBuilder.hpp