gnu: Use 'modify-phases' syntax.
[jackhill/guix/guix.git] / gnu / packages / telephony.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
5 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
7 ;;; Copyright © 2016 Francesco Frassinelli <fraph24@gmail.com>
8 ;;; Copyright © 2016, 2017 ng0 <contact.ng0@cryptolab.net>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages telephony)
26 #:use-module (gnu packages)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages avahi)
29 #:use-module (gnu packages boost)
30 #:use-module (gnu packages protobuf)
31 #:use-module (gnu packages gnupg)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages multiprecision)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages pulseaudio)
37 #:use-module (gnu packages qt)
38 #:use-module (gnu packages speech)
39 #:use-module (gnu packages tls)
40 #:use-module (gnu packages xiph)
41 #:use-module (gnu packages xorg)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix build-system gnu))
46
47 (define-public commoncpp
48 (package
49 (name "commoncpp")
50 (version "1.8.1")
51 (source (origin
52 (method url-fetch)
53 (uri (string-append "mirror://gnu/" name "/commoncpp2-"
54 version ".tar.gz"))
55 (sha256 (base32
56 "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
57 (arguments
58 `(#:phases
59 (modify-phases %standard-phases
60 (add-before 'configure 'pre-configure
61 (lambda _
62 (substitute* "src/applog.cpp"
63 (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
64 #t)))))
65 (build-system gnu-build-system)
66 (synopsis "(u)Common C++ framework for threaded applications")
67 (description "GNU Common C++ is an portable, optimized class framework for
68 threaded applications, supporting concurrent synchronization, inter-process
69 communications via sockets, and various methods for data handling, such as
70 serialization and XML parsing. It includes the uCommon C++ library, a smaller
71 reimplementation.")
72 (license license:gpl2+) ; plus runtime exception
73 (home-page "https://www.gnu.org/software/commoncpp/")))
74
75 (define-public ucommon
76 (package
77 (name "ucommon")
78 (version "7.0.0")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "mirror://gnu/commoncpp/" name "-"
82 version ".tar.gz"))
83 (sha256 (base32
84 "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
85 (build-system gnu-build-system)
86 (inputs `(("gnutls" ,gnutls)))
87 (synopsis "Common C++ framework for threaded applications")
88 (description "GNU uCommon C++ is meant as a very light-weight C++ library
89 to facilitate using C++ design patterns even for very deeply embedded
90 applications, such as for systems using uclibc along with posix threading
91 support.")
92 (license license:gpl3+)
93 (home-page "https://www.gnu.org/software/commoncpp/")
94 (properties '((ftp-directory . "/gnu/commoncpp")))))
95
96 (define-public ccrtp
97 (package
98 (name "ccrtp")
99 (version "2.1.2")
100 (source (origin
101 (method url-fetch)
102 (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
103 version ".tar.gz"))
104 (sha256 (base32
105 "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
106 (build-system gnu-build-system)
107 (inputs `(("ucommon" ,ucommon)
108 ("libgcrypt" ,libgcrypt)))
109 (native-inputs `(("pkg-config" ,pkg-config)))
110 (synopsis "Implementation of RTP (real-time transport protocol)")
111 (description "GNU ccRTP is an implementation of RTP, the real-time transport
112 protocol from the IETF. It is suitable both for high capacity servers and
113 personal client applications. It is flexible in its design, allowing it to
114 function as a framework for the framework, rather than just being a
115 packet-manipulation library.")
116 (license license:gpl2+) ; plus runtime exception
117 (home-page "https://www.gnu.org/software/ccrtp/")))
118
119
120 (define-public osip
121 (package
122 (name "osip")
123 (version "5.0.0")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
127 (patches (search-patches "osip-CVE-2017-7853.patch"))
128 (sha256
129 (base32
130 "00yznbrm9q04wgd4b831km8iwlvwvsnwv87igf79g5vj9yakr88q"))))
131 (build-system gnu-build-system)
132
133 (synopsis "Library implementing SIP (RFC-3261)")
134 (description "GNU oSIP is an implementation of the SIP protocol. It is
135 used to provide multimedia and telecom software developers with an interface
136 to initiate and control SIP sessions.")
137 (license license:lgpl2.1+)
138 (home-page "https://www.gnu.org/software/osip/")))
139
140
141 (define-public exosip
142 (package
143 (name "exosip")
144 (version "4.1.0")
145 (source (origin
146 (method url-fetch)
147 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
148 version ".tar.gz"))
149 (sha256 (base32
150 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
151 (build-system gnu-build-system)
152 (inputs `(("osip" ,osip)))
153 (synopsis "Sip abstraction library")
154 (description "EXosip is a library that hides the complexity of using the
155 SIP protocol for multimedia session establishment. This protocol is mainly to
156 be used by VoIP telephony applications (endpoints or conference server) but
157 might be also useful for any application that wish to establish sessions like
158 multiplayer games.")
159 (license license:gpl2+)
160 ;; (plus OpenSSL linking exception)
161 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
162 (home-page "http://savannah.nongnu.org/projects/exosip")))
163
164 (define-public sipwitch
165 (package
166 (name "sipwitch")
167 (version "1.9.15")
168 (source (origin
169 (method url-fetch)
170 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
171 version ".tar.gz"))
172 (sha256 (base32
173 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
174 (build-system gnu-build-system)
175 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
176 ;; cross-compiling. Among other issues there the program name "pkg-config"
177 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
178 ;; Fortunately we can avoid the use of pkg-config and set the dependency
179 ;; flags ourselves.
180 (arguments `(#:configure-flags
181 `("--without-pkg-config"
182 ,(string-append "UCOMMON_CFLAGS=-I"
183 (assoc-ref %build-inputs "ucommon") "/include")
184 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
185 ,(string-append "LIBOSIP2_CFLAGS=-I"
186 (assoc-ref %build-inputs "osip") "/include")
187 "LIBOSIP2_LIBS=-losipparser2 -losip2"
188 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
189 "/etc")
190 "EXOSIP2_LIBS=-leXosip2"
191 ,(string-append "EXOSIP2_CFLAGS=-I"
192 (assoc-ref %build-inputs "exosip")
193 "/include"))))
194 (inputs `(("ucommon" ,ucommon)
195 ("exosip" ,exosip)
196 ("osip" ,osip)))
197 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
198 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
199 uses the SIP protocol. Calls can be made from behind NAT firewalls and
200 without the need for a service provider. Its peer-to-peer design ensures that
201 there is no central point for media intercept or capture and thus it can be
202 used to construct a secure telephone system that operates over the public
203 internet.")
204 (license license:gpl3+)
205 (home-page "https://www.gnu.org/software/sipwitch/")))
206
207 (define-public libsrtp
208 (package
209 (name "libsrtp")
210 (version "1.5.4")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "https://github.com/cisco/libsrtp/archive/v"
214 version ".tar.gz"))
215 (file-name (string-append name "-" version ".tar.gz"))
216 (sha256
217 (base32
218 "1w2g623qkd7gdyydglx2hr4s2y237lg0nszjmy7z8d2iq8hvb9sn"))))
219 (native-inputs
220 `(("psmisc" ,psmisc) ;some tests require 'killall'
221 ("procps" ,procps)))
222 (build-system gnu-build-system)
223 (arguments
224 '(#:test-target "runtest"
225 #:phases
226 (modify-phases %standard-phases
227 (add-after 'unpack 'patch-mips-variable-in-testsuite
228 ;; This comes from https://github.com/cisco/libsrtp/pull/151
229 (lambda _
230 (substitute* "test/srtp_driver.c"
231 (("mips ") "mips_est ")
232 (("mips\\)") "mips_est)"))
233 #t))
234 (add-after 'unpack 'patch-dictionary-location
235 ;; With the above changes, the rtpw_test.sh test finally runs, and fails
236 (lambda _
237 (substitute* "test/rtpw.c"
238 (("/usr/share/dict/words")
239 (string-append (assoc-ref %build-inputs "procps")
240 "/share/doc/procps-ng/FAQ"))
241 (("words.txt") "FAQ"))
242 #t)))))
243 (synopsis "Secure RTP (SRTP) Reference Implementation")
244 (description "This package provides an implementation of the Secure
245 Real-time Transport Protocol (SRTP), the Universal Security Transform (UST),
246 and a supporting cryptographic kernel.")
247 (home-page "https://github.com/cisco/libsrtp")
248 (license license:bsd-3)))
249
250 (define-public libiax2
251 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
252 ;; This is the commit used by the Ring Project.
253 (package
254 (name "libiax2")
255 (version (string-append "0.0.0-1." (string-take commit 7)))
256 (source
257 (origin
258 (method url-fetch)
259 (uri
260 (string-append
261 "https://gitlab.savoirfairelinux.com/sflphone/libiax2/"
262 "repository/archive.tar.gz?ref="
263 commit))
264 (file-name (string-append name "-" version ".tar.gz"))
265 (sha256
266 (base32
267 "0cj5293bixp3k5x3hjwyd0iq7z8w5p7yavxvvkqk5817hjq386y2"))))
268 (build-system gnu-build-system)
269 (native-inputs
270 `(("autoconf" ,autoconf)
271 ("automake" ,automake)
272 ("libtool" ,libtool)))
273 (arguments
274 `(#:phases (modify-phases %standard-phases
275 (add-after 'unpack 'autoconf
276 (lambda _
277 (zero? (system* "autoreconf" "-vfi")))))))
278 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
279 (synopsis "Inter-Asterisk-Protocol library")
280 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
281 Voice-over-IP (VoIP) communications.")
282 ;; The file 'src/md5.c' is released into the public domain by RSA Data
283 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
284 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
285 ;; covered under the 'GPL'.
286 ;; The package as a whole is distributed under the LGPL 2.0.
287 (license (list license:lgpl2.0
288 license:public-domain
289 license:gpl2+)))))
290
291 (define-public seren
292 (package
293 (name "seren")
294 (version "0.0.21")
295 (source (origin
296 (method url-fetch)
297 (uri (string-append "http://holdenc.altervista.org/"
298 "seren/downloads/seren-" version
299 ".tar.gz"))
300 (sha256
301 (base32
302 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
303 (build-system gnu-build-system)
304 (arguments '(#:tests? #f)) ; no "check" target
305 (inputs
306 `(("alsa-lib" ,alsa-lib)
307 ("gmp" ,gmp)
308 ("libogg" ,libogg)
309 ("ncurses" ,ncurses)
310 ("opus" ,opus)))
311 (synopsis "Simple VoIP program to create conferences from the terminal")
312 (description
313 "Seren is a simple VoIP program based on the Opus codec that allows you
314 to create a voice conference from the terminal, with up to 10 participants,
315 without having to register accounts, exchange emails, or add people to contact
316 lists. All you need to join an existing conference is the host name or IP
317 address of one of the participants.")
318 (home-page "http://holdenc.altervista.org/seren/")
319 (license license:gpl3+)))
320
321 (define-public mumble
322 (package
323 (name "mumble")
324 (version "1.2.19")
325 (source (origin
326 (method url-fetch)
327 (uri (string-append "https://mumble.info/snapshot/"
328 name "-" version ".tar.gz"))
329 (sha256
330 (base32
331 "1s60vaici3v034jzzi20x23hsj6mkjlc0glipjq4hffrg9qgnizh"))
332 (modules '((guix build utils)))
333 (snippet
334 `(begin
335 ;; Remove bundled software.
336 (for-each delete-file-recursively '("3rdparty"
337 "speex"
338 "speexbuild"
339 "opus-build"
340 "opus-src"
341 "sbcelt-helper-build"
342 "sbcelt-lib-build"
343 "sbcelt-src"))
344 ;; TODO: Celt is still bundled. It has been merged into Opus
345 ;; and will be removed after 1.3.0.
346 ;; https://github.com/mumble-voip/mumble/issues/1999
347 #t))))
348 (build-system gnu-build-system)
349 (arguments
350 `(#:tests? #f ; no "check" target
351 #:phases
352 (modify-phases %standard-phases
353 (replace 'configure
354 (lambda* (#:key outputs #:allow-other-keys)
355 (zero? (system* "qmake" "main.pro" "-recursive"
356 (string-append "CONFIG+="
357 (string-join
358 (list "no-update"
359 "no-ice"
360 "no-embed-qt-translations"
361 "no-bundled-speex"
362 "pch"
363 "no-bundled-opus"
364 "no-celt"
365 "no-alsa"
366 "no-oss"
367 "no-portaudio"
368 "speechd"
369 "no-g15"
370 "no-bonjour"
371 "release")))
372 (string-append "DEFINES+="
373 "PLUGIN_PATH="
374 (assoc-ref outputs "out")
375 "/lib/mumble")))))
376 (add-before 'configure 'fix-libspeechd-include
377 (lambda _
378 (substitute* "src/mumble/TextToSpeech_unix.cpp"
379 (("libspeechd.h") "speech-dispatcher/libspeechd.h"))))
380 (replace 'install ; install phase does not exist
381 (lambda* (#:key inputs outputs #:allow-other-keys)
382 (let* ((out (assoc-ref outputs "out"))
383 (etc (string-append out "/etc/murmur"))
384 (dbus (string-append out "/etc/dbus-1/system.d/"))
385 (bin (string-append out "/bin"))
386 (services (string-append out "/share/services"))
387 (applications (string-append out "/share/applications"))
388 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
389 (man (string-append out "/share/man/man1"))
390 (lib (string-append out "/lib/mumble")))
391 (install-file "release/mumble" bin)
392 (install-file "scripts/mumble-overlay" bin)
393 (install-file "scripts/mumble.protocol" services)
394 (install-file "scripts/mumble.desktop" applications)
395 (install-file "icons/mumble.svg" icons)
396 (install-file "man/mumble-overlay.1" man)
397 (install-file "man/mumble.1" man)
398 (install-file "release/murmurd" bin)
399 (install-file "scripts/murmur.ini.system" etc)
400 (rename-file (string-append etc "/murmur.ini.system")
401 (string-append etc "/murmur.ini"))
402 (install-file "scripts/murmur.conf" dbus)
403 (install-file "man/murmurd.1" man)
404 (for-each (lambda (file) (install-file file lib))
405 (find-files "." "\\.so\\."))
406 (for-each (lambda (file) (install-file file lib))
407 (find-files "release/plugins" "\\.so$"))))))))
408 (inputs
409 `(("avahi" ,avahi)
410 ("protobuf" ,protobuf)
411 ("openssl" ,openssl)
412 ("libsndfile" ,libsndfile)
413 ("boost" ,boost)
414 ("opus" ,opus)
415 ("speex" ,speex)
416 ("speexdsp" ,speexdsp)
417 ("speech-dispatcher" ,speech-dispatcher)
418 ("libx11" ,libx11)
419 ("libxi" ,libxi)
420 ("qt-4" ,qt-4)
421 ("alsa-lib" ,alsa-lib)
422 ("pulseaudio" ,pulseaudio)))
423 (native-inputs
424 `(("pkg-config" ,pkg-config)))
425 (synopsis "Low-latency, high quality voice chat software")
426 (description
427 "Mumble is an low-latency, high quality voice chat
428 software primarily intended for use while gaming.
429 Mumble consists of two applications for separate usage:
430 @code{mumble} for the client, and @code{murmur} for the server.")
431 (home-page "https://wiki.mumble.info/wiki/Main_Page")
432 (license (list license:bsd-3
433 ;; The bundled celt is bsd-2. Remove after 1.3.0.
434 license:bsd-2))))