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