1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 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"))
84 (patches (search-patches
85 "libevent-dns-tests.patch"
86 "libevent-2.0-evdns-fix-remote-stack-overread.patch"
87 "libevent-2.0-evutil-fix-buffer-overflow.patch"
88 "libevent-2.0-evdns-fix-searching-empty-hostnames.patch"))))))
96 (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
101 "08gqsza1czx0nf62nkk183jb0946yzjsymaacxbzdgcs8z9r6dcp"))))
102 (build-system gnu-build-system)
103 (home-page "http://software.schmorp.de/pkg/libev.html")
104 (synopsis "Event loop loosely modelled after libevent")
106 "libev is a full-featured and high-performance event loop that
107 is loosely modelled after libevent, but without its limitations and
108 bugs. It is used in GNU Virtual Private Ethernet, rxvt-unicode,
109 auditd, the Deliantra MORPG Server and Client, and many other
112 (list bsd-2 gpl2+))))
120 (uri (string-append "https://github.com/libuv/libuv/archive/v"
122 (file-name (string-append name "-" version ".tar.gz"))
125 "0yhw86011l2dg2prms0d86szygrix4pxpgnyzs7iljy2xk3fxivf"))))
126 (build-system gnu-build-system)
128 '(#:phases (alist-cons-after
131 ;; Fashionable people don't run 'make dist' these days, so
132 ;; we need to do that ourselves.
133 (zero? (system* "sh" "autogen.sh")))
136 ;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
138 (native-inputs `(("autoconf" ,(autoconf-wrapper))
139 ("automake" ,automake)
142 ;; libuv.pc is installed only when pkg-config is found.
143 ("pkg-config" ,pkg-config)))
144 (home-page "https://github.com/libuv/libuv")
145 (synopsis "Library for asynchronous I/O")
147 "libuv is a multi-platform support library with a focus on asynchronous
148 I/O. Among other things, it supports event loops via epoll, kqueue, and
149 similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
150 resolution, asynchronous file system operations, and threading primitives.")
152 ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
156 (define-public perl-anyevent
158 (name "perl-anyevent")
162 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/"
163 "AnyEvent-" version ".tar.gz"))
166 "1b84ilkbrfbzqapv25x8z6gva92skbrf2srybdabb1wnxx6ky454"))))
167 (build-system perl-build-system)
169 `(("perl-canary-stability" ,perl-canary-stability)))
171 `(("perl-async-interrupt" ,perl-async-interrupt)
173 ("perl-guard" ,perl-guard)
174 ("perl-json" ,perl-json)
175 ("perl-json-xs" ,perl-json-xs)
176 ("perl-net-ssleay" ,perl-net-ssleay)
177 ("perl-task-weaken" ,perl-task-weaken)))
178 (home-page "http://search.cpan.org/dist/AnyEvent")
180 "API for I/O, timer, signal, child process and completion events")
182 "This module allows using a variety of events without forcing module
183 authors to pick a specific event loop, and without noticable overhead.
184 Currently supported event loops are EV, Event, Glib/Gtk2, Tk, Qt,
185 @code{Event::Lib}, Irssi, @code{IO::Async} and POE (and thus also WxWidgets
186 and Prima). It also comes with a very fast Pure Perl event loop that does
188 (license (package-license perl))))
190 (define-public perl-ev
196 (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-"
200 "14d9115q8f2ca2q3vbcalm55zqsbx8xjq5aj098laj9f9rrzirra"))
201 (modules '((guix build utils)))
204 ;; Drop bundled libev.
205 (delete-file-recursively "libev")
207 (build-system perl-build-system)
210 (modify-phases %standard-phases
211 (add-after 'unpack 'unpack-libev
212 ;; This package requires the libev *sources* in order
213 ;; to build. Unpack system libev here...
214 (lambda* (#:key inputs #:allow-other-keys)
216 (zero? (system* "tar" "-xf" (assoc-ref inputs "libev-source")
217 "-C" "./libev" "--strip-components=1")))))))
219 `(("libev-source" ,(package-source libev))
220 ("perl-canary-stability" ,perl-canary-stability)))
222 `(("perl-common-sense" ,perl-common-sense)))
223 (home-page "http://search.cpan.org/dist/EV")
224 (synopsis "Perl interface to libev")
226 "This module provides an interface to @code{libev}, a high performance
227 full-featured event loop. It can be used through the @code{AnyEvent} module
228 and still be faster than other event loops currently supported in Perl.")
229 (license (package-license perl))))