New port: net/usockets: Miniscule eventing, networking & crypto for async applications

This commit is contained in:
Yuri Victorovich 2020-04-08 21:01:39 +00:00
parent e91db07555
commit cd06182949
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=531147
6 changed files with 76 additions and 0 deletions

View file

@ -1506,6 +1506,7 @@
SUBDIR += uriparser
SUBDIR += urlendec
SUBDIR += usbredir
SUBDIR += usockets
SUBDIR += utftpd
SUBDIR += v2ray
SUBDIR += vblade

29
net/usockets/Makefile Normal file
View file

@ -0,0 +1,29 @@
# $FreeBSD$
PORTNAME= usockets
DISTVERSIONPREFIX= v
DISTVERSION= 0.3.5
CATEGORIES= net devel
MAINTAINER= yuri@FreeBSD.org
COMMENT= Miniscule eventing, networking & crypto for async applications
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= compiler:c11 gmake
USE_GITHUB= yes
GH_ACCOUNT= uNetworking
GH_PROJECT= uSockets
USE_LDCONFIG= yes
ALL_TARGET= default
PLIST_FILES= include/libusockets.h \
lib/libusockets.so
do-install:
${INSTALL_DATA} ${WRKSRC}/src/libusockets.h ${STAGEDIR}${PREFIX}/include
${INSTALL_LIB} ${WRKSRC}/libusockets.so ${STAGEDIR}${PREFIX}/lib
.include <bsd.port.mk>

3
net/usockets/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1586376975
SHA256 (uNetworking-uSockets-v0.3.5_GH0.tar.gz) = 16ee4d264cf2266ee25dfc12996b1af4a709ae9bce70a5b167e8a36250fb9109
SIZE (uNetworking-uSockets-v0.3.5_GH0.tar.gz) = 47939

View file

@ -0,0 +1,13 @@
--- Makefile.orig 2019-12-26 21:03:09 UTC
+++ Makefile
@@ -38,8 +38,8 @@ override LDFLAGS += uSockets.a
# By default we build the uSockets.a static library
default:
rm -f *.o
- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
- $(AR) rvs uSockets.a *.o
+ $(CC) $(CFLAGS) -fPIC -flto -c src/*.c src/eventing/*.c src/crypto/*.c
+ $(CC) -shared -o libusockets.so *.o
# Builds all examples
.PHONY: examples

View file

@ -0,0 +1,11 @@
--- src/libusockets.h.orig 2020-04-08 20:24:31 UTC
+++ src/libusockets.h
@@ -230,7 +230,7 @@ WIN32_EXPORT void us_socket_remote_address(int ssl, st
#if !defined(LIBUS_USE_EPOLL) && !defined(LIBUS_USE_LIBUV) && !defined(LIBUS_USE_GCD) && !defined(LIBUS_USE_KQUEUE)
#if defined(_WIN32)
#define LIBUS_USE_LIBUV
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__)
#define LIBUS_USE_KQUEUE
#else
#define LIBUS_USE_EPOLL

19
net/usockets/pkg-descr Normal file
View file

@ -0,0 +1,19 @@
uSockets is the cross-platform async networking and eventing foundation library.
Features:
* Built-in (optionally available) TLS support exposed with identical interface
as for TCP.
* Acknowledges and integrates with any event-loop via a layered hierarchical
design of plugins.
* Extremely pedantic about user space memory footprint and designed to perform
as good as can be.
* Designed from scratch to map well to user space TCP stacks or other
experimental platforms.
* Low resolution timer system ideal for performant tracking of networking
timeouts.
* Minimal yet truly cross-platform, will not emit a billion different platform
specific error codes.
* Fully opaque library, inclusion will not completely pollute your global
namespace.
WWW: https://github.com/uNetworking/uSockets