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, 2019 Marius Bakke <mbakke@fastmail.com>
7 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
8 ;;; Copyright © 2018, 2019 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.11")
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 "0g988zqm45sj1hlhhz4il5z4dpi5dl74hzjwzl4md37a09iaqnx6"))))
53 (build-system gnu-build-system)
54 (arguments
55 ;; This skips some of the tests which fail on armhf and aarch64.
56 '(#:configure-flags '("--disable-libevent-regress")))
57 (inputs
58 `(("python" ,python-wrapper))) ;for 'event_rpcgen.py'
59 (native-inputs
60 `(("which" ,which)))
61 (home-page "https://libevent.org/")
62 (synopsis "Event notification library")
63 (description
64 "The libevent API provides a mechanism to execute a callback
65 function when a specific event occurs on a file descriptor or after a
66 timeout has been reached. Furthermore, libevent also support callbacks
67 due to signals or regular timeouts.
68
69 libevent is meant to replace the event loop found in event driven
70 network servers. An application just needs to call event_dispatch() and
71 then add or remove events dynamically without having to change the event
72 loop.")
73 (license bsd-3)))
74
75 (define-public libev
76 (package
77 (name "libev")
78 (version "4.31")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
82 version
83 ".tar.gz"))
84 (sha256
85 (base32
86 "0nkfqv69wfyy2bpga4d53iqydycpik8jp8x6q70353hia8mmv1gd"))))
87 (build-system gnu-build-system)
88 (arguments
89 '(#:configure-flags '("--disable-static")))
90 (home-page "http://software.schmorp.de/pkg/libev.html")
91 (synopsis "Event loop loosely modelled after libevent")
92 (description
93 "libev provides a full-featured and high-performance event loop that is
94 loosely modelled after libevent. It includes relative timers, absolute timers
95 with customized rescheduling, synchronous signals, process status change
96 events, event watchers dealing with the event loop itself, file watchers, and
97 limited support for fork events.")
98 (license
99 (list bsd-2 gpl2+))))
100
101 (define-public libuv
102 (package
103 (name "libuv")
104 (version "1.34.1")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append "https://dist.libuv.org/dist/v" version
108 "/libuv-v" version ".tar.gz"))
109 (sha256
110 (base32
111 "1kwgl7j9snmjicrszhynfyp4njckqaw6l90y71a0b0alp2m8asbn"))))
112 (build-system gnu-build-system)
113 (arguments
114 '(#:configure-flags '("--disable-static")
115 ;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
116 #:tests? #f))
117 (native-inputs `(("autoconf" ,autoconf-wrapper)
118 ("automake" ,automake)
119 ("libtool" ,libtool)
120
121 ;; libuv.pc is installed only when pkg-config is found.
122 ("pkg-config" ,pkg-config)))
123 (home-page "https://github.com/libuv/libuv")
124 (synopsis "Library for asynchronous I/O")
125 (description
126 "libuv is a multi-platform support library with a focus on asynchronous
127 I/O. Among other things, it supports event loops via epoll, kqueue, and
128 similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
129 resolution, asynchronous file system operations, and threading primitives.")
130
131 ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
132 ;; details. Documentation is CC-BY 4.0 as of 1.12.0; see 'LICENSE-docs'.
133 (license (list expat cc-by4.0))))
134
135 (define-public perl-anyevent
136 (package
137 (name "perl-anyevent")
138 (version "7.17")
139 (source (origin
140 (method url-fetch)
141 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/"
142 "AnyEvent-" version ".tar.gz"))
143 (sha256
144 (base32
145 "11drlj8r02czhjgzkb39axnr8zzyp506r043xfmf93q9kilfmgjh"))))
146 (build-system perl-build-system)
147 (native-inputs
148 `(("perl-canary-stability" ,perl-canary-stability)))
149 (propagated-inputs
150 `(("perl-async-interrupt" ,perl-async-interrupt)
151 ("perl-ev" ,perl-ev)
152 ("perl-guard" ,perl-guard)
153 ("perl-json" ,perl-json)
154 ("perl-json-xs" ,perl-json-xs)
155 ("perl-net-ssleay" ,perl-net-ssleay)
156 ("perl-task-weaken" ,perl-task-weaken)))
157 (home-page "https://metacpan.org/release/AnyEvent")
158 (synopsis
159 "API for I/O, timer, signal, child process and completion events")
160 (description
161 "This module allows using a variety of events without forcing module
162 authors to pick a specific event loop, and without noticeable overhead.
163 Currently supported event loops are EV, Event, Glib/Gtk2, Tk, Qt,
164 @code{Event::Lib}, Irssi, @code{IO::Async} and POE (and thus also WxWidgets
165 and Prima). It also comes with a very fast Pure Perl event loop that does
166 not rely on XS.")
167 (license perl-license)))
168
169 (define-public perl-ev
170 (package
171 (name "perl-ev")
172 (version "4.25")
173 (source (origin
174 (method url-fetch)
175 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-"
176 version ".tar.gz"))
177 (sha256
178 (base32
179 "0slw68zxrkfribf6lhggdhpay3mdng0nqxlglkwrk19myblchr9f"))
180 (modules '((guix build utils)))
181 (snippet
182 '(begin
183 ;; Drop bundled libev.
184 (delete-file-recursively "libev")
185 #t))))
186 (build-system perl-build-system)
187 (arguments
188 '(#:phases
189 (modify-phases %standard-phases
190 (add-after 'unpack 'unpack-libev
191 ;; This package requires the libev *sources* in order
192 ;; to build. Unpack system libev here...
193 (lambda* (#:key inputs #:allow-other-keys)
194 (mkdir "./libev")
195 (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
196 "-C" "./libev" "--strip-components=1"))))))
197 (native-inputs
198 `(("libev-source" ,(package-source libev))
199 ("perl-canary-stability" ,perl-canary-stability)))
200 (propagated-inputs
201 `(("perl-common-sense" ,perl-common-sense)))
202 (home-page "https://metacpan.org/release/EV")
203 (synopsis "Perl interface to libev")
204 (description
205 "This module provides an interface to @code{libev}, a high performance
206 full-featured event loop. It can be used through the @code{AnyEvent} module
207 and still be faster than other event loops currently supported in Perl.")
208 (license perl-license)))
209
210 (define-public perl-rpc-epc-service
211 (package
212 (name "perl-rpc-epc-service")
213 (version "0.0.11")
214 (source
215 (origin
216 (method url-fetch)
217 (uri (string-append
218 "mirror://cpan/authors/id/K/KI/KIWANAMI/RPC-EPC-Service-"
219 "v" version ".tar.gz"))
220 (sha256
221 (base32
222 "1qwb284z4ig3xzy21m1b3w8bkb8k6l2ij6cjz93znn2j6qs42pwp"))))
223 (build-system perl-build-system)
224 (native-inputs
225 `(("perl-module-build" ,perl-module-build)
226 ("perl-test-simple" ,perl-test-simple)))
227 (propagated-inputs
228 `(("perl-anyevent" ,perl-anyevent)
229 ("perl-data-sexpression" ,perl-data-sexpression)))
230 (arguments
231 ;; Tests seem to fail because they try to start a server.
232 `(#:tests? #f))
233 (home-page "https://metacpan.org/release/RPC-EPC-Service")
234 (synopsis "Asynchronous remote procedure stack")
235 (description "RPC::EPC::Service enables to connect the other process with
236 the S-expression protocol, like the Swank protocol of the SLIME.")
237 (license perl-license)))