Gentoo Archives: gentoo-commits

From: Aisha Tammy <gentoo@×××××.cc>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-cpp/usockets/, dev-cpp/usockets/files/
Date: Thu, 30 Apr 2020 17:14:30
Message-Id: 1588266737.d4ff18ce5d8e5c79422128ba7dc36701fe612f4f.epsilon-0@gentoo
1 commit: d4ff18ce5d8e5c79422128ba7dc36701fe612f4f
2 Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
3 AuthorDate: Thu Apr 30 17:12:17 2020 +0000
4 Commit: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
5 CommitDate: Thu Apr 30 17:12:17 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=d4ff18ce
7
8 dev-cpp/usockets: tiny, ultra fast, async sockets framework
9
10 Package-Manager: Portage-2.3.89, Repoman-2.3.20
11 Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
12
13 dev-cpp/usockets/Manifest | 1 +
14 dev-cpp/usockets/files/usockets-Makefile.patch | 54 ++++++++++++++++++++++++++
15 dev-cpp/usockets/metadata.xml | 15 +++++++
16 dev-cpp/usockets/usockets-0.3.5.ebuild | 48 +++++++++++++++++++++++
17 4 files changed, 118 insertions(+)
18
19 diff --git a/dev-cpp/usockets/Manifest b/dev-cpp/usockets/Manifest
20 new file mode 100644
21 index 0000000..ddf126a
22 --- /dev/null
23 +++ b/dev-cpp/usockets/Manifest
24 @@ -0,0 +1 @@
25 +DIST usockets-0.3.5.tar.gz 47939 BLAKE2B fc73f44adc19bd31b78832084a64f2ba3e7b463232056bf67370cf116bf43a0e63734a26fcc833b3d5f917c671cc6fb1983d52c4c92e2f7aae81500df5c5d12d SHA512 a76a469d10e10592b651aa6ccc5d25dfa89015d6b74c8d2268df8eee4206d9194de82ac79079f06f5277803ecfa13cf4bd9ff29bf0ccc98b6ee64798aada796e
26
27 diff --git a/dev-cpp/usockets/files/usockets-Makefile.patch b/dev-cpp/usockets/files/usockets-Makefile.patch
28 new file mode 100644
29 index 0000000..8d10a20
30 --- /dev/null
31 +++ b/dev-cpp/usockets/files/usockets-Makefile.patch
32 @@ -0,0 +1,54 @@
33 +diff --git a/Makefile b/Makefile
34 +index fa6e2ff..9fdcf47 100644
35 +--- a/Makefile
36 ++++ b/Makefile
37 +@@ -1,3 +1,14 @@
38 ++DESTDIR ?=
39 ++
40 ++prefix ?= "/usr/local"
41 ++exec_prefix ?= "$(prefix)"
42 ++libdir ?= "$(exec_prefix)/lib"
43 ++includedir?= "$(exec_prefix)/include/uSockets"
44 ++
45 ++VERSION = 0.3.5
46 ++LIBTARGET = libusockets.so
47 ++
48 ++
49 + # WITH_OPENSSL=1 enables OpenSSL 1.1+ support
50 + ifeq ($(WITH_OPENSSL),1)
51 + override CFLAGS += -DLIBUS_USE_OPENSSL
52 +@@ -35,8 +46,27 @@ endif
53 + override CFLAGS += -std=c11 -Isrc
54 + override LDFLAGS += uSockets.a
55 +
56 +-# By default we build the uSockets.a static library
57 ++# By default we build the libusockets.so shared library
58 + default:
59 ++ rm -f *.o
60 ++ $(CC) $(CFLAGS) $(CPPFLAGS) -fpic -c src/*.c src/eventing/*.c src/crypto/*.c
61 ++ $(CC) -shared -Wl,-soname,libusockets.so -o $(LIBTARGET) *.o
62 ++
63 ++install: default
64 ++ # install the folders needed (making sure that the exist)
65 ++ install -d "$(DESTDIR)$(libdir)" \
66 ++ "$(DESTDIR)$(includedir)/internal/eventing" \
67 ++ "$(DESTDIR)$(includedir)/internal/networking"
68 ++ # install the library first, while making sure that the symlink is updated
69 ++ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)/$(LIBTARGET).$(VERSION)"
70 ++ @ cd "$(DESTDIR)$(libdir)" && ln -snf "$(LIBTARGET).$(VERSION)" "$(LIBTARGET)"
71 ++ # we also install all the header files
72 ++ install -m 644 src/*.h "$(DESTDIR)$(includedir)/"
73 ++ install -m 644 src/internal/*.h "$(DESTDIR)$(includedir)/internal/"
74 ++ install -m 644 src/internal/eventing/*.h "$(DESTDIR)$(includedir)/internal/eventing/"
75 ++ install -m 644 src/internal/networking/*.h "$(DESTDIR)$(includedir)/internal/networking/"
76 ++
77 ++static:
78 + rm -f *.o
79 + $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
80 + $(AR) rvs uSockets.a *.o
81 +@@ -52,4 +82,5 @@ swift_examples:
82 + clean:
83 + rm -f *.o
84 + rm -f *.a
85 ++ rm -f *.so
86 + rm -rf .certs
87
88 diff --git a/dev-cpp/usockets/metadata.xml b/dev-cpp/usockets/metadata.xml
89 new file mode 100644
90 index 0000000..941cb6b
91 --- /dev/null
92 +++ b/dev-cpp/usockets/metadata.xml
93 @@ -0,0 +1,15 @@
94 +<?xml version="1.0" encoding="UTF-8"?>
95 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
96 +<pkgmetadata>
97 + <maintainer type="person">
98 + <email>gentoo@×××××.cc</email>
99 + <name>Aisha Tammy</name>
100 + </maintainer>
101 + <maintainer type="project">
102 + <email>proxy-maint@g.o</email>
103 + <name>Proxy Maintainers</name>
104 + </maintainer>
105 + <use>
106 + <flag name="libuv">Enable bindings to use the libuv dispatcher</flag>
107 + </use>
108 +</pkgmetadata>
109
110 diff --git a/dev-cpp/usockets/usockets-0.3.5.ebuild b/dev-cpp/usockets/usockets-0.3.5.ebuild
111 new file mode 100644
112 index 0000000..d971bed
113 --- /dev/null
114 +++ b/dev-cpp/usockets/usockets-0.3.5.ebuild
115 @@ -0,0 +1,48 @@
116 +# Copyright 2019-2020 Gentoo Authors
117 +# Distributed under the terms of the GNU General Public License v2
118 +
119 +EAPI=7
120 +
121 +inherit multilib
122 +
123 +DESCRIPTION="tiny eventing, networking & crypto for async applications"
124 +HOMEPAGE="https://github.com/uNetworking/uSockets"
125 +
126 +if [[ ${PV} == 9999 ]]; then
127 + inherit git-r3
128 + EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
129 +else
130 + SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
131 + KEYWORDS="~amd64 ~arm64 ~x86"
132 + S="${WORKDIR}/uSockets-${PV}"
133 +fi
134 +
135 +LICENSE="Apache-2.0"
136 +SLOT="0"
137 +IUSE="libuv +ssl libressl debug"
138 +
139 +DEPEND="ssl? (
140 + libressl? ( >=dev-libs/libressl-3.0.0 )
141 + !libressl? ( >=dev-libs/openssl-1.1.0 )
142 + )
143 + libuv? ( dev-libs/libuv )
144 +"
145 +BDEPEND="${DEPEND}"
146 +RDEPEND="${DEPEND}"
147 +
148 +PATCHES=(
149 + "${FILESDIR}/usockets-Makefile.patch"
150 +)
151 +
152 +src_compile() {
153 + # the Makefile uses environment variables
154 + emake WITH_OPENSSL=$(usex ssl 1 0) \
155 + WITH_LIBUV=$(usex libuv 1 0) \
156 + WITH_ASAN=$(usex debug 1 0) \
157 + default
158 +}
159 +
160 +src_install() {
161 + emake libdir="/usr/$(get_libdir)" prefix="/usr" DESTDIR="${D}" install
162 + einstalldocs
163 +}