libevent.scm 10 KB

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