diff options
author | lanthora | 2023-03-30 14:38:07 +0000 |
---|---|---|
committer | lanthora | 2023-03-30 14:38:07 +0000 |
commit | 15afd384112d96845e9313931b88061bedc75dbe (patch) | |
tree | 41d1f513c8b27bb954ddf1e9101d23b4f304f12a | |
parent | c29f1b38be72925a81364ee61dca30473e1544e4 (diff) | |
download | aur-15afd384112d96845e9313931b88061bedc75dbe.tar.gz |
updated to 0.8.5
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | usockets-0.6.0-Makefile.patch | 124 | ||||
-rw-r--r-- | usockets-0.8.5-Makefile.patch | 159 |
4 files changed, 172 insertions, 140 deletions
@@ -1,14 +1,12 @@ pkgbase = usockets pkgdesc = Miniscule cross-platform eventing, networking & crypto for async applications - pkgver = 0.6.0 + pkgver = 0.8.5 pkgrel = 1 - epoch = 1 url = https://github.com/uNetworking/uSockets - arch = any + arch = x86_64 license = Apache depends = openssl - source = https://github.com/uNetworking/uSockets/archive/7683672d87067cd75b854f4e36b9820f4809a4be.tar.gz - md5sums = 4b98fcca9965e73ba749ea3404e5614e + source = https://github.com/uNetworking/uSockets/archive/refs/tags/v0.8.5.tar.gz + md5sums = e07e6a53cba781455fcf3cf71e9760c3 pkgname = usockets - @@ -1,31 +1,30 @@ +# Maintainer: lanthora <lanthora at outlook dot com> # Maintainer epsilonKNOT <epsilon.aur@epsilonKNOT.xyz> pkgbase=usockets pkgname=usockets -pkgver=0.6.0 -epoch=1 +pkgver=0.8.5 pkgrel=1 pkgdesc="Miniscule cross-platform eventing, networking & crypto for async applications" url="https://github.com/uNetworking/uSockets" license=('Apache') -arch=('any') -_commit='7683672d87067cd75b854f4e36b9820f4809a4be' -source=( "https://github.com/uNetworking/uSockets/archive/${_commit}.tar.gz" ) -md5sums=('4b98fcca9965e73ba749ea3404e5614e') +arch=('x86_64') +source=( "https://github.com/uNetworking/uSockets/archive/refs/tags/v${pkgver}.tar.gz" ) +md5sums=('e07e6a53cba781455fcf3cf71e9760c3') depends=( openssl ) prepare() { - cd "uSockets-$_commit" - patch < ../../usockets-0.6.0-Makefile.patch + cd "uSockets-$pkgver" + patch < ../../usockets-$pkgver-Makefile.patch } build() { - cd "uSockets-$_commit" + cd "uSockets-$pkgver" make VERSION=$pkgver WITH_OPENSSL=1 default } package() { - cd "uSockets-$_commit" + cd "uSockets-$pkgver" make VERSION=$pkgver DESTDIR="$pkgdir/" install } diff --git a/usockets-0.6.0-Makefile.patch b/usockets-0.6.0-Makefile.patch deleted file mode 100644 index 4994b29d9072..000000000000 --- a/usockets-0.6.0-Makefile.patch +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/Makefile b/Makefile -index 27f97ce..f8bf8d7 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,60 +1,59 @@ -+DESTDIR ?= -+ -+prefix ?= /usr -+exec_prefix ?= $(prefix) -+LIB ?= lib -+libdir ?= $(exec_prefix)/$(LIB) -+includedir ?= $(exec_prefix)/include -+ -+PKG_CONFIG ?= pkg-config -+ -+VERSION ?= 0.0 -+LIBTARGET = libusockets.so.$(VERSION) -+ -+REQUIRES = -+COMMON_FLAGS = -Isrc -+ - # 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 -+COMMON_FLAGS += -DLIBUS_USE_OPENSSL -+LDFLAGS += -lstdc++ -+REQUIRES += libssl libcrypto - endif - - # WITH_LIBUV=1 builds with libuv as event-loop - ifeq ($(WITH_LIBUV),1) -- override CFLAGS += -DLIBUS_USE_LIBUV -- override LDFLAGS += -luv -+COMMON_FLAGS += -DLIBUS_USE_LIBUV -+REQUIRES += libuv - endif - --# WITH_GCD=1 builds with libdispatch as event-loop --ifeq ($(WITH_GCD),1) -- override CFLAGS += -DLIBUS_USE_GCD -- override LDFLAGS += -framework CoreFoundation --endif -+CFLAGS += -std=c11 $(COMMON_FLAGS) -+CXXFLAGS += -std=c++17 $(COMMON_FLAGS) - --# WITH_ASAN builds with sanitizers --ifeq ($(WITH_ASAN),1) -- override CFLAGS += -fsanitize=address -g -- override LDFLAGS += -lasan --endif -- --override CFLAGS += -std=c11 -Isrc --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 --# For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11 -+ $(CC) $(CFLAGS) -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c - ifeq ($(WITH_OPENSSL),1) -- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp -+ $(CXX) $(CXXFLAGS) -fPIC -c src/crypto/*.cpp - endif -- $(AR) rvs uSockets.a *.o -- --# Builds all examples --.PHONY: examples --examples: default -- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done -- --swift_examples: -- swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server -+ $(AR) rvs libusockets.a *.o -+ $(CC) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) `$(PKG_CONFIG) --libs $(REQUIRES)` $(LDFLAGS) -+ sed -e "s:@PREFIX@:$(prefix):" -e "s:@REQUIRES@:$(REQUIRES):" \ -+ -e "s:@LIB@:$(LIB):" -e "s:@VERSION@:$(VERSION):" libusockets.pc.in > libusockets.pc -+ -+install: -+ install -d "$(DESTDIR)$(libdir)/pkgconfig" "$(DESTDIR)$(includedir)" -+ install -m 644 src/libusockets.h "$(DESTDIR)$(includedir)/" -+ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)" -+ ln -sf $(LIBTARGET) "$(DESTDIR)$(libdir)/libusockets.so" -+ install -m 755 libusockets.a "$(DESTDIR)$(libdir)/" -+ install -m 644 libusockets.pc "$(DESTDIR)$(libdir)/pkgconfig/" - - clean: - rm -f *.o - rm -f *.a -+ rm -f *.so - rm -rf .certs -+ rm -f libusockets.pc -+ -+.PHONY: default install clean -diff --git a/libusockets.pc.in b/libusockets.pc.in -new file mode 100644 -index 0000000..b818020 ---- /dev/null -+++ b/libusockets.pc.in -@@ -0,0 +1,12 @@ -+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 -+Requires.private: @REQUIRES@ diff --git a/usockets-0.8.5-Makefile.patch b/usockets-0.8.5-Makefile.patch new file mode 100644 index 000000000000..a19e6154bd1d --- /dev/null +++ b/usockets-0.8.5-Makefile.patch @@ -0,0 +1,159 @@ +diff --git a/Makefile b/Makefile +index f6e2c6b..59c6e1a 100644 +--- a/Makefile ++++ b/Makefile +@@ -3,96 +3,63 @@ ifneq ($(WITH_LTO),0) + override CFLAGS += -flto + endif + ++DESTDIR ?= ++ ++prefix ?= /usr ++exec_prefix ?= $(prefix) ++LIB ?= lib ++libdir ?= $(exec_prefix)/$(LIB) ++includedir ?= $(exec_prefix)/include ++ ++PKG_CONFIG ?= pkg-config ++ ++VERSION ?= 0.0 ++LIBTARGET = libusockets.so.$(VERSION) ++ ++REQUIRES = ++COMMON_FLAGS = -Isrc ++ + # WITH_BORINGSSL=1 enables BoringSSL support, linked statically (preferred over OpenSSL) + # You need to call "make boringssl" before + ifeq ($(WITH_BORINGSSL),1) +- override CFLAGS += -Iboringssl/include -pthread -DLIBUS_USE_OPENSSL +- override LDFLAGS += -pthread boringssl/build/ssl/libssl.a boringssl/build/crypto/libcrypto.a -lstdc++ +-else +- # WITH_OPENSSL=1 enables OpenSSL 1.1+ support +- # 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 ++COMMON_FLAGS += -DLIBUS_USE_OPENSSL ++LDFLAGS += -lstdc++ ++REQUIRES += libssl libcrypto + endif + + # WITH_LIBUV=1 builds with libuv as event-loop + ifeq ($(WITH_LIBUV),1) +- override CFLAGS += -DLIBUS_USE_LIBUV +- override LDFLAGS += -luv ++COMMON_FLAGS += -DLIBUS_USE_LIBUV ++REQUIRES += libuv + endif + +-# WITH_ASIO builds with boot asio event-loop +-ifeq ($(WITH_ASIO),1) +- override CFLAGS += -DLIBUS_USE_ASIO +- override LDFLAGS += -lstdc++ -lpthread +- override CXXFLAGS += -pthread -DLIBUS_USE_ASIO +-endif +- +-# WITH_GCD=1 builds with libdispatch as event-loop +-ifeq ($(WITH_GCD),1) +- override CFLAGS += -DLIBUS_USE_GCD +- override LDFLAGS += -framework CoreFoundation +-endif +- +-# WITH_ASAN builds with sanitizers +-ifeq ($(WITH_ASAN),1) +- override CFLAGS += -fsanitize=address -g +- override LDFLAGS += -fsanitize=address +-endif ++CFLAGS += -std=c11 $(COMMON_FLAGS) ++CXXFLAGS += -std=c++17 $(COMMON_FLAGS) + +-ifeq ($(WITH_QUIC),1) +- override CFLAGS += -DLIBUS_USE_QUIC -pthread -std=c11 -Isrc -Ilsquic/include +- override LDFLAGS += -pthread -lz -lm uSockets.a lsquic/src/liblsquic/liblsquic.a +-else +- override CFLAGS += -std=c11 -Isrc +- override LDFLAGS += uSockets.a +-endif +- +-# By default we build the uSockets.a static library + default: +- rm -f *.o +- $(CC) $(CFLAGS) -O3 -c src/*.c src/eventing/*.c src/crypto/*.c +-# Also link in Boost Asio support +-ifeq ($(WITH_ASIO),1) +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp +-endif ++ $(CC) $(CFLAGS) -fPIC -c -I src 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 ++ $(CXX) $(CXXFLAGS) -fPIC -c -I src src/crypto/*.cpp + endif +-ifeq ($(WITH_BORINGSSL),1) +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp +-endif +-# Create a static library (try windows, then unix) +- lib.exe /out:uSockets.a *.o || $(AR) rvs uSockets.a *.o +- +-# BoringSSL needs cmake and golang +-.PHONY: boringssl +-boringssl: +- cd boringssl && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j8 ++ $(AR) rvs libusockets.a *.o ++ $(CC) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) `$(PKG_CONFIG) --libs $(REQUIRES)` $(LDFLAGS) ++ sed -e "s:@PREFIX@:$(prefix):" -e "s:@REQUIRES@:$(REQUIRES):" \ ++ -e "s:@LIB@:$(LIB):" -e "s:@VERSION@:$(VERSION):" libusockets.pc.in > libusockets.pc + +-# Builds all examples +-.PHONY: examples +-examples: default +- for f in examples/*.c; do $(CC) -O3 $(CFLAGS) -o $$(basename "$$f" ".c")$(EXEC_SUFFIX) "$$f" $(LDFLAGS); done +- +-swift_examples: +- swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server ++install: ++ install -d "$(DESTDIR)$(libdir)/pkgconfig" "$(DESTDIR)$(includedir)" ++ install -m 644 src/libusockets.h "$(DESTDIR)$(includedir)/" ++ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)" ++ ln -sf $(LIBTARGET) "$(DESTDIR)$(libdir)/libusockets.so" ++ install -m 755 libusockets.a "$(DESTDIR)$(libdir)/" ++ install -m 644 libusockets.pc "$(DESTDIR)$(libdir)/pkgconfig/" + + clean: + rm -f *.o + rm -f *.a ++ rm -f *.so + rm -rf .certs ++ rm -f libusockets.pc ++ ++.PHONY: default install clean +diff --git a/libusockets.pc.in b/libusockets.pc.in +new file mode 100644 +index 0000000..b818020 +--- /dev/null ++++ b/libusockets.pc.in +@@ -0,0 +1,12 @@ ++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 ++Requires.private: @REQUIRES@ |