1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages libevent)
24 #:use-module (gnu packages)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system perl)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages python)
35 #:use-module (gnu packages tls))
37 (define-public libevent
44 "https://github.com/libevent/libevent/releases/download/release-"
45 version "-stable/libevent-" version "-stable.tar.gz"))
48 "1hhxnxlr0fsdv7bdmzsnhdz16fxf3jg2r6vyljcl3kj6pflcap4n"))
49 (patches (search-patches "libevent-2.1-dns-tests.patch"
50 ;; XXX: Try removing this for > 2.1.8.
51 ;; https://github.com/libevent/libevent/issues/452
52 "libevent-2.1-skip-failing-test.patch"))))
53 (build-system gnu-build-system)
55 `(("python" ,python-2))) ; for 'event_rpcgen.py'
58 (home-page "http://libevent.org/")
59 (synopsis "Event notification library")
61 "The libevent API provides a mechanism to execute a callback
62 function when a specific event occurs on a file descriptor or after a
63 timeout has been reached. Furthermore, libevent also support callbacks
64 due to signals or regular timeouts.
66 libevent is meant to replace the event loop found in event driven
67 network servers. An application just needs to call event_dispatch() and
68 then add or remove events dynamically without having to change the event
72 (define-public libevent-2.0
79 "https://github.com/libevent/libevent/releases/download/release-"
80 version "-stable/libevent-" version "-stable.tar.gz"))
83 "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki"))
86 "libevent-dns-tests.patch"
87 "libevent-2.0-evdns-fix-remote-stack-overread.patch"
88 "libevent-2.0-evutil-fix-buffer-overflow.patch"
89 "libevent-2.0-evdns-fix-searching-empty-hostnames.patch"
90 "libevent-2.0-evbuffer-add-use-last-with-datap.patch"))))))
98 (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
103 "08gqsza1czx0nf62nkk183jb0946yzjsymaacxbzdgcs8z9r6dcp"))))
104 (build-system gnu-build-system)
105 (home-page "http://software.schmorp.de/pkg/libev.html")
106 (synopsis "Event loop loosely modelled after libevent")
108 "libev is a full-featured and high-performance event loop that
109 is loosely modelled after libevent, but without its limitations and
110 bugs. It is used in GNU Virtual Private Ethernet, rxvt-unicode,
111 auditd, the Deliantra MORPG Server and Client, and many other
114 (list bsd-2 gpl2+))))
122 (uri (string-append "https://github.com/libuv/libuv/archive/v"
124 (file-name (string-append name "-" version ".tar.gz"))
127 "0yhw86011l2dg2prms0d86szygrix4pxpgnyzs7iljy2xk3fxivf"))))
128 (build-system gnu-build-system)
130 '(#:phases (alist-cons-after
133 ;; Fashionable people don't run 'make dist' these days, so
134 ;; we need to do that ourselves.
135 (zero? (system* "sh" "autogen.sh")))
138 ;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
140 (native-inputs `(("autoconf" ,(autoconf-wrapper))
141 ("automake" ,automake)
144 ;; libuv.pc is installed only when pkg-config is found.
145 ("pkg-config" ,pkg-config)))
146 (home-page "https://github.com/libuv/libuv")
147 (synopsis "Library for asynchronous I/O")
149 "libuv is a multi-platform support library with a focus on asynchronous
150 I/O. Among other things, it supports event loops via epoll, kqueue, and
151 similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
152 resolution, asynchronous file system operations, and threading primitives.")
154 ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
158 (define-public perl-anyevent
160 (name "perl-anyevent")
164 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/"
165 "AnyEvent-" version ".tar.gz"))
168 "1b84ilkbrfbzqapv25x8z6gva92skbrf2srybdabb1wnxx6ky454"))))
169 (build-system perl-build-system)
171 `(("perl-canary-stability" ,perl-canary-stability)))
173 `(("perl-async-interrupt" ,perl-async-interrupt)
175 ("perl-guard" ,perl-guard)
176 ("perl-json" ,perl-json)
177 ("perl-json-xs" ,perl-json-xs)
178 ("perl-net-ssleay" ,perl-net-ssleay)
179 ("perl-task-weaken" ,perl-task-weaken)))
180 (home-page "http://search.cpan.org/dist/AnyEvent")
182 "API for I/O, timer, signal, child process and completion events")
184 "This module allows using a variety of events without forcing module
185 authors to pick a specific event loop, and without noticable overhead.
186 Currently supported event loops are EV, Event, Glib/Gtk2, Tk, Qt,
187 @code{Event::Lib}, Irssi, @code{IO::Async} and POE (and thus also WxWidgets
188 and Prima). It also comes with a very fast Pure Perl event loop that does
190 (license (package-license perl))))
192 (define-public perl-ev
198 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-"
202 "14d9115q8f2ca2q3vbcalm55zqsbx8xjq5aj098laj9f9rrzirra"))
203 (modules '((guix build utils)))
206 ;; Drop bundled libev.
207 (delete-file-recursively "libev")
209 (build-system perl-build-system)
212 (modify-phases %standard-phases
213 (add-after 'unpack 'unpack-libev
214 ;; This package requires the libev *sources* in order
215 ;; to build. Unpack system libev here...
216 (lambda* (#:key inputs #:allow-other-keys)
218 (zero? (system* "tar" "-xf" (assoc-ref inputs "libev-source")
219 "-C" "./libev" "--strip-components=1")))))))
221 `(("libev-source" ,(package-source libev))
222 ("perl-canary-stability" ,perl-canary-stability)))
224 `(("perl-common-sense" ,perl-common-sense)))
225 (home-page "http://search.cpan.org/dist/EV")
226 (synopsis "Perl interface to libev")
228 "This module provides an interface to @code{libev}, a high performance
229 full-featured event loop. It can be used through the @code{AnyEvent} module
230 and still be faster than other event loops currently supported in Perl.")
231 (license (package-license perl))))