Merge branch 'master' 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 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages libevent)
22 #:use-module (gnu packages)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages base)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages pkg-config))
31
32 (define-public libevent
33 (package
34 (name "libevent")
35 (version "2.0.22")
36 (source (origin
37 (method url-fetch)
38 (uri (string-append
39 "https://github.com/libevent/libevent/releases/download/release-"
40 version "-stable/libevent-" version "-stable.tar.gz"))
41 (sha256
42 (base32
43 "18qz9qfwrkakmazdlwxvjmw8p76g70n3faikwvdwznns1agw9hki"))
44 (patches (list (search-patch "libevent-dns-tests.patch")))))
45 (build-system gnu-build-system)
46 (inputs
47 `(;; Dependencies used for the tests and for `event_rpcgen.py'.
48 ("which" ,which)
49 ("python" ,python-wrapper)))
50 (home-page "http://libevent.org/")
51 (synopsis "Event notification library")
52 (description
53 "The libevent API provides a mechanism to execute a callback
54 function when a specific event occurs on a file descriptor or after a
55 timeout has been reached. Furthermore, libevent also support callbacks
56 due to signals or regular timeouts.
57
58 libevent is meant to replace the event loop found in event driven
59 network servers. An application just needs to call event_dispatch() and
60 then add or remove events dynamically without having to change the event
61 loop.")
62 (license bsd-3)))
63
64 (define-public libev
65 (package
66 (name "libev")
67 (version "4.20")
68 (source (origin
69 (method url-fetch)
70 (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
71 version
72 ".tar.gz"))
73 (sha256
74 (base32
75 "17j47pbkr65a18mfvy2861p5k7w4pxmdgiw723ryfqd9gx636w7q"))))
76 (build-system gnu-build-system)
77 (home-page "http://software.schmorp.de/pkg/libev.html")
78 (synopsis "Event loop loosely modelled after libevent")
79 (description
80 "libev is a full-featured and high-performance event loop that
81 is loosely modelled after libevent, but without its limitations and
82 bugs. It is used in GNU Virtual Private Ethernet, rxvt-unicode,
83 auditd, the Deliantra MORPG Server and Client, and many other
84 programs.")
85 (license
86 (list bsd-2 gpl2+))))
87
88 (define-public libuv
89 (package
90 (name "libuv")
91 (version "1.4.2")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append "https://github.com/libuv/libuv/archive/v"
95 version ".tar.gz"))
96 (file-name (string-append name "-" version ".tar.gz"))
97 (sha256
98 (base32
99 "0hdpysawz85zpmsfkcsd1b7bmx53szcir1szbh1w7ldhkpv29r5r"))))
100 (build-system gnu-build-system)
101 (arguments
102 '(#:phases (alist-cons-after
103 'unpack 'autogen
104 (lambda _
105 ;; Fashionable people don't run 'make dist' these days, so
106 ;; we need to do that ourselves.
107 (zero? (system* "sh" "autogen.sh")))
108 %standard-phases)
109
110 ;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
111 #:tests? #f))
112 (native-inputs `(("autoconf" ,(autoconf-wrapper))
113 ("automake" ,automake)
114 ("libtool" ,libtool)
115
116 ;; libuv.pc is installed only when pkg-config is found.
117 ("pkg-config" ,pkg-config)))
118 (home-page "https://github.com/joyent/libuv")
119 (synopsis "Library for asynchronous I/O")
120 (description
121 "libuv is a multi-platform support library with a focus on asynchronous
122 I/O. Among other things, it supports event loops via epoll, kqueue, and
123 similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
124 resolution, asynchronous file system operations, and threading primitives.")
125
126 ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
127 ;; details.
128 (license x11)))