commit:     1713cdefbadcab1daa9340c5fd13611d7e7454a9
Author:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
AuthorDate: Tue Sep  8 20:33:25 2020 +0000
Commit:     Aisha Tammy <gentoo <AT> aisha <DOT> cc>
CommitDate: Tue Sep  8 20:33:25 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1713cdef

net-libs/usockets: version bump

Package-Manager: Portage-3.0.5, Repoman-3.0.1
Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>

 net-libs/usockets/Manifest                      |  1 +
 net-libs/usockets/files/usockets-Makefile.patch | 24 ++++++-----
 net-libs/usockets/usockets-0.6.0.ebuild         | 54 +++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 10 deletions(-)

diff --git a/net-libs/usockets/Manifest b/net-libs/usockets/Manifest
index 8d649f4a..af6d36e3 100644
--- a/net-libs/usockets/Manifest
+++ b/net-libs/usockets/Manifest
@@ -1 +1,2 @@
 DIST usockets-0.5.0.tar.gz 50852 BLAKE2B 
69d36f4bad6e2bf87a8b33a023678b29d2aa2feea86ccd92d02d38e9b336d9b97a0d9709b381d7b2b1a20c86964eaa9fec8d7edaa322288b232ce7c3ea84f056
 SHA512 
ac734c1e6f50b0485456d5b0f06d6aeb5457b2b3cc1fc2c795773a469e0bdf7223256ba252d1f9cbead10948ca47ce8bcdbabc147fc3e6be59d1a051409375bd
+DIST usockets-0.6.0.tar.gz 57590 BLAKE2B 
8438a3d2a1861d995410fcda8b888d561de2fb51af319e58c529f1113cb8e4d0f821b1649618c28d43dbc64f28b6b4e90f7e0bd51fcabc5afdc8318ca8f21448
 SHA512 
0803a117334d4dc38b4936e6f1d34984a9fba30da1c360c3ff3d7ce14275a4ac9c4a4e7b407791fc3661c50be6b6a8335d26f808b21d0ade5f85ab721b14a500

diff --git a/net-libs/usockets/files/usockets-Makefile.patch 
b/net-libs/usockets/files/usockets-Makefile.patch
index 5a105704..c641db0b 100644
--- a/net-libs/usockets/files/usockets-Makefile.patch
+++ b/net-libs/usockets/files/usockets-Makefile.patch
@@ -1,31 +1,36 @@
 diff --git a/Makefile b/Makefile
-index 7d33414..6f3e53a 100644
+index 27f97ce..1a01539 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -1,3 +1,13 @@
 +DESTDIR ?=
 +
-+prefix ?=     "/usr/local"
-+exec_prefix ?=        "$(prefix)"
-+libdir ?=     "$(exec_prefix)/lib"
-+includedir?=  "$(exec_prefix)/include/uSockets"
++prefix ?=       "/usr/local"
++exec_prefix ?=  "$(prefix)"
++libdir ?=       "$(exec_prefix)/lib"
++includedir?=    "$(exec_prefix)/include/uSockets"
 +
 +# OpenBSD specific library version
-+LIBTARGET =   libusockets.so.$(LIBusockets_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)
-       override CFLAGS += -DLIBUS_USE_OPENSSL
-@@ -33,13 +43,27 @@ ifeq ($(WITH_ASAN),1)
+@@ -34,17 +44,28 @@ ifeq ($(WITH_ASAN),1)
  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
+-ifeq ($(WITH_OPENSSL),1)
+-      $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
+-endif
 -      $(AR) rvs uSockets.a *.o
 +      $(CC) -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c $(CFLAGS)
 +      $(AR) rvs libusockets.a *.o
@@ -48,10 +53,9 @@ index 7d33414..6f3e53a 100644
  
  # Builds all examples
  .PHONY: examples
-@@ -52,4 +76,6 @@ swift_examples:
+@@ -57,4 +78,5 @@ swift_examples:
  clean:
        rm -f *.o
        rm -f *.a
 +      rm -f *.so
        rm -rf .certs
-+

diff --git a/net-libs/usockets/usockets-0.6.0.ebuild 
b/net-libs/usockets/usockets-0.6.0.ebuild
new file mode 100644
index 00000000..07f68285
--- /dev/null
+++ b/net-libs/usockets/usockets-0.6.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 2019-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib
+
+DESCRIPTION="tiny eventing, networking & crypto for async applications"
+HOMEPAGE="https://github.com/uNetworking/uSockets";
+
+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"
+       KEYWORDS="~amd64 ~arm64 ~x86"
+       S="${WORKDIR}/uSockets-${PV}"
+fi
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="libuv +ssl libressl static-libs"
+
+DEPEND="ssl? (
+               libressl? ( >=dev-libs/libressl-3.0.0:=[static-libs?] )
+               !libressl? ( >=dev-libs/openssl-1.1.0:=[static-libs?] )
+       )
+       libuv? ( dev-libs/libuv[static-libs?] )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/usockets-Makefile.patch"
+)
+
+src_compile() {
+       # the Makefile uses environment variables
+       emake LIBusockets_VERSION=${PV} \
+             WITH_OPENSSL=$(usex ssl 1 0) \
+             WITH_LIBUV=$(usex libuv 1 0) \
+             default
+}
+
+src_install() {
+       emake libdir="/usr/$(get_libdir)" \
+             prefix="/usr" \
+                 DESTDIR="${D}" \
+             LIBusockets_VERSION=${PV} \
+             install
+       einstalldocs
+       if ! use static-libs; then
+               rm "${D}/usr/$(get_libdir)/libusockets.a" || die
+       fi
+}

Reply via email to