From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4AF4415808D for ; Fri, 10 Sep 2021 10:45:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2AEC5E097D; Fri, 10 Sep 2021 10:45:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EEB47E097C for ; Fri, 10 Sep 2021 10:45:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 27C60342A59 for ; Fri, 10 Sep 2021 10:45:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 90CE9DC for ; Fri, 10 Sep 2021 10:45:28 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1631203964.c28c5380044fd703e28d2a45b18ef9e078551db9.arthurzam@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: net-libs/usockets/files/, net-libs/usockets/ X-VCS-Repository: repo/proj/guru X-VCS-Files: net-libs/usockets/Manifest net-libs/usockets/files/usockets-0.7.1_p20210909-Makefile.patch net-libs/usockets/metadata.xml net-libs/usockets/usockets-0.7.1_p20210909.ebuild net-libs/usockets/usockets-9999.ebuild X-VCS-Directories: net-libs/usockets/ net-libs/usockets/files/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: c28c5380044fd703e28d2a45b18ef9e078551db9 X-VCS-Branch: master Date: Fri, 10 Sep 2021 10:45:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0c3a7822-6289-41ee-a3a2-0648b420fbed X-Archives-Hash: 3c78a618af4c0dbad17608f88672a6b1 commit: c28c5380044fd703e28d2a45b18ef9e078551db9 Author: Aisha Tammy aisha cc> AuthorDate: Thu Sep 9 16:12:44 2021 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Thu Sep 9 16:12:44 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c28c5380 net-libs/usockets: version bump to latest commit adds new optional dependency on dev-cpp/asio Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Aisha Tammy aisha.cc> net-libs/usockets/Manifest | 1 + .../files/usockets-0.7.1_p20210909-Makefile.patch | 138 +++++++++++++++++++++ net-libs/usockets/metadata.xml | 1 + ...9999.ebuild => usockets-0.7.1_p20210909.ebuild} | 16 ++- net-libs/usockets/usockets-9999.ebuild | 16 ++- 5 files changed, 160 insertions(+), 12 deletions(-) diff --git a/net-libs/usockets/Manifest b/net-libs/usockets/Manifest index aef4019f1..7f03a5189 100644 --- a/net-libs/usockets/Manifest +++ b/net-libs/usockets/Manifest @@ -1 +1,2 @@ DIST usockets-0.7.1_p20210214.tar.gz 62372 BLAKE2B 2853792af6f86954d7920cd33936ddd586cdeb9149dbffd0687b3bbc0965526d28c363864398d17182df9e038c35dc384271f01e72f7a60189319b9e820de3cb SHA512 d4827982a288c81edfcb167cfa6ee8fe11bbae90d25ed9086c006cf6098dfad8b6b910f8fb93ecc67fbea76452627dd4666c7ae3d74fb20112f8e22f7091ec11 +DIST usockets-0.7.1_p20210909.tar.gz 65495 BLAKE2B 23aeb6ec3c330926aa375f0dedf4eb0e63f89fd833145cc3af47936de8ffa2139273710eee7019c2f5c12d7715746a38a6b64a3e48a349a2893599116ca623d8 SHA512 29bac37a75172cdb2881b27d142972a235470e8e0ec85e98c1bfd5f587ab1f777001e69a57bfc46b87a74bf73f4a166300e42e9f0ed908810bcf5c46290abdce diff --git a/net-libs/usockets/files/usockets-0.7.1_p20210909-Makefile.patch b/net-libs/usockets/files/usockets-0.7.1_p20210909-Makefile.patch new file mode 100644 index 000000000..d8efed76f --- /dev/null +++ b/net-libs/usockets/files/usockets-0.7.1_p20210909-Makefile.patch @@ -0,0 +1,138 @@ +diff --git a/Makefile b/Makefile +index b809ac0..857a1f7 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,72 +1,69 @@ ++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 = -fPIC -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 += -lssl -lcrypto -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 ++# WITH_ASIO builds with boost asio event-loop + ifeq ($(WITH_ASIO),1) +- override CFLAGS += -DLIBUS_USE_ASIO +- override LDFLAGS += -lstdc++ -lpthread +- override CXXFLAGS += -pthread -DLIBUS_USE_ASIO ++COMMON_FLAGS += -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 +- +-override CFLAGS += -std=c11 -Isrc +-override LDFLAGS += uSockets.a ++CFLAGS += -std=c11 $(COMMON_FLAGS) ++CXXFLAGS += -std=c++17 $(COMMON_FLAGS) + + # 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 ++ $(CC) $(CFLAGS) -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 ++ $(CXX) $(CXXFLAGS) -c src/eventing/asio.cpp + endif +- +-# 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) -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 ++ $(AR) rvs libusockets.a *.o ++ $(CXX) $(CXXFLAGS) -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 + +-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@ diff --git a/net-libs/usockets/metadata.xml b/net-libs/usockets/metadata.xml index 4e3422276..f4d5bd540 100644 --- a/net-libs/usockets/metadata.xml +++ b/net-libs/usockets/metadata.xml @@ -6,6 +6,7 @@ Aisha Tammy + Enable bindings to use the boost asio dispatcher Enable bindings to use the libuv dispatcher diff --git a/net-libs/usockets/usockets-9999.ebuild b/net-libs/usockets/usockets-0.7.1_p20210909.ebuild similarity index 63% copy from net-libs/usockets/usockets-9999.ebuild copy to net-libs/usockets/usockets-0.7.1_p20210909.ebuild index c08a9ad93..3de0636c4 100644 --- a/net-libs/usockets/usockets-9999.ebuild +++ b/net-libs/usockets/usockets-0.7.1_p20210909.ebuild @@ -12,31 +12,35 @@ if [[ ${PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git" else - SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz" + COMMIT="c06112c89b4c1cf5a09b5f8daa2def756b925889" + SRC_URI="https://github.com/uNetworking/uSockets/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm64 ~x86" - S="${WORKDIR}/uSockets-${PV}" + S="${WORKDIR}/uSockets-${COMMIT}" fi LICENSE="Apache-2.0" SLOT="0" -IUSE="libuv +ssl" +IUSE="asio libuv +ssl" +REQUIRED_USE="?? ( asio libuv )" DEPEND=" + asio? ( dev-cpp/asio[ssl?] ) libuv? ( dev-libs/libuv ) ssl? ( >=dev-libs/openssl-1.1.0 ) " RDEPEND="${DEPEND}" PATCHES=( - "${FILESDIR}/${PN}-0.7.1-Makefile.patch" + "${FILESDIR}/${PN}-0.7.1_p20210909-Makefile.patch" ) src_configure() { tc-export CC CXX AR export VERSION="${PV%_*}" \ LIB="$(get_libdir)" \ - WITH_OPENSSL="$(usex ssl 1 0)" - WITH_LIBUV="$(usex libuv 1 0)" + WITH_OPENSSL="$(usex ssl 1 0)" \ + WITH_LIBUV="$(usex libuv 1 0)" \ + WITH_ASIO="$(usex asio 1 0)" default } diff --git a/net-libs/usockets/usockets-9999.ebuild b/net-libs/usockets/usockets-9999.ebuild index c08a9ad93..3de0636c4 100644 --- a/net-libs/usockets/usockets-9999.ebuild +++ b/net-libs/usockets/usockets-9999.ebuild @@ -12,31 +12,35 @@ if [[ ${PV} == 9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git" else - SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz" + COMMIT="c06112c89b4c1cf5a09b5f8daa2def756b925889" + SRC_URI="https://github.com/uNetworking/uSockets/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm64 ~x86" - S="${WORKDIR}/uSockets-${PV}" + S="${WORKDIR}/uSockets-${COMMIT}" fi LICENSE="Apache-2.0" SLOT="0" -IUSE="libuv +ssl" +IUSE="asio libuv +ssl" +REQUIRED_USE="?? ( asio libuv )" DEPEND=" + asio? ( dev-cpp/asio[ssl?] ) libuv? ( dev-libs/libuv ) ssl? ( >=dev-libs/openssl-1.1.0 ) " RDEPEND="${DEPEND}" PATCHES=( - "${FILESDIR}/${PN}-0.7.1-Makefile.patch" + "${FILESDIR}/${PN}-0.7.1_p20210909-Makefile.patch" ) src_configure() { tc-export CC CXX AR export VERSION="${PV%_*}" \ LIB="$(get_libdir)" \ - WITH_OPENSSL="$(usex ssl 1 0)" - WITH_LIBUV="$(usex libuv 1 0)" + WITH_OPENSSL="$(usex ssl 1 0)" \ + WITH_LIBUV="$(usex libuv 1 0)" \ + WITH_ASIO="$(usex asio 1 0)" default }