update usockets to 0.8.1 from MAINTAINER Aisha Tammy, thanks!
changelogs - v0.7.0: https://github.com/uNetworking/uSockets/releases/tag/v0.7.0 - v0.7.1: https://github.com/uNetworking/uSockets/releases/tag/v0.7.1 - v0.8.0: https://github.com/uNetworking/uSockets/releases/tag/v0.8.0 - v0.8.1: https://github.com/uNetworking/uSockets/releases/tag/v0.8.1
This commit is contained in:
parent
675f3e6dd8
commit
13088714f8
@ -1,40 +1,33 @@
|
||||
# $OpenBSD: Makefile,v 1.5 2020/12/11 22:34:51 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.6 2022/01/31 08:34:58 op Exp $
|
||||
|
||||
COMMENT = eventing, networking & crypto for async applications
|
||||
CATEGORIES = net
|
||||
|
||||
VERSION = 0.6.0
|
||||
REVISION = 1
|
||||
|
||||
DISTNAME = usockets-${VERSION}
|
||||
PKGNAME = ${DISTNAME:L}
|
||||
|
||||
SHARED_LIBS = usockets 1.0
|
||||
CATEGORIES = net
|
||||
|
||||
SHARED_LIBS = usockets 2.0
|
||||
|
||||
GH_ACCOUNT = uNetworking
|
||||
GH_PROJECT = uSockets
|
||||
#GH_TAGNAME = v0.6.0
|
||||
# cstdlib include error
|
||||
GH_COMMIT = 7683672d87067cd75b854f4e36b9820f4809a4be
|
||||
|
||||
GH_TAGNAME = v0.8.1
|
||||
|
||||
MAINTAINER = Aisha Tammy <openbsd@aisha.cc>
|
||||
|
||||
# Apache 2.0
|
||||
PERMIT_PACKAGE = Yes
|
||||
|
||||
WANTLIB += ${COMPILER_LIBCXX} crypto ssl uv
|
||||
WANTLIB += ${COMPILER_LIBCXX} crypto m ssl uv
|
||||
|
||||
# C11 C++17
|
||||
COMPILER = base-clang ports-gcc
|
||||
|
||||
LIB_DEPENDS = devel/libuv
|
||||
|
||||
USE_GMAKE = Yes
|
||||
MAKE_FLAGS = CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \
|
||||
CC="${CC}" CXX="${CXX}" \
|
||||
LIBusockets_VERSION="${LIBusockets_VERSION}"
|
||||
MAKE_ENV = LIBusockets_VERSION="${LIBusockets_VERSION}"
|
||||
|
||||
NO_TEST = Yes
|
||||
# tests need A LOT of file desrciptors ~5000-6000
|
||||
|
||||
post-patch:
|
||||
cp "${FILESDIR}"/{Makefile,libusockets.pc.in,localhost.conf} "${WRKSRC}"
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (usockets-0.6.0-7683672d.tar.gz) = 0OooGCHD8ezNIcaB1zDPK6RQLGGYGZJb24Vemjlat7c=
|
||||
SIZE (usockets-0.6.0-7683672d.tar.gz) = 57634
|
||||
SHA256 (uSockets-0.8.1.tar.gz) = OzO1kkqSV3hU4jJrPi05OEnsAL64ZaEnG/JMDyEMwdY=
|
||||
SIZE (uSockets-0.8.1.tar.gz) = 65470
|
||||
|
38
net/usockets/files/Makefile
Normal file
38
net/usockets/files/Makefile
Normal file
@ -0,0 +1,38 @@
|
||||
# $OpenBSD: Makefile,v 1.1 2022/01/31 08:34:58 op Exp $
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
LIBDIR ?= "$(PREFIX)/lib"
|
||||
INCLUDEDIR ?= "$(PREFIX)/include"
|
||||
|
||||
PKG_CONFIG ?= pkg-config
|
||||
|
||||
LIBTARGET = libusockets.so.$(LIBusockets_VERSION)
|
||||
|
||||
REQUIRES = libcrypto libssl libuv
|
||||
COMMON_FLAGS = -Isrc -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV `$(PKG_CONFIG) --cflags $(REQUIRES)`
|
||||
|
||||
CFLAGS += -std=c11 -fPIC $(COMMON_FLAGS)
|
||||
CXXFLAGS += -std=c++17 -fPIC $(COMMON_FLAGS)
|
||||
LDFLAGS += `$(PKG_CONFIG) --libs $(REQUIRES)`
|
||||
|
||||
all:
|
||||
$(CC) $(CFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c
|
||||
$(CXX) $(CXXFLAGS) -c src/crypto/*.cpp
|
||||
$(AR) rcvs libusockets.a *.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) $(LDFLAGS)
|
||||
sed -e "s:@PREFIX@:$(PREFIX):" -e "s:@VERSION@:$(LIBusockets_VERSION):" libusockets.pc.in > libusockets.pc
|
||||
|
||||
install:
|
||||
install -d "$(LIBDIR)/pkgconfig" "$(INCLUDEDIR)"
|
||||
install -m 644 src/libusockets.h "$(INCLUDEDIR)/"
|
||||
install -m 644 $(LIBTARGET) "$(LIBDIR)/"
|
||||
install -m 644 libusockets.a "$(LIBDIR)/"
|
||||
install -m 644 libusockets.pc "$(LIBDIR)/pkgconfig/"
|
||||
|
||||
test:
|
||||
rm -f localhost.pem localhost.crt
|
||||
openssl req -x509 -out localhost.crt -keyout localhost.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -extensions EXT -config localhost.conf
|
||||
$(CC) $(CXXFLAGS) libusockets.a examples/hammer_test.c -o hammer_test $(LDFLAGS)
|
||||
./hammer_test
|
||||
|
||||
.PHONY: all install test
|
13
net/usockets/files/libusockets.pc.in
Normal file
13
net/usockets/files/libusockets.pc.in
Normal file
@ -0,0 +1,13 @@
|
||||
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: -lcrypto -lssl
|
||||
Requires.private: libuv
|
8
net/usockets/files/localhost.conf
Normal file
8
net/usockets/files/localhost.conf
Normal file
@ -0,0 +1,8 @@
|
||||
[dn]
|
||||
CN=localhost
|
||||
[req]
|
||||
distinguished_name = dn
|
||||
[EXT]
|
||||
subjectAltName=DNS:localhost
|
||||
keyUsage=digitalSignature
|
||||
extendedKeyUsage=serverAuth
|
@ -1,98 +0,0 @@
|
||||
$OpenBSD: patch-Makefile,v 1.3 2020/12/11 22:33:22 sthen Exp $
|
||||
|
||||
add shared + static lib + pkg-config file
|
||||
remove -flto -O3
|
||||
|
||||
Index: Makefile
|
||||
--- Makefile.orig
|
||||
+++ Makefile
|
||||
@@ -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 ?=
|
||||
|
||||
-# 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_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 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
|
||||
- $(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
|
||||
-ifeq ($(WITH_OPENSSL),1)
|
||||
- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
|
||||
-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 -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 -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 -f libusockets.pc
|
||||
+
|
||||
+.PHONY: all install clean
|
||||
+
|
17
net/usockets/patches/patch-examples_hammer_test_c
Normal file
17
net/usockets/patches/patch-examples_hammer_test_c
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: patch-examples_hammer_test_c,v 1.1 2022/01/31 08:34:58 op Exp $
|
||||
|
||||
Index: examples/hammer_test.c
|
||||
--- examples/hammer_test.c.orig
|
||||
+++ examples/hammer_test.c
|
||||
@@ -403,9 +403,8 @@ int main() {
|
||||
|
||||
// these are ignored for non-SSL
|
||||
struct us_socket_context_options_t options = {};
|
||||
- options.key_file_name = "/home/alexhultman/uWebSockets.js/misc/key.pem";
|
||||
- options.cert_file_name = "/home/alexhultman/uWebSockets.js/misc/cert.pem";
|
||||
- options.passphrase = "1234";
|
||||
+ options.key_file_name = "localhost.pem";
|
||||
+ options.cert_file_name = "localhost.crt";
|
||||
|
||||
http_context = us_create_socket_context(SSL, loop, sizeof(struct http_context), options);
|
||||
|
@ -1,20 +0,0 @@
|
||||
$OpenBSD: patch-libusockets_pc_in,v 1.1 2020/12/11 22:34:51 sthen Exp $
|
||||
|
||||
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: -lcrypto -lssl
|
||||
+Requires.private: libuv
|
||||
+
|
Loading…
Reference in New Issue
Block a user