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