Hi, Attached updates for net/usockets www/{uwebsockets,purritobin} I am unsure what the protocol is for submitting multiple port updates but at least usockets and uwebsockets are closely tied enough that they would need to be updated together. I can decouple purritobin, if it makes it easier to review.
Changes/fixes: net/usockets: - revision bump to 0 - fixes a cstdlib include error from upstream - adds a pkg-config file for easy use by other programs - removes internal header installation - fixes header install path to match FreeBSD (deprecates a patch in uWebSockets) www/uwebsockets: - update to 18.15.0 - removes unneeded patch www/purritobin: - update to 0.3.2 - adds SSL capabilities - adds support for ipv6 - adds listening on multiple interfaces and ports - adds a man page (was fun to learn mandoc, damn cool) - adds logging to syslog Thanks a lot to tb@ for noticing me being dumb with unveil :P Cheers, Aisha diff --git a/net/usockets/Makefile b/net/usockets/Makefile index b39937b6fe5..24297b98f34 100644 --- a/net/usockets/Makefile +++ b/net/usockets/Makefile @@ -1,14 +1,22 @@ # $OpenBSD: Makefile,v 1.3 2020/09/17 01:38:30 bcallah Exp $ COMMENT = eventing, networking & crypto for async applications -PKGNAME = ${DISTNAME:L} CATEGORIES = net +VERSION = 0.6.0 +REVISION = 0 + +DISTNAME = usockets-${VERSION} +PKGNAME = ${DISTNAME:L} + SHARED_LIBS = usockets 1.0 GH_ACCOUNT = uNetworking GH_PROJECT = uSockets -GH_TAGNAME = v0.6.0 +#GH_TAGNAME = v0.6.0 +# cstdlib include error +GH_COMMIT = 7683672d87067cd75b854f4e36b9820f4809a4be + MAINTAINER = Aisha Tammy <open...@aisha.cc> @@ -23,12 +31,9 @@ COMPILER = base-clang ports-gcc LIB_DEPENDS = devel/libuv USE_GMAKE = Yes -ALL_TARGET = default -MAKE_FLAGS = CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \ - LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" \ - CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \ - LIBusockets_VERSION="${LIBusockets_VERSION}" \ - WITH_OPENSSL=1 WITH_LIBUV=1 +MAKE_FLAGS = CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \ + CC="${CC}" CXX="${CXX}" \ + LIBusockets_VERSION="${LIBusockets_VERSION}" NO_TEST = Yes diff --git a/net/usockets/distinfo b/net/usockets/distinfo index 8058bc795ab..964ba508e9e 100644 --- a/net/usockets/distinfo +++ b/net/usockets/distinfo @@ -1,2 +1,2 @@ -SHA256 (uSockets-0.6.0.tar.gz) = mZOH02U7K8Zjw0qn6XM1isTEiX3M1kRVOlyquEOpeKE= -SIZE (uSockets-0.6.0.tar.gz) = 57590 +SHA256 (usockets-0.6.0-7683672d.tar.gz) = 0OooGCHD8ezNIcaB1zDPK6RQLGGYGZJb24Vemjlat7c= +SIZE (usockets-0.6.0-7683672d.tar.gz) = 57634 diff --git a/net/usockets/patches/patch-Makefile b/net/usockets/patches/patch-Makefile index e68fbee5c06..56473a2f03b 100644 --- a/net/usockets/patches/patch-Makefile +++ b/net/usockets/patches/patch-Makefile @@ -1,68 +1,98 @@ $OpenBSD: patch-Makefile,v 1.2 2020/09/17 01:38:30 bcallah Exp $ -add shared + static lib + default targets +add shared + static lib + pkg-config file remove -flto -O3 Index: Makefile --- Makefile.orig +++ Makefile -@@ -1,3 +1,13 @@ +@@ -1,60 +1,40 @@ +-# WITH_OPENSSL=1 enables OpenSSL 1.1+ support or BoringSSL +-# For now we need to link with C++ for OpenSSL support, but should be removed with time +-ifeq ($(WITH_OPENSSL),1) +- override CFLAGS += -DLIBUS_USE_OPENSSL +- # With problems on macOS, make sure to pass needed LDFLAGS required to find these +- override LDFLAGS += -lssl -lcrypto -lstdc++ +-else +- # WITH_WOLFSSL=1 enables WolfSSL 4.2.0 support (mutually exclusive with OpenSSL) +- ifeq ($(WITH_WOLFSSL),1) +- # todo: change these +- override CFLAGS += -DLIBUS_USE_WOLFSSL -I/usr/local/include +- override LDFLAGS += -L/usr/local/lib -lwolfssl +- else +- override CFLAGS += -DLIBUS_NO_SSL +- endif +-endif +DESTDIR ?= -+ -+prefix ?= "/usr/local" -+exec_prefix ?= "$(prefix)" -+libdir ?= "$(exec_prefix)/lib" -+includedir?= "$(exec_prefix)/include/uSockets" -+ + +-# WITH_LIBUV=1 builds with libuv as event-loop +-ifeq ($(WITH_LIBUV),1) +- override CFLAGS += -DLIBUS_USE_LIBUV +- override LDFLAGS += -luv +-endif ++PREFIX ?= "/usr/local" ++LIBDIR ?= "$(PREFIX)/lib" ++INCLUDEDIR ?= "$(PREFIX)/include" + +-# WITH_GCD=1 builds with libdispatch as event-loop +-ifeq ($(WITH_GCD),1) +- override CFLAGS += -DLIBUS_USE_GCD +- override LDFLAGS += -framework CoreFoundation +-endif +# OpenBSD specific library version -+LIBTARGET = libusockets.so.$(LIBusockets_VERSION) -+ - # WITH_OPENSSL=1 enables OpenSSL 1.1+ support or BoringSSL - # For now we need to link with C++ for OpenSSL support, but should be removed with time - ifeq ($(WITH_OPENSSL),1) -@@ -34,18 +44,32 @@ ifeq ($(WITH_ASAN),1) - endif ++LIBTARGET ?= libusockets.so.$(LIBusockets_VERSION) + +-# WITH_ASAN builds with sanitizers +-ifeq ($(WITH_ASAN),1) +- override CFLAGS += -fsanitize=address -g +- override LDFLAGS += -lasan +-endif ++PKG_CONFIG ?= pkg-config - override CFLAGS += -std=c11 -Isrc +-override CFLAGS += -std=c11 -Isrc -override LDFLAGS += uSockets.a ++override LDFLAGS += -lstdc++ -lcrypto -lssl `$(PKG_CONFIG) --libs libuv` -# By default we build the uSockets.a static library -+ - default: - rm -f *.o +-default: +- rm -f *.o - $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c -# For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 -+ $(CC) -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c $(CFLAGS) - ifeq ($(WITH_OPENSSL),1) +-ifeq ($(WITH_OPENSSL),1) - $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp -+ $(CXX) $(CXXFLAGS) -std=c++17 -fPIC -c src/crypto/*.cpp - endif +-endif - $(AR) rvs uSockets.a *.o ++COMMON_FLAGS = -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -Isrc `$(PKG_CONFIG) --cflags libuv` ++override CFLAGS += $(COMMON_FLAGS) ++override CXXFLAGS += $(COMMON_FLAGS) + +-# Builds all examples +-.PHONY: examples +-examples: default +- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done ++all: ++ $(CC) -std=c11 -fPIC $(CFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c ++ $(CXX) -std=c++17 -fPIC $(CXXFLAGS) -c src/crypto/*.cpp + $(AR) rvs libusockets.a *.o -+ $(CC) -shared -fPIC -Wl,-soname,$(LIBTARGET) $(CFLAGS) -o $(LIBTARGET) *.o $(LDFLAGS) ++ $(CC) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) $(LDFLAGS) ++ sed -e "s:@PREFIX@:$(PREFIX):" -e "s:@VERSION@:$(LIBusockets_VERSION):" \ ++ libusockets.pc.in > libusockets.pc +-swift_examples: +- swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server +install: -+ # install the folders needed (making sure that the exist) -+ install -d "$(DESTDIR)$(libdir)" \ -+ "$(DESTDIR)$(includedir)/internal/eventing" \ -+ "$(DESTDIR)$(includedir)/internal/networking" -+ # OpenBSD specific library version -+ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)/" -+ # install static library -+ install -m 755 libusockets.a "$(DESTDIR)$(libdir)/" -+ # we also install all the header files -+ install src/*.h "$(DESTDIR)$(includedir)/" -+ install -m 644 src/internal/*.h "$(DESTDIR)$(includedir)/internal/" -+ install -m 644 src/internal/eventing/*.h "$(DESTDIR)$(includedir)/internal/eventing/" -+ install -m 644 src/internal/networking/*.h "$(DESTDIR)$(includedir)/internal/networking/" -+ - # Builds all examples - .PHONY: examples - examples: default -@@ -57,4 +81,6 @@ swift_examples: ++ install -d "$(LIBDIR)/pkgconfig" "$(INCLUDEDIR)" ++ install -m 644 src/libusockets.h "$(INCLUDEDIR)" ++ install -m 755 $(LIBTARGET) "$(LIBDIR)" ++ install -m 755 libusockets.a "$(LIBDIR)" ++ install -m 644 libusockets.pc "$(LIBDIR)/pkgconfig" + clean: rm -f *.o rm -f *.a +- rm -rf .certs + rm -f *.so - rm -rf .certs ++ rm -f libusockets.pc ++ ++.PHONY: all install clean + diff --git a/net/usockets/patches/patch-libusockets_pc_in b/net/usockets/patches/patch-libusockets_pc_in new file mode 100644 index 00000000000..3eff56f95c7 --- /dev/null +++ b/net/usockets/patches/patch-libusockets_pc_in @@ -0,0 +1,20 @@ +$OpenBSD$ + +Index: libusockets.pc.in +--- libusockets.pc.in.orig ++++ libusockets.pc.in +@@ -0,0 +1,14 @@ ++prefix=@PREFIX@ ++libdir=${prefix}/lib ++includedir=${prefix}/include ++ ++Name: uSockets ++Version: @VERSION@ ++Description: eventing, networking and crypto for async applications. ++URL: https://github.com/uNetworking/uSockets ++ ++Cflags: -I${includedir} ++Libs: -L${libdir} -lusockets ++Libs.private: -lstdc++ -lcrypto -lssl ++Requires.private: libuv ++ diff --git a/net/usockets/pkg/PLIST b/net/usockets/pkg/PLIST index 8d430769226..5bf95f90fe0 100644 --- a/net/usockets/pkg/PLIST +++ b/net/usockets/pkg/PLIST @@ -1,14 +1,5 @@ @comment $OpenBSD: PLIST,v 1.1.1.1 2020/06/22 11:38:31 landry Exp $ -include/uSockets/ -include/uSockets/internal/ -include/uSockets/internal/eventing/ -include/uSockets/internal/eventing/epoll_kqueue.h -include/uSockets/internal/eventing/gcd.h -include/uSockets/internal/eventing/libuv.h -include/uSockets/internal/internal.h -include/uSockets/internal/loop_data.h -include/uSockets/internal/networking/ -include/uSockets/internal/networking/bsd.h -include/uSockets/libusockets.h +include/libusockets.h @static-lib lib/libusockets.a @lib lib/libusockets.so.${LIBusockets_VERSION} +lib/pkgconfig/libusockets.pc diff --git a/www/purritobin/Makefile b/www/purritobin/Makefile index 1e86eec45c7..9da3521be23 100644 --- a/www/purritobin/Makefile +++ b/www/purritobin/Makefile @@ -6,7 +6,7 @@ CATEGORIES = www net GH_ACCOUNT = PurritoBin GH_PROJECT = PurritoBin -GH_TAGNAME = 0.2.4 +GH_TAGNAME = 0.3.2 HOMEPAGE = https://bsd.ac/ MAINTAINER = Aisha Tammy <open...@aisha.cc> @@ -15,7 +15,7 @@ MAINTAINER = Aisha Tammy <open...@aisha.cc> PERMIT_PACKAGE = Yes # uses pledge() -WANTLIB += ${COMPILER_LIBCXX} c crypto m ssl usockets +WANTLIB += ${COMPILER_LIBCXX} c m usockets # C++2a COMPILER = base-clang ports-gcc @@ -33,4 +33,6 @@ post-install: ${INSTALL_DATA} ${WRKSRC}/clients/POSIX_shell_client.sh \ ${PREFIX}/share/purritobin +FAKE_FLAGS = PREFIX=${TRUEPREFIX} MANDIR=${PREFIX}/man + .include <bsd.port.mk> diff --git a/www/purritobin/distinfo b/www/purritobin/distinfo index 33c301930ff..0b3097c2985 100644 --- a/www/purritobin/distinfo +++ b/www/purritobin/distinfo @@ -1,2 +1,2 @@ -SHA256 (PurritoBin-0.2.4.tar.gz) = 5G3GYiaoE5MzhSZ8jrncitBY1lw0FH8aCNAkahKZfbs= -SIZE (PurritoBin-0.2.4.tar.gz) = 11356 +SHA256 (PurritoBin-0.3.2.tar.gz) = 5UTGcJ8mrZEJtue+ZEoA/cK8Pdw+nw74K6AX9VT23m8= +SIZE (PurritoBin-0.3.2.tar.gz) = 13565 diff --git a/www/purritobin/pkg/PLIST b/www/purritobin/pkg/PLIST index 9dab363c5bb..e1515bd51c3 100644 --- a/www/purritobin/pkg/PLIST +++ b/www/purritobin/pkg/PLIST @@ -3,6 +3,7 @@ @newuser _purritobin:858:858:daemon:PurritoBin Daemon:/nonexistent:/sbin/nologin @rcscript ${RCDIR}/purritobin @bin bin/purrito +@man man/man1/purrito.1 share/doc/pkg-readmes/${PKGSTEM} @owner _purritobin @group _purritobin diff --git a/www/uwebsockets/Makefile b/www/uwebsockets/Makefile index a4d0ef4921b..408d1dcfc26 100644 --- a/www/uwebsockets/Makefile +++ b/www/uwebsockets/Makefile @@ -6,7 +6,7 @@ CATEGORIES = www GH_ACCOUNT = uNetworking GH_PROJECT = uWebSockets -GH_TAGNAME = v18.13.0 +GH_TAGNAME = v18.15.0 MAINTAINER = Aisha Tammy <open...@aisha.cc> diff --git a/www/uwebsockets/distinfo b/www/uwebsockets/distinfo index 74f77a0d285..e261b52d2f5 100644 --- a/www/uwebsockets/distinfo +++ b/www/uwebsockets/distinfo @@ -1,2 +1,2 @@ -SHA256 (uWebSockets-18.13.0.tar.gz) = FpfJml/99xSoLNvhBUlC3HxB5LqyhdmX/c7a0UFRVqQ= -SIZE (uWebSockets-18.13.0.tar.gz) = 270125 +SHA256 (uWebSockets-18.15.0.tar.gz) = /S+n9j5oqUlmjSZMjOdLT+2phBJmrg0AF6L1/uKTqrI= +SIZE (uWebSockets-18.15.0.tar.gz) = 271485 diff --git a/www/uwebsockets/patches/patch-src_Loop_h b/www/uwebsockets/patches/patch-src_Loop_h deleted file mode 100644 index 9817296b835..00000000000 --- a/www/uwebsockets/patches/patch-src_Loop_h +++ /dev/null @@ -1,16 +0,0 @@ -$OpenBSD: patch-src_Loop_h,v 1.1.1.1 2020/06/22 11:39:24 landry Exp $ - -uSockets lives separately from uWebSockets - -Index: src/Loop.h ---- src/Loop.h.orig -+++ src/Loop.h -@@ -21,7 +21,7 @@ - /* The loop is lazily created per-thread and run with uWS::run() */ - - #include "LoopData.h" --#include <libusockets.h> -+#include <uSockets/libusockets.h> - - namespace uWS { - struct Loop { diff --git a/www/uwebsockets/pkg/PLIST b/www/uwebsockets/pkg/PLIST index 72c19062c47..655a6ca11a0 100644 --- a/www/uwebsockets/pkg/PLIST +++ b/www/uwebsockets/pkg/PLIST @@ -14,6 +14,7 @@ include/uWebSockets/Loop.h include/uWebSockets/LoopData.h include/uWebSockets/PerMessageDeflate.h include/uWebSockets/ProxyParser.h +include/uWebSockets/QueryParser.h include/uWebSockets/TopicTree.h include/uWebSockets/Utilities.h include/uWebSockets/WebSocket.h