gnu: libsrtp: Fix building on mips.
[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 ng0 <ng0@libertad.pw>
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 (alist-cons-before
60 'configure 'pre-configure
61 (lambda _
62 (substitute* "src/applog.cpp"
63 (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n")))
64 %standard-phases)))
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 "http://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 "http://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 "http://www.gnu.org/software/ccrtp")))
118
119
120 (define-public osip
121 (package
122 (name "osip")
123 (version "4.1.0")
124 (source (origin
125 (method url-fetch)
126 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
127 (sha256 (base32
128 "014503kqv7z63az6lgxr5fbajlrqylm5c4kgbf8p3a0n6cva0slr"))))
129 (build-system gnu-build-system)
130
131 (synopsis "Library implementing SIP (RFC-3261)")
132 (description "GNU oSIP is an implementation of the SIP protocol. It is
133 used to provide multimedia and telecom software developers with an interface
134 to initiate and control SIP sessions.")
135 (license license:lgpl2.1+)
136 (home-page "http://www.gnu.org/software/osip")))
137
138
139 (define-public exosip
140 (package
141 (name "exosip")
142 (version "4.1.0")
143 (source (origin
144 (method url-fetch)
145 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
146 version ".tar.gz"))
147 (sha256 (base32
148 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
149 (build-system gnu-build-system)
150 (inputs `(("osip" ,osip)))
151 (synopsis "Sip abstraction library")
152 (description "EXosip is a library that hides the complexity of using the
153 SIP protocol for multimedia session establishment. This protocol is mainly to
154 be used by VoIP telephony applications (endpoints or conference server) but
155 might be also useful for any application that wish to establish sessions like
156 multiplayer games.")
157 (license license:gpl2+)
158 ;; (plus OpenSSL linking exception)
159 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
160 (home-page "http://savannah.nongnu.org/projects/exosip")))
161
162 (define-public sipwitch
163 (package
164 (name "sipwitch")
165 (version "1.9.15")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
169 version ".tar.gz"))
170 (sha256 (base32
171 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
172 (build-system gnu-build-system)
173 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
174 ;; cross-compiling. Among other issues there the program name "pkg-config"
175 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
176 ;; Fortunately we can avoid the use of pkg-config and set the dependency
177 ;; flags ourselves.
178 (arguments `(#:configure-flags
179 `("--without-pkg-config"
180 ,(string-append "UCOMMON_CFLAGS=-I"
181 (assoc-ref %build-inputs "ucommon") "/include")
182 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
183 ,(string-append "LIBOSIP2_CFLAGS=-I"
184 (assoc-ref %build-inputs "osip") "/include")
185 "LIBOSIP2_LIBS=-losipparser2 -losip2"
186 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
187 "/etc")
188 "EXOSIP2_LIBS=-leXosip2"
189 ,(string-append "EXOSIP2_CFLAGS=-I"
190 (assoc-ref %build-inputs "exosip")
191 "/include"))))
192 (inputs `(("ucommon" ,ucommon)
193 ("exosip" ,exosip)
194 ("osip" ,osip)))
195 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
196 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
197 uses the SIP protocol. Calls can be made from behind NAT firewalls and
198 without the need for a service provider. Its peer-to-peer design ensures that
199 there is no central point for media intercept or capture and thus it can be
200 used to construct a secure telephone system that operates over the public
201 internet.")
202 (license license:gpl3+)
203 (home-page "http://www.gnu.org/software/sipwitch")))
204
205 (define-public libsrtp
206 (package
207 (name "libsrtp")
208 (version "1.5.4")
209 (source (origin
210 (method url-fetch)
211 (uri (string-append "https://github.com/cisco/libsrtp/archive/v"
212 version ".tar.gz"))
213 (file-name (string-append name "-" version ".tar.gz"))
214 (sha256
215 (base32
216 "1w2g623qkd7gdyydglx2hr4s2y237lg0nszjmy7z8d2iq8hvb9sn"))))
217 (native-inputs
218 `(("procps" ,procps)))
219 (build-system gnu-build-system)
220 (arguments
221 '(#:test-target "runtest"
222 #:phases
223 (modify-phases %standard-phases
224 (add-after 'unpack 'patch-mips-variable-in-testsuite
225 ;; This comes from https://github.com/cisco/libsrtp/pull/151
226 (lambda _
227 (substitute* "test/srtp_driver.c"
228 (("mips ") "mips_est ")
229 (("mips\\)") "mips_est)"))
230 #t))
231 (add-after 'unpack 'patch-dictionary-location
232 ;; With the above changes, the rtpw_test.sh test finally runs, and fails
233 (lambda _
234 (substitute* "test/rtpw.c"
235 (("/usr/share/dict/words")
236 (string-append (assoc-ref %build-inputs "procps")
237 "/share/doc/procps-ng"))
238 (("words.txt") "FAQ"))
239 #t)))))
240 (synopsis "Secure RTP (SRTP) Reference Implementation")
241 (description "This package provides an implementation of the Secure
242 Real-time Transport Protocol (SRTP), the Universal Security Transform (UST),
243 and a supporting cryptographic kernel.")
244 (home-page "https://github.com/cisco/libsrtp")
245 (license license:bsd-3)))
246
247 (define-public libiax2
248 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
249 ;; This is the commit used by the Ring Project.
250 (package
251 (name "libiax2")
252 (version (string-append "0.0.0-1." (string-take commit 7)))
253 (source
254 (origin
255 (method url-fetch)
256 (uri
257 (string-append
258 "https://gitlab.savoirfairelinux.com/sflphone/libiax2/"
259 "repository/archive.tar.gz?ref="
260 commit))
261 (file-name (string-append name "-" version ".tar.gz"))
262 (sha256
263 (base32
264 "0cj5293bixp3k5x3hjwyd0iq7z8w5p7yavxvvkqk5817hjq386y2"))))
265 (build-system gnu-build-system)
266 (native-inputs
267 `(("autoconf" ,autoconf)
268 ("automake" ,automake)
269 ("libtool" ,libtool)))
270 (arguments
271 `(#:phases (modify-phases %standard-phases
272 (add-before 'configure 'autoconf
273 (lambda _
274 (zero? (system* "autoreconf" "-vfi")))))))
275 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
276 (synopsis "Inter-Asterisk-Protocol library")
277 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
278 Voice-over-IP (VoIP) communications.")
279 ;; The file 'src/md5.c' is released into the public domain by RSA Data
280 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
281 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
282 ;; covered under the 'GPL'.
283 ;; The package as a whole is distributed under the LGPL 2.0.
284 (license (list license:lgpl2.0
285 license:public-domain
286 license:gpl2+)))))
287
288 (define-public seren
289 (package
290 (name "seren")
291 (version "0.0.21")
292 (source (origin
293 (method url-fetch)
294 (uri (string-append "http://holdenc.altervista.org/"
295 "seren/downloads/seren-" version
296 ".tar.gz"))
297 (sha256
298 (base32
299 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
300 (build-system gnu-build-system)
301 (arguments '(#:tests? #f)) ; no "check" target
302 (inputs
303 `(("alsa-lib" ,alsa-lib)
304 ("gmp" ,gmp)
305 ("libogg" ,libogg)
306 ("ncurses" ,ncurses)
307 ("opus" ,opus)))
308 (synopsis "Simple VoIP program to create conferences from the terminal")
309 (description
310 "Seren is a simple VoIP program based on the Opus codec that allows you
311 to create a voice conference from the terminal, with up to 10 participants,
312 without having to register accounts, exchange emails, or add people to contact
313 lists. All you need to join an existing conference is the host name or IP
314 address of one of the participants.")
315 (home-page "http://holdenc.altervista.org/seren/")
316 (license license:gpl3+)))
317
318 (define-public mumble
319 (package
320 (name "mumble")
321 (version "1.2.17")
322 (source (origin
323 (method url-fetch)
324 (uri (string-append "https://mumble.info/snapshot/"
325 name "-" version ".tar.gz"))
326 (sha256
327 (base32
328 "176br3b0pv5sz3zvgzsz9rxr3n79irlm902h7n1wh4f6vbph2dhw"))
329 (modules '((guix build utils)))
330 (snippet
331 `(begin
332 ;; Remove bundled software.
333 (for-each delete-file-recursively '("3rdparty"
334 "speex"
335 "speexbuild"
336 "opus-build"
337 "opus-src"
338 "sbcelt-helper-build"
339 "sbcelt-lib-build"
340 "sbcelt-src"))
341 ;; TODO: Celt is still bundled. It has been merged into Opus
342 ;; and will be removed after 1.3.0.
343 ;; https://github.com/mumble-voip/mumble/issues/1999
344 #t))))
345 (build-system gnu-build-system)
346 (arguments
347 `(#:tests? #f ; no "check" target
348 #:phases
349 (modify-phases %standard-phases
350 (replace 'configure
351 (lambda* (#:key outputs #:allow-other-keys)
352 (zero? (system* "qmake" "main.pro" "-recursive"
353 (string-append "CONFIG+="
354 (string-join
355 (list "no-update"
356 "no-server"
357 "no-embed-qt-translations"
358 "no-bundled-speex"
359 "pch"
360 "no-bundled-opus"
361 "no-celt"
362 "no-alsa"
363 "no-oss"
364 "no-portaudio"
365 "speechd"
366 "no-g15"
367 "no-bonjour"
368 "release")))
369 (string-append "DEFINES+="
370 "PLUGIN_PATH="
371 (assoc-ref outputs "out")
372 "/lib/mumble")))))
373 (add-before 'configure 'fix-libspeechd-include
374 (lambda _
375 (substitute* "src/mumble/TextToSpeech_unix.cpp"
376 (("libspeechd.h") "speech-dispatcher/libspeechd.h"))))
377 (replace 'install ; install phase does not exist
378 (lambda* (#:key inputs outputs #:allow-other-keys)
379 (let* ((out (assoc-ref outputs "out"))
380 (bin (string-append out "/bin"))
381 (services (string-append out "/share/services"))
382 (applications (string-append out "/share/applications"))
383 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
384 (man (string-append out "/share/man/man1"))
385 (lib (string-append out "/lib/mumble")))
386 (install-file "release/mumble" bin)
387 (install-file "scripts/mumble-overlay" bin)
388 (install-file "scripts/mumble.protocol" services)
389 (install-file "scripts/mumble.desktop" applications)
390 (install-file "icons/mumble.svg" icons)
391 (install-file "man/mumble-overlay.1" man)
392 (install-file "man/mumble.1" man)
393 (for-each (lambda (file) (install-file file lib))
394 (find-files "." "\\.so\\."))
395 (for-each (lambda (file) (install-file file lib))
396 (find-files "release/plugins" "\\.so$"))))))))
397 (inputs
398 `(("avahi" ,avahi)
399 ("protobuf" ,protobuf)
400 ("openssl" ,openssl)
401 ("libsndfile" ,libsndfile)
402 ("boost" ,boost)
403 ("opus" ,opus)
404 ("speex" ,speex)
405 ("speech-dispatcher" ,speech-dispatcher)
406 ("libx11" ,libx11)
407 ("libxi" ,libxi)
408 ("qt-4" ,qt-4)
409 ("alsa-lib" ,alsa-lib)
410 ("pulseaudio" ,pulseaudio)))
411 (native-inputs
412 `(("pkg-config" ,pkg-config)))
413 (synopsis "Low-latency, high quality voice chat software")
414 (description
415 "Mumble is an low-latency, high quality voice chat
416 software primarily intended for use while gaming.")
417 (home-page "https://wiki.mumble.info/wiki/Main_Page")
418 (license (list license:bsd-3
419 ;; The bundled celt is bsd-2. Remove after 1.3.0.
420 license:bsd-2))))