Merge branch 'staging' into core-updates
[jackhill/guix/guix.git] / gnu / packages / libevent.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
5 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
7 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages libevent)
27 #:use-module (gnu packages)
28 #:use-module (guix licenses)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system perl)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages perl-check)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages tls))
40
41 (define-public libevent
42 (package
43 (name "libevent")
44 (version "2.1.8")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append
48 "https://github.com/libevent/libevent/releases/download/release-"
49 version "-stable/libevent-" version "-stable.tar.gz"))
50 (sha256
51 (base32
52 "1hhxnxlr0fsdv7bdmzsnhdz16fxf3jg2r6vyljcl3kj6pflcap4n"))
53 (patches (search-patches "libevent-2.1-dns-tests.patch"
54 ;; XXX: Try removing this for > 2.1.8.
55 ;; https://github.com/libevent/libevent/issues/452
56 "libevent-2.1-skip-failing-test.patch"))))
57 (build-system gnu-build-system)
58 (arguments
59 ;; This skips some of the tests which fail on armhf and aarch64.
60 '(#:configure-flags '("--disable-libevent-regress")))
61 (inputs
62 `(("python" ,python-2))) ; for 'event_rpcgen.py'
63 (native-inputs
64 `(("which" ,which)))
65 (home-page "http://libevent.org/")
66 (synopsis "Event notification library")
67 (description
68 "The libevent API provides a mechanism to execute a callback
69 function when a specific event occurs on a file descriptor or after a
70 timeout has been reached. Furthermore, libevent also support callbacks
71 due to signals or regular timeouts.
72
73 libevent is meant to replace the event loop found in event driven
74 network servers. An application just needs to call event_dispatch() and
75 then add or remove events dynamically without having to change the event
76 loop.")
77 (license bsd-3)))
78
79 (define-public libevent-2.0
80 (package
81 (inherit libevent)
82 (version "2.0.22")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append
86 "https://github.com/libevent/libevent/releases/download/release-"
87 version "-stable/libevent-" version "-stable.tar.gz"))
88 (sha256
89 (base32
90 "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki"))
91 (patches
92 (search-patches
93 "libevent-dns-tests.patch"
94 "libevent-2.0-CVE-2016-10195.patch"
95 "libevent-2.0-CVE-2016-10196.patch"
96 "libevent-2.0-CVE-2016-10197.patch"
97 "libevent-2.0-evbuffer-add-use-last-with-datap.patch"))))
98 (arguments '())))
99
100 (define-public libev
101 (package
102 (name "libev")
103 (version "4.24")
104 (source (origin
105 (method url-fetch)
106 (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
107 version
108 ".tar.gz"))
109 (sha256
110 (base32
111 "08gqsza1czx0nf62nkk183jb0946yzjsymaacxbzdgcs8z9r6dcp"))))
112 (build-system gnu-build-system)
113 (home-page "http://software.schmorp.de/pkg/libev.html")
114 (synopsis "Event loop loosely modelled after libevent")
115 (description
116 "libev provides a full-featured and high-performance event loop that is
117 loosely modelled after libevent. It includes relative timers, absolute timers
118 with customized rescheduling, synchronous signals, process status change
119 events, event watchers dealing with the event loop itself, file watchers, and
120 limited support for fork events.")
121 (license
122 (list bsd-2 gpl2+))))
123
124 (define-public libuv
125 (package
126 (name "libuv")
127 (version "1.26.0")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append "https://dist.libuv.org/dist/v" version
131 "/libuv-v" version ".tar.gz"))
132 (sha256
133 (base32
134 "1rqlh0ag02fni8ildz3anc26z9vz69vwf5qmzsid2gvzzfkigy6a"))))
135 (build-system gnu-build-system)
136 (arguments
137 '(;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
138 #:tests? #f))
139 (native-inputs `(("autoconf" ,autoconf-wrapper)
140 ("automake" ,automake)
141 ("libtool" ,libtool)
142
143 ;; libuv.pc is installed only when pkg-config is found.
144 ("pkg-config" ,pkg-config)))
145 (home-page "https://github.com/libuv/libuv")
146 (synopsis "Library for asynchronous I/O")
147 (description
148 "libuv is a multi-platform support library with a focus on asynchronous
149 I/O. Among other things, it supports event loops via epoll, kqueue, and
150 similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
151 resolution, asynchronous file system operations, and threading primitives.")
152
153 ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
154 ;; details. Documentation is CC-BY 4.0 as of 1.12.0; see 'LICENSE-docs'.
155 (license (list expat cc-by4.0))))
156
157 ;; This version is required for Node versions < 10.
158 (define-public libuv-1.19
159 (package
160 (inherit libuv)
161 (version "1.19.2")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append "https://dist.libuv.org/dist/v" version
165 "/libuv-v" version ".tar.gz"))
166 (sha256
167 (base32
168 "1msk9ac1z69whww88ibrwjqkd1apdla6l77cm2fwy5kigq0z5g3w"))))))
169
170 (define-public perl-anyevent
171 (package
172 (name "perl-anyevent")
173 (version "7.14")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/"
177 "AnyEvent-" version ".tar.gz"))
178 (sha256
179 (base32
180 "0akxr9y0q9yjkl614x4clbiiayvh5a67y8gmci54plxs4p95i4sk"))))
181 (build-system perl-build-system)
182 (native-inputs
183 `(("perl-canary-stability" ,perl-canary-stability)))
184 (propagated-inputs
185 `(("perl-async-interrupt" ,perl-async-interrupt)
186 ("perl-ev" ,perl-ev)
187 ("perl-guard" ,perl-guard)
188 ("perl-json" ,perl-json)
189 ("perl-json-xs" ,perl-json-xs)
190 ("perl-net-ssleay" ,perl-net-ssleay)
191 ("perl-task-weaken" ,perl-task-weaken)))
192 (home-page "https://metacpan.org/release/AnyEvent")
193 (synopsis
194 "API for I/O, timer, signal, child process and completion events")
195 (description
196 "This module allows using a variety of events without forcing module
197 authors to pick a specific event loop, and without noticeable overhead.
198 Currently supported event loops are EV, Event, Glib/Gtk2, Tk, Qt,
199 @code{Event::Lib}, Irssi, @code{IO::Async} and POE (and thus also WxWidgets
200 and Prima). It also comes with a very fast Pure Perl event loop that does
201 not rely on XS.")
202 (license perl-license)))
203
204 (define-public perl-ev
205 (package
206 (name "perl-ev")
207 (version "4.22")
208 (source (origin
209 (method url-fetch)
210 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-"
211 version ".tar.gz"))
212 (sha256
213 (base32
214 "14d9115q8f2ca2q3vbcalm55zqsbx8xjq5aj098laj9f9rrzirra"))
215 (modules '((guix build utils)))
216 (snippet
217 '(begin
218 ;; Drop bundled libev.
219 (delete-file-recursively "libev")
220 #t))))
221 (build-system perl-build-system)
222 (arguments
223 '(#:phases
224 (modify-phases %standard-phases
225 (add-after 'unpack 'unpack-libev
226 ;; This package requires the libev *sources* in order
227 ;; to build. Unpack system libev here...
228 (lambda* (#:key inputs #:allow-other-keys)
229 (mkdir "./libev")
230 (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
231 "-C" "./libev" "--strip-components=1"))))))
232 (native-inputs
233 `(("libev-source" ,(package-source libev))
234 ("perl-canary-stability" ,perl-canary-stability)))
235 (propagated-inputs
236 `(("perl-common-sense" ,perl-common-sense)))
237 (home-page "https://metacpan.org/release/EV")
238 (synopsis "Perl interface to libev")
239 (description
240 "This module provides an interface to @code{libev}, a high performance
241 full-featured event loop. It can be used through the @code{AnyEvent} module
242 and still be faster than other event loops currently supported in Perl.")
243 (license perl-license)))
244
245 (define-public perl-rpc-epc-service
246 (package
247 (name "perl-rpc-epc-service")
248 (version "0.0.11")
249 (source
250 (origin
251 (method url-fetch)
252 (uri (string-append
253 "mirror://cpan/authors/id/K/KI/KIWANAMI/RPC-EPC-Service-"
254 "v" version ".tar.gz"))
255 (sha256
256 (base32
257 "1qwb284z4ig3xzy21m1b3w8bkb8k6l2ij6cjz93znn2j6qs42pwp"))))
258 (build-system perl-build-system)
259 (native-inputs
260 `(("perl-module-build" ,perl-module-build)
261 ("perl-test-simple" ,perl-test-simple)))
262 (propagated-inputs
263 `(("perl-anyevent" ,perl-anyevent)
264 ("perl-data-sexpression" ,perl-data-sexpression)))
265 (arguments
266 ;; Tests seem to fail because they try to start a server.
267 `(#:tests? #f))
268 (home-page "https://metacpan.org/release/RPC-EPC-Service")
269 (synopsis "Asynchronous remote procedure stack")
270 (description "RPC::EPC::Service enables to connect the other process with
271 the S-expression protocol, like the Swank protocol of the SLIME.")
272 (license perl-license)))