Gentoo Archives: gentoo-commits

From: Aisha Tammy <gentoo@×××××.cc>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-libs/usockets/files/, net-libs/usockets/
Date: Thu, 09 Sep 2021 16:14:46
Message-Id: 1631203964.c28c5380044fd703e28d2a45b18ef9e078551db9.epsilon-0@gentoo
1 commit: c28c5380044fd703e28d2a45b18ef9e078551db9
2 Author: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
3 AuthorDate: Thu Sep 9 16:12:44 2021 +0000
4 Commit: Aisha Tammy <gentoo <AT> aisha <DOT> cc>
5 CommitDate: Thu Sep 9 16:12:44 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c28c5380
7
8 net-libs/usockets: version bump to latest commit
9
10 adds new optional dependency on dev-cpp/asio
11
12 Package-Manager: Portage-3.0.18, Repoman-3.0.3
13 Signed-off-by: Aisha Tammy <gentoo <AT> aisha.cc>
14
15 net-libs/usockets/Manifest | 1 +
16 .../files/usockets-0.7.1_p20210909-Makefile.patch | 138 +++++++++++++++++++++
17 net-libs/usockets/metadata.xml | 1 +
18 ...9999.ebuild => usockets-0.7.1_p20210909.ebuild} | 16 ++-
19 net-libs/usockets/usockets-9999.ebuild | 16 ++-
20 5 files changed, 160 insertions(+), 12 deletions(-)
21
22 diff --git a/net-libs/usockets/Manifest b/net-libs/usockets/Manifest
23 index aef4019f1..7f03a5189 100644
24 --- a/net-libs/usockets/Manifest
25 +++ b/net-libs/usockets/Manifest
26 @@ -1 +1,2 @@
27 DIST usockets-0.7.1_p20210214.tar.gz 62372 BLAKE2B 2853792af6f86954d7920cd33936ddd586cdeb9149dbffd0687b3bbc0965526d28c363864398d17182df9e038c35dc384271f01e72f7a60189319b9e820de3cb SHA512 d4827982a288c81edfcb167cfa6ee8fe11bbae90d25ed9086c006cf6098dfad8b6b910f8fb93ecc67fbea76452627dd4666c7ae3d74fb20112f8e22f7091ec11
28 +DIST usockets-0.7.1_p20210909.tar.gz 65495 BLAKE2B 23aeb6ec3c330926aa375f0dedf4eb0e63f89fd833145cc3af47936de8ffa2139273710eee7019c2f5c12d7715746a38a6b64a3e48a349a2893599116ca623d8 SHA512 29bac37a75172cdb2881b27d142972a235470e8e0ec85e98c1bfd5f587ab1f777001e69a57bfc46b87a74bf73f4a166300e42e9f0ed908810bcf5c46290abdce
29
30 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
31 new file mode 100644
32 index 000000000..d8efed76f
33 --- /dev/null
34 +++ b/net-libs/usockets/files/usockets-0.7.1_p20210909-Makefile.patch
35 @@ -0,0 +1,138 @@
36 +diff --git a/Makefile b/Makefile
37 +index b809ac0..857a1f7 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,72 +1,69 @@
41 ++DESTDIR ?=
42 ++
43 ++prefix ?= /usr
44 ++exec_prefix ?= $(prefix)
45 ++LIB ?= lib
46 ++libdir ?= $(exec_prefix)/$(LIB)
47 ++includedir ?= $(exec_prefix)/include
48 ++
49 ++PKG_CONFIG ?= pkg-config
50 ++
51 ++VERSION ?= 0.0
52 ++LIBTARGET = libusockets.so.$(VERSION)
53 ++
54 ++REQUIRES =
55 ++COMMON_FLAGS = -fPIC -Isrc
56 ++
57 + # WITH_OPENSSL=1 enables OpenSSL 1.1+ support or BoringSSL
58 + # For now we need to link with C++ for OpenSSL support, but should be removed with time
59 + ifeq ($(WITH_OPENSSL),1)
60 +- override CFLAGS += -DLIBUS_USE_OPENSSL
61 +- # With problems on macOS, make sure to pass needed LDFLAGS required to find these
62 +- override LDFLAGS += -lssl -lcrypto -lstdc++
63 +-else
64 +- # WITH_WOLFSSL=1 enables WolfSSL 4.2.0 support (mutually exclusive with OpenSSL)
65 +- ifeq ($(WITH_WOLFSSL),1)
66 +- # todo: change these
67 +- override CFLAGS += -DLIBUS_USE_WOLFSSL -I/usr/local/include
68 +- override LDFLAGS += -L/usr/local/lib -lwolfssl
69 +- else
70 +- override CFLAGS += -DLIBUS_NO_SSL
71 +- endif
72 ++COMMON_FLAGS += -DLIBUS_USE_OPENSSL
73 ++LDFLAGS += -lssl -lcrypto -lstdc++
74 ++REQUIRES += libssl libcrypto
75 + endif
76 +
77 + # WITH_LIBUV=1 builds with libuv as event-loop
78 + ifeq ($(WITH_LIBUV),1)
79 +- override CFLAGS += -DLIBUS_USE_LIBUV
80 +- override LDFLAGS += -luv
81 ++COMMON_FLAGS += -DLIBUS_USE_LIBUV
82 ++REQUIRES += libuv
83 + endif
84 +
85 +-# WITH_ASIO builds with boot asio event-loop
86 ++# WITH_ASIO builds with boost asio event-loop
87 + ifeq ($(WITH_ASIO),1)
88 +- override CFLAGS += -DLIBUS_USE_ASIO
89 +- override LDFLAGS += -lstdc++ -lpthread
90 +- override CXXFLAGS += -pthread -DLIBUS_USE_ASIO
91 ++COMMON_FLAGS += -pthread -DLIBUS_USE_ASIO
92 + endif
93 +
94 +-# WITH_GCD=1 builds with libdispatch as event-loop
95 +-ifeq ($(WITH_GCD),1)
96 +- override CFLAGS += -DLIBUS_USE_GCD
97 +- override LDFLAGS += -framework CoreFoundation
98 +-endif
99 +-
100 +-# WITH_ASAN builds with sanitizers
101 +-ifeq ($(WITH_ASAN),1)
102 +- override CFLAGS += -fsanitize=address -g
103 +- override LDFLAGS += -fsanitize=address
104 +-endif
105 +-
106 +-override CFLAGS += -std=c11 -Isrc
107 +-override LDFLAGS += uSockets.a
108 ++CFLAGS += -std=c11 $(COMMON_FLAGS)
109 ++CXXFLAGS += -std=c++17 $(COMMON_FLAGS)
110 +
111 + # By default we build the uSockets.a static library
112 + default:
113 +- rm -f *.o
114 +- $(CC) $(CFLAGS) -flto -O3 -c src/*.c src/eventing/*.c src/crypto/*.c
115 ++ $(CC) $(CFLAGS) -c src/*.c src/eventing/*.c src/crypto/*.c
116 + # Also link in Boost Asio support
117 + ifeq ($(WITH_ASIO),1)
118 +- $(CXX) $(CXXFLAGS) -Isrc -std=c++14 -flto -O3 -c src/eventing/asio.cpp
119 ++ $(CXX) $(CXXFLAGS) -c src/eventing/asio.cpp
120 + endif
121 +-
122 +-# For now we do rely on C++17 for OpenSSL support but we will be porting this work to C11
123 + ifeq ($(WITH_OPENSSL),1)
124 +- $(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
125 ++ $(CXX) $(CXXFLAGS) -c src/crypto/*.cpp
126 + endif
127 +- $(AR) rvs uSockets.a *.o
128 +-
129 +-# Builds all examples
130 +-.PHONY: examples
131 +-examples: default
132 +- for f in examples/*.c; do $(CC) -flto -O3 $(CFLAGS) -o $$(basename "$$f" ".c") "$$f" $(LDFLAGS); done
133 ++ $(AR) rvs libusockets.a *.o
134 ++ $(CXX) $(CXXFLAGS) -shared -o $(LIBTARGET) *.o -Wl,-soname,$(LIBTARGET) `$(PKG_CONFIG) --libs $(REQUIRES)` $(LDFLAGS)
135 ++ sed -e "s:@PREFIX@:$(prefix):" -e "s:@REQUIRES@:$(REQUIRES):" \
136 ++ -e "s:@LIB@:$(LIB):" -e "s:@VERSION@:$(VERSION):" libusockets.pc.in > libusockets.pc
137 +
138 +-swift_examples:
139 +- swiftc -O -I . examples/swift_http_server/main.swift uSockets.a -o swift_http_server
140 ++install:
141 ++ install -d "$(DESTDIR)$(libdir)/pkgconfig" "$(DESTDIR)$(includedir)"
142 ++ install -m 644 src/libusockets.h "$(DESTDIR)$(includedir)/"
143 ++ install -m 755 $(LIBTARGET) "$(DESTDIR)$(libdir)"
144 ++ ln -sf $(LIBTARGET) "$(DESTDIR)$(libdir)/libusockets.so"
145 ++ install -m 755 libusockets.a "$(DESTDIR)$(libdir)/"
146 ++ install -m 644 libusockets.pc "$(DESTDIR)$(libdir)/pkgconfig/"
147 +
148 + clean:
149 + rm -f *.o
150 + rm -f *.a
151 ++ rm -f *.so
152 + rm -rf .certs
153 ++ rm -f libusockets.pc
154 ++
155 ++.PHONY: default install clean
156 +diff --git a/libusockets.pc.in b/libusockets.pc.in
157 +new file mode 100644
158 +index 0000000..b818020
159 +--- /dev/null
160 ++++ b/libusockets.pc.in
161 +@@ -0,0 +1,12 @@
162 ++prefix=@PREFIX@
163 ++libdir=${prefix}/@LIB@
164 ++includedir=${prefix}/include
165 ++
166 ++Name: uSockets
167 ++Version: @VERSION@
168 ++Description: eventing, networking and crypto for async applications.
169 ++URL: https://github.com/uNetworking/uSockets
170 ++
171 ++Cflags: -I${includedir}
172 ++Libs: -L${libdir} -lusockets
173 ++Requires.private: @REQUIRES@
174
175 diff --git a/net-libs/usockets/metadata.xml b/net-libs/usockets/metadata.xml
176 index 4e3422276..f4d5bd540 100644
177 --- a/net-libs/usockets/metadata.xml
178 +++ b/net-libs/usockets/metadata.xml
179 @@ -6,6 +6,7 @@
180 <name>Aisha Tammy</name>
181 </maintainer>
182 <use>
183 + <flag name="asio">Enable bindings to use the boost asio dispatcher</flag>
184 <flag name="libuv">Enable bindings to use the libuv dispatcher</flag>
185 </use>
186 </pkgmetadata>
187
188 diff --git a/net-libs/usockets/usockets-9999.ebuild b/net-libs/usockets/usockets-0.7.1_p20210909.ebuild
189 similarity index 63%
190 copy from net-libs/usockets/usockets-9999.ebuild
191 copy to net-libs/usockets/usockets-0.7.1_p20210909.ebuild
192 index c08a9ad93..3de0636c4 100644
193 --- a/net-libs/usockets/usockets-9999.ebuild
194 +++ b/net-libs/usockets/usockets-0.7.1_p20210909.ebuild
195 @@ -12,31 +12,35 @@ if [[ ${PV} == 9999 ]]; then
196 inherit git-r3
197 EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
198 else
199 - SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
200 + COMMIT="c06112c89b4c1cf5a09b5f8daa2def756b925889"
201 + SRC_URI="https://github.com/uNetworking/uSockets/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
202 KEYWORDS="~amd64 ~arm64 ~x86"
203 - S="${WORKDIR}/uSockets-${PV}"
204 + S="${WORKDIR}/uSockets-${COMMIT}"
205 fi
206
207 LICENSE="Apache-2.0"
208 SLOT="0"
209 -IUSE="libuv +ssl"
210 +IUSE="asio libuv +ssl"
211 +REQUIRED_USE="?? ( asio libuv )"
212
213 DEPEND="
214 + asio? ( dev-cpp/asio[ssl?] )
215 libuv? ( dev-libs/libuv )
216 ssl? ( >=dev-libs/openssl-1.1.0 )
217 "
218 RDEPEND="${DEPEND}"
219
220 PATCHES=(
221 - "${FILESDIR}/${PN}-0.7.1-Makefile.patch"
222 + "${FILESDIR}/${PN}-0.7.1_p20210909-Makefile.patch"
223 )
224
225 src_configure() {
226 tc-export CC CXX AR
227 export VERSION="${PV%_*}" \
228 LIB="$(get_libdir)" \
229 - WITH_OPENSSL="$(usex ssl 1 0)"
230 - WITH_LIBUV="$(usex libuv 1 0)"
231 + WITH_OPENSSL="$(usex ssl 1 0)" \
232 + WITH_LIBUV="$(usex libuv 1 0)" \
233 + WITH_ASIO="$(usex asio 1 0)"
234 default
235 }
236
237
238 diff --git a/net-libs/usockets/usockets-9999.ebuild b/net-libs/usockets/usockets-9999.ebuild
239 index c08a9ad93..3de0636c4 100644
240 --- a/net-libs/usockets/usockets-9999.ebuild
241 +++ b/net-libs/usockets/usockets-9999.ebuild
242 @@ -12,31 +12,35 @@ if [[ ${PV} == 9999 ]]; then
243 inherit git-r3
244 EGIT_REPO_URI="https://github.com/uNetworking/uSockets.git"
245 else
246 - SRC_URI="https://github.com/uNetworking/uSockets/archive/v${PV}.tar.gz -> ${P}.tar.gz"
247 + COMMIT="c06112c89b4c1cf5a09b5f8daa2def756b925889"
248 + SRC_URI="https://github.com/uNetworking/uSockets/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
249 KEYWORDS="~amd64 ~arm64 ~x86"
250 - S="${WORKDIR}/uSockets-${PV}"
251 + S="${WORKDIR}/uSockets-${COMMIT}"
252 fi
253
254 LICENSE="Apache-2.0"
255 SLOT="0"
256 -IUSE="libuv +ssl"
257 +IUSE="asio libuv +ssl"
258 +REQUIRED_USE="?? ( asio libuv )"
259
260 DEPEND="
261 + asio? ( dev-cpp/asio[ssl?] )
262 libuv? ( dev-libs/libuv )
263 ssl? ( >=dev-libs/openssl-1.1.0 )
264 "
265 RDEPEND="${DEPEND}"
266
267 PATCHES=(
268 - "${FILESDIR}/${PN}-0.7.1-Makefile.patch"
269 + "${FILESDIR}/${PN}-0.7.1_p20210909-Makefile.patch"
270 )
271
272 src_configure() {
273 tc-export CC CXX AR
274 export VERSION="${PV%_*}" \
275 LIB="$(get_libdir)" \
276 - WITH_OPENSSL="$(usex ssl 1 0)"
277 - WITH_LIBUV="$(usex libuv 1 0)"
278 + WITH_OPENSSL="$(usex ssl 1 0)" \
279 + WITH_LIBUV="$(usex libuv 1 0)" \
280 + WITH_ASIO="$(usex asio 1 0)"
281 default
282 }