Merge branch 'master' into core-updates
[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, 2020 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 <ng0@n0.is>
9 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017 Adonay Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
12 ;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
13 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
14 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
15 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
16 ;;; Copyright © 2019 Ivan Vilata i Balaguer <ivan@selidor.net>
17 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
18 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
19 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
20 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
21 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
22 ;;;
23 ;;; This file is part of GNU Guix.
24 ;;;
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
29 ;;;
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
34 ;;;
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37
38 (define-module (gnu packages telephony)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages admin)
41 #:use-module (gnu packages aidc)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages avahi)
45 #:use-module (gnu packages audio)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages boost)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages crypto)
51 #:use-module (gnu packages docbook)
52 #:use-module (gnu packages documentation)
53 #:use-module (gnu packages file)
54 #:use-module (gnu packages protobuf)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages libcanberra)
63 #:use-module (gnu packages linux)
64 #:use-module (gnu packages multiprecision)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages netpbm)
67 #:use-module (gnu packages networking)
68 #:use-module (gnu packages pcre)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages pulseaudio)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages serialization)
75 #:use-module (gnu packages speech)
76 #:use-module (gnu packages tls)
77 #:use-module (gnu packages upnp)
78 #:use-module (gnu packages video)
79 #:use-module (gnu packages webkit)
80 #:use-module (gnu packages xiph)
81 #:use-module (gnu packages xorg)
82 #:use-module (gnu packages xml)
83 #:use-module (gnu packages readline)
84 #:use-module (gnu packages bison)
85 #:use-module (gnu packages flex)
86 #:use-module ((guix licenses) #:prefix license:)
87 #:use-module (guix packages)
88 #:use-module (guix download)
89 #:use-module (guix git-download)
90 #:use-module (guix build-system cmake)
91 #:use-module (guix build-system gnu)
92 #:use-module (guix build-system qt))
93
94 (define-public spandsp
95 (package
96 (name "spandsp")
97 (version "0.0.6")
98 (source
99 (origin
100 (method url-fetch)
101 (uri
102 ;; The original upstream has been down since the end of March 2020.
103 (string-append "https://web.archive.org/web/20180626203108/"
104 "https://www.soft-switch.org/downloads/" name "/"
105 name "-" version ".tar.gz"))
106 (sha256
107 (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
108 (build-system gnu-build-system)
109 (outputs '("out" "doc" "static")) ;doc contains HTML documentation
110 (arguments
111 `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
112 #:parallel-build? #f ;non-deterministic build failures may occur otherwise
113 #:parallel-tests? #f ;fails removing the same the files twice otherwise
114 #:phases (modify-phases %standard-phases
115 (add-after 'unpack 'patch-configure.ac
116 (lambda _
117 ;; spandsp looks at hard coded locations of the FHS to
118 ;; find libxml2.
119 (substitute* "configure.ac"
120 (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
121 (string-append all
122 "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
123 "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
124 ;; Force a regeneration of the autotools build system.
125 (delete-file "autogen.sh")
126 (delete-file "configure")
127 #t))
128 (add-after 'unpack 'do-not-install-data-files
129 ;; The .tiff images produced for tests are not
130 ;; reproducible and it is not desirable to have those
131 ;; distributed.
132 (lambda _
133 (substitute* '("test-data/itu/fax/Makefile.am"
134 "test-data/etsi/fax/Makefile.am")
135 (("nobase_data_DATA")
136 "noinst_DATA"))
137 #t))
138 (add-after 'install 'install-doc
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let ((doc (string-append (assoc-ref outputs "doc")
141 "/share/doc/" ,name "-" ,version)))
142 (copy-recursively "doc/t38_manual" doc)
143 #t)))
144 (add-after 'install 'move-static-libraries
145 (lambda* (#:key outputs #:allow-other-keys)
146 (let ((out (assoc-ref outputs "out"))
147 (static (assoc-ref outputs "static")))
148 (mkdir-p (string-append static "/lib"))
149 (with-directory-excursion out
150 (for-each (lambda (file)
151 (rename-file file
152 (string-append static "/"
153 file)))
154 (find-files "lib" "\\.a$")))
155 #t))))))
156 (native-inputs
157 `(("autoconf" ,autoconf)
158 ("automake" ,automake)
159 ("libtool" ,libtool)
160 ("pkg-config" ,pkg-config)
161 ;; For the tests
162 ("fftw" ,fftw)
163 ("libpcap" ,libpcap)
164 ("libsndfile" ,libsndfile)
165 ("libjpeg" ,libjpeg-turbo) ;XXX: should be propagated from libtiff
166 ("libtiff" ,libtiff)
167 ("netpbm" ,netpbm)
168 ("sox" ,sox)
169 ;; For the documentation
170 ("docbook-xml" ,docbook-xml-4.3)
171 ("docbook-xsl" ,docbook-xsl)
172 ("doxygen" ,doxygen)
173 ("libxml2" ,libxml2)
174 ("libxslt" ,libxslt)))
175 (synopsis "DSP library for telephony")
176 (description "SpanDSP is a library of DSP functions for telephony, in the
177 8000 sample per second world of E1s, T1s, and higher order PCM channels. It
178 contains low level functions, such as basic filters. It also contains higher
179 level functions, such as cadenced supervisory tone detection, and a complete
180 software FAX machine.")
181 (home-page "https://web.archive.org/web/20180626203108/\
182 https://www.soft-switch.org/index.html")
183 (license (list license:lgpl2.1+ ;for the library
184 license:gpl2+)))) ;for the test suites and support programs
185
186 (define-public commoncpp
187 (package
188 (name "commoncpp")
189 (version "1.8.1")
190 (source (origin
191 (method url-fetch)
192 (uri (string-append "mirror://gnu/" name "/commoncpp2-"
193 version ".tar.gz"))
194 (sha256 (base32
195 "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
196 (arguments
197 `(#:phases
198 (modify-phases %standard-phases
199 (add-before 'configure 'pre-configure
200 (lambda _
201 (substitute* "src/applog.cpp"
202 (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
203 #t)))))
204 (build-system gnu-build-system)
205 (synopsis "(u)Common C++ framework for threaded applications")
206 (description "GNU Common C++ is an portable, optimized class framework for
207 threaded applications, supporting concurrent synchronization, inter-process
208 communications via sockets, and various methods for data handling, such as
209 serialization and XML parsing. It includes the uCommon C++ library, a smaller
210 reimplementation.")
211 (license license:gpl2+) ; plus runtime exception
212 (properties '((ftp-directory . "/gnu/commoncpp")
213 (upstream-name . "commoncpp2")))
214 (home-page "https://www.gnu.org/software/commoncpp/")))
215
216 (define-public ucommon
217 (package
218 (name "ucommon")
219 (version "7.0.0")
220 (source (origin
221 (method url-fetch)
222 (uri (string-append "mirror://gnu/commoncpp/" name "-"
223 version ".tar.gz"))
224 (sha256 (base32
225 "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
226 (build-system gnu-build-system)
227 (inputs `(("gnutls" ,gnutls)))
228 (synopsis "Common C++ framework for threaded applications")
229 (description "GNU uCommon C++ is meant as a very light-weight C++ library
230 to facilitate using C++ design patterns even for very deeply embedded
231 applications, such as for systems using uclibc along with posix threading
232 support.")
233 (license license:gpl3+)
234 (home-page "https://www.gnu.org/software/commoncpp/")
235 (properties '((ftp-directory . "/gnu/commoncpp")))))
236
237 (define-public ccrtp
238 (package
239 (name "ccrtp")
240 (version "2.1.2")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
244 version ".tar.gz"))
245 (sha256 (base32
246 "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
247 (build-system gnu-build-system)
248 (inputs `(("ucommon" ,ucommon)
249 ("libgcrypt" ,libgcrypt)))
250 (native-inputs `(("pkg-config" ,pkg-config)))
251 (synopsis "Implementation of RTP (real-time transport protocol)")
252 (description "GNU ccRTP is an implementation of RTP, the real-time transport
253 protocol from the IETF. It is suitable both for high capacity servers and
254 personal client applications. It is flexible in its design, allowing it to
255 function as a framework for the framework, rather than just being a
256 packet-manipulation library.")
257 (license license:gpl2+) ; plus runtime exception
258 (home-page "https://www.gnu.org/software/ccrtp/")))
259
260
261 (define-public osip
262 (package
263 (name "osip")
264 (version "5.1.1")
265 (source (origin
266 (method url-fetch)
267 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
268 (patches (search-patches "osip-CVE-2017-7853.patch"))
269 (sha256
270 (base32
271 "0kgnxgzf968kbl6rx3hjsfb3jsg4ydgrsf35gzj319i1f8qjifv1"))))
272 (build-system gnu-build-system)
273
274 (synopsis "Library implementing SIP (RFC-3261)")
275 (description "GNU oSIP is an implementation of the SIP protocol. It is
276 used to provide multimedia and telecom software developers with an interface
277 to initiate and control SIP sessions.")
278 (license license:lgpl2.1+)
279 (properties '((ftp-directory . "/gnu/osip")
280 (upstream-name . "libosip2")))
281 (home-page "https://www.gnu.org/software/osip/")))
282
283
284 (define-public exosip
285 (package
286 (name "exosip")
287 (version "4.1.0")
288 (source (origin
289 (method url-fetch)
290 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
291 version ".tar.gz"))
292 (sha256 (base32
293 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
294 (build-system gnu-build-system)
295 (inputs `(("osip" ,osip)))
296 (synopsis "Sip abstraction library")
297 (description "EXosip is a library that hides the complexity of using the
298 SIP protocol for multimedia session establishment. This protocol is mainly to
299 be used by VoIP telephony applications (endpoints or conference server) but
300 might be also useful for any application that wish to establish sessions like
301 multiplayer games.")
302 (license license:gpl2+)
303 ;; (plus OpenSSL linking exception)
304 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
305 (home-page "https://savannah.nongnu.org/projects/exosip")))
306
307 (define-public sipwitch
308 (package
309 (name "sipwitch")
310 (version "1.9.15")
311 (source (origin
312 (method url-fetch)
313 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
314 version ".tar.gz"))
315 (sha256 (base32
316 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
317 (build-system gnu-build-system)
318 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
319 ;; cross-compiling. Among other issues there the program name "pkg-config"
320 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
321 ;; Fortunately we can avoid the use of pkg-config and set the dependency
322 ;; flags ourselves.
323 (arguments `(#:configure-flags
324 `("--without-pkg-config"
325 ,(string-append "UCOMMON_CFLAGS=-I"
326 (assoc-ref %build-inputs "ucommon") "/include")
327 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
328 ,(string-append "LIBOSIP2_CFLAGS=-I"
329 (assoc-ref %build-inputs "osip") "/include")
330 "LIBOSIP2_LIBS=-losipparser2 -losip2"
331 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
332 "/etc")
333 "EXOSIP2_LIBS=-leXosip2"
334 ,(string-append "EXOSIP2_CFLAGS=-I"
335 (assoc-ref %build-inputs "exosip")
336 "/include"))))
337 (inputs `(("ucommon" ,ucommon)
338 ("exosip" ,exosip)
339 ("osip" ,osip)))
340 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
341 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
342 uses the SIP protocol. Calls can be made from behind NAT firewalls and
343 without the need for a service provider. Its peer-to-peer design ensures that
344 there is no central point for media intercept or capture and thus it can be
345 used to construct a secure telephone system that operates over the public
346 internet.")
347 (license license:gpl3+)
348 (home-page "https://www.gnu.org/software/sipwitch/")))
349
350 (define-public libsrtp
351 (package
352 (name "libsrtp")
353 (version "2.3.0")
354 (source (origin
355 (method git-fetch)
356 (uri (git-reference
357 (url "https://github.com/cisco/libsrtp")
358 (commit (string-append "v" version))))
359 (file-name (git-file-name name version))
360 (sha256
361 (base32
362 "1f7i3jdh1wzdv7zjlz7gs3xw5jqig9zw8z9awsqqcp54f94xdpvd"))))
363 (native-inputs
364 `(("psmisc" ,psmisc) ;some tests require 'killall'
365 ("procps" ,procps)))
366 (build-system gnu-build-system)
367 (arguments
368 '(#:test-target "runtest"
369 #:phases (modify-phases %standard-phases
370 (add-after 'build 'build-shared
371 (lambda* (#:key (make-flags '()) #:allow-other-keys)
372 ;; Build the shared library separately because
373 ;; the test runner requires a static build.
374 (apply invoke "make" "shared_library" make-flags)
375 #t))
376 (add-after 'install 'remove-static-library
377 (lambda* (#:key outputs #:allow-other-keys)
378 (delete-file (string-append (assoc-ref outputs "out")
379 "/lib/libsrtp2.a"))
380 #t)))))
381 (synopsis "Secure RTP (SRTP) Reference Implementation")
382 (description
383 "This package provides an implementation of the Secure Real-time Transport
384 Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
385 supporting cryptographic kernel.")
386 (home-page "https://github.com/cisco/libsrtp")
387 (license license:bsd-3)))
388
389 (define-public libiax2
390 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
391 ;; This is the commit used by the Ring Project.
392 (package
393 (name "libiax2")
394 (version (string-append "0.0.0-1." (string-take commit 7)))
395 (source
396 (origin
397 (method git-fetch)
398 (uri (git-reference
399 (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
400 (commit commit)))
401 (file-name (git-file-name name version))
402 (sha256
403 (base32
404 "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
405 (build-system gnu-build-system)
406 (native-inputs
407 `(("autoconf" ,autoconf)
408 ("automake" ,automake)
409 ("libtool" ,libtool)))
410 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
411 (synopsis "Inter-Asterisk-Protocol library")
412 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
413 Voice-over-IP (VoIP) communications.")
414 ;; The file 'src/md5.c' is released into the public domain by RSA Data
415 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
416 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
417 ;; covered under the 'GPL'.
418 ;; The package as a whole is distributed under the LGPL 2.0.
419 (license (list license:lgpl2.0
420 license:public-domain
421 license:gpl2+)))))
422
423 (define-public seren
424 (package
425 (name "seren")
426 (version "0.0.21")
427 (source (origin
428 (method url-fetch)
429 (uri (string-append "http://holdenc.altervista.org/"
430 "seren/downloads/seren-" version
431 ".tar.gz"))
432 (sha256
433 (base32
434 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
435 (build-system gnu-build-system)
436 (arguments '(#:tests? #f)) ; no "check" target
437 (inputs
438 `(("alsa-lib" ,alsa-lib)
439 ("gmp" ,gmp)
440 ("libogg" ,libogg)
441 ("ncurses" ,ncurses)
442 ("opus" ,opus)))
443 (synopsis "Simple VoIP program to create conferences from the terminal")
444 (description
445 "Seren is a simple VoIP program based on the Opus codec that allows you
446 to create a voice conference from the terminal, with up to 10 participants,
447 without having to register accounts, exchange emails, or add people to contact
448 lists. All you need to join an existing conference is the host name or IP
449 address of one of the participants.")
450 (home-page "http://holdenc.altervista.org/seren/")
451 (license license:gpl3+)))
452
453 (define-public mumble
454 (package
455 (name "mumble")
456 (version "1.3.0")
457 (source (origin
458 (method url-fetch)
459 (uri (string-append "https://mumble.info/snapshot/"
460 name "-" version ".tar.gz"))
461 (sha256
462 (base32
463 "03dqg5yf6d7ilc1wydpshnv1ndssppcbadqcq20jm5j4fdaf53cs"))
464 (modules '((guix build utils)))
465 (snippet
466 `(begin
467 ;; Remove bundled software. Keep arc4random, celt-0.7.0,
468 ;; celt-0.11.0, qqbonjour, rnnoise, smallft.
469 (for-each
470 delete-file-recursively
471 '("3rdparty/GL" ; in mesa
472 "3rdparty/mach-override-build" ; for macx
473 "3rdparty/mach-override-src"
474 "3rdparty/minhook-build" ; for win32
475 "3rdparty/minhook-src"
476 "3rdparty/opus-build" ; in opus
477 "3rdparty/opus-src"
478 "3rdparty/sbcelt-helper-build" ; not enabled
479 "3rdparty/sbcelt-lib-build"
480 "3rdparty/sbcelt-src"
481 "3rdparty/speex-build" ; in speex
482 "3rdparty/speex-src"
483 "3rdparty/speexdsp-src" ; in speexdsp
484 "3rdparty/xinputcheck-build" ; for win32
485 "3rdparty/xinputcheck-src"))
486 #t))))
487 (build-system qt-build-system)
488 (arguments
489 `(#:tests? #f ; no "check" target
490 #:phases
491 (modify-phases %standard-phases
492 (replace 'configure
493 (lambda* (#:key inputs outputs #:allow-other-keys)
494 (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
495 (string-append "MUMBLE_PYTHON="
496 (string-append (assoc-ref inputs "python")
497 "/bin/python3"))
498 (string-append "CONFIG+="
499 (string-join
500 ;; Options used are listed in the same order
501 ;; as in the "INSTALL" file
502 ;; (plus the final "packaged" and "release").
503 (list "no-bundled-speex" ; in speex
504 "no-bundled-opus" ; in opus
505 "no-g15" ; not packaged
506 "no-jackaudio" ; use pulse
507 "no-oss" ; use pulse
508 "no-alsa" ; use pulse
509 "no-update"
510 "no-embed-qt-translations"
511 "no-ice" ; not packaged
512 "packaged"
513 "release")))
514 (string-append "DEFINES+="
515 "PLUGIN_PATH="
516 (assoc-ref outputs "out")
517 "/lib/mumble"))))
518 (add-before 'configure 'fix-libspeechd-include
519 (lambda _
520 (substitute* "src/mumble/TextToSpeech_unix.cpp"
521 (("libspeechd.h") "speech-dispatcher/libspeechd.h"))
522 #t))
523 ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
524 (add-before 'configure 'fix-statistic-gathering-default
525 (lambda _
526 (substitute* "src/mumble/Settings.cpp"
527 (("bUsage = true;") "bUsage = false;"))
528 #t))
529 (add-before 'install 'disable-murmur-ice
530 (lambda _
531 (substitute* "scripts/murmur.ini.system"
532 (("^ice=") ";ice="))
533 #t))
534 (replace 'install ; install phase does not exist
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let* ((out (assoc-ref outputs "out"))
537 (etc (string-append out "/etc/murmur"))
538 (dbus (string-append out "/etc/dbus-1/system.d/"))
539 (bin (string-append out "/bin"))
540 (services (string-append out "/share/services"))
541 (applications (string-append out "/share/applications"))
542 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
543 (man (string-append out "/share/man/man1"))
544 (lib (string-append out "/lib/mumble")))
545 (install-file "release/mumble" bin)
546 (install-file "scripts/mumble-overlay" bin)
547 (install-file "scripts/mumble.protocol" services)
548 (install-file "scripts/mumble.desktop" applications)
549 (install-file "icons/mumble.svg" icons)
550 (install-file "man/mumble-overlay.1" man)
551 (install-file "man/mumble.1" man)
552 (install-file "release/murmurd" bin)
553 (install-file "scripts/murmur.ini.system" etc)
554 (rename-file (string-append etc "/murmur.ini.system")
555 (string-append etc "/murmur.ini"))
556 (install-file "scripts/murmur.conf" dbus)
557 (install-file "man/murmurd.1" man)
558 (for-each (lambda (file) (install-file file lib))
559 (find-files "." "\\.so\\."))
560 (for-each (lambda (file) (install-file file lib))
561 (find-files "release/plugins" "\\.so$"))))))))
562 (inputs
563 `(("avahi" ,avahi)
564 ("boost" ,boost)
565 ("libsndfile" ,libsndfile)
566 ("libxi" ,libxi)
567 ("mesa" ,mesa) ; avoid bundled
568 ("openssl" ,openssl)
569 ("opus" ,opus) ; avoid bundled
570 ("protobuf" ,protobuf)
571 ("pulseaudio" ,pulseaudio)
572 ("qtbase" ,qtbase)
573 ("qtsvg" ,qtsvg)
574 ("speech-dispatcher" ,speech-dispatcher)
575 ("speex" ,speex) ; avoid bundled
576 ("speexdsp" ,speexdsp))) ; avoid bundled
577 (native-inputs
578 `(("pkg-config" ,pkg-config)
579 ("python" ,python)
580 ("qttools" ,qttools)))
581 (synopsis "Low-latency, high quality voice chat software")
582 (description
583 "Mumble is an low-latency, high quality voice chat
584 software primarily intended for use while gaming.
585 Mumble consists of two applications for separate usage:
586 @code{mumble} for the client, and @code{murmur} for the server.")
587 (home-page "https://wiki.mumble.info/wiki/Main_Page")
588 (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
589 license:bsd-2 ; celt-0.11.0
590 license:isc)))) ; arc4random
591
592 (define-public twinkle
593 (package
594 (name "twinkle")
595 (version "1.10.2")
596 (source (origin
597 (method git-fetch)
598 (uri (git-reference
599 (url "https://github.com/LubosD/twinkle")
600 (commit (string-append "v" version))))
601 (file-name (git-file-name name version))
602 (sha256
603 (base32
604 "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
605 (build-system cmake-build-system)
606 (arguments
607 `(#:tests? #f ; no test target
608 #:configure-flags '("-DWITH_SPEEX=On")
609 #:phases
610 (modify-phases %standard-phases
611 (add-after 'install 'wrap-executable
612 (lambda* (#:key inputs outputs #:allow-other-keys)
613 (let ((out (assoc-ref outputs "out")))
614 (wrap-program (string-append out "/bin/twinkle")
615 `("QT_PLUGIN_PATH" ":" prefix
616 ,(map (lambda (label)
617 (string-append (assoc-ref inputs label)
618 "/lib/qt5/plugins"))
619 '("qtbase" "qtdeclarative")))
620 `("QML2_IMPORT_PATH" ":" prefix
621 ,(map (lambda (label)
622 (string-append (assoc-ref inputs label)
623 "/lib/qt5/qml"))
624 '("qtdeclarative" "qtquickcontrols"))))
625 #t))))))
626 (native-inputs
627 `(("bison" ,bison)
628 ("flex" ,flex)
629 ("readline" ,readline)
630 ("file" ,file)
631 ("ucommon" ,ucommon)
632 ("ccrtp" ,ccrtp)
633 ("libxml2" ,libxml2)
634 ("speex" ,speex)
635 ("speexdsp" ,speexdsp)
636 ("libsndfile" ,libsndfile)
637 ("alsa-lib" ,alsa-lib)
638 ("qttools" ,qttools)))
639 (inputs
640 `(("qtbase" ,qtbase)
641 ("qtdeclarative" ,qtdeclarative)
642 ("qtquickcontrols" ,qtquickcontrols)))
643 (home-page "http://twinkle.dolezel.info/")
644 (synopsis "Softphone for voice over IP and instant messaging")
645 (description "Twinkle is a softphone for your voice over IP and instant
646 messaging communcations using the SIP protocol. You can use it for direct IP
647 phone to IP phone communication or in a network using a SIP proxy to route your
648 calls and messages")
649 (license license:gpl2+)))
650
651 (define-public pjproject
652 (package
653 (name "pjproject")
654 (version "2.9")
655 (source
656 (origin
657 (method git-fetch)
658 (uri (git-reference
659 (url "https://github.com/pjsip/pjproject.git")
660 (commit "5dfa75be7d69047387f9b0436dd9492bbbf03fe4")))
661 (modules '((guix build utils)))
662 (snippet
663 '(begin
664 (let ((third-party-directories
665 ;; Things we don't need:
666 ;; BaseClasses - contains libraries from Windows SDK
667 ;; we don't need it, at least not now.
668 (list "BaseClasses" "g7221" "ilbc" "milenage"
669 "speex" "threademulation" "yuv" "bdsound"
670 "gsm" "mp3" "resample" "srtp" "webrtc"
671 ;; Keep only resample, build and README.txt.
672 "build/baseclasses" "build/g7221" "build/gsm"
673 "build/ilbc" "build/milenage" "build/resample"
674 "build/samplerate" "build/speex" "build/srtp"
675 "build/webrtc" "build/yuv")))
676 ;; Keep only Makefiles related to resample.
677 (for-each (lambda (directory)
678 (delete-file-recursively
679 (string-append "third_party/" directory)))
680 third-party-directories)
681 #t)
682 (let ((third-party-dirs
683 (list "gsm" "ilbc" "speex" "g7221" "srtp"
684 "portaudio" "resample")))
685 (for-each
686 (lambda (dirs)
687 (substitute* "third_party/build/os-linux.mak"
688 (((string-append "DIRS += " dirs)) "")))
689 third-party-dirs))))
690 (file-name (git-file-name name version))
691 (sha256
692 (base32
693 "1ayj6n7zd5wvd1nzj2k9s57fb4ckc2fv92k5sjvhd87yg69k3393"))))
694 (build-system gnu-build-system)
695 (inputs
696 `(("portaudio" ,portaudio)))
697 (propagated-inputs
698 ;; These packages are referenced in the Libs field of the pkg-config
699 ;; file that will be installed by pjproject.
700 `(("speex" ,speex)
701 ("libsrtp" ,libsrtp)
702 ("gnutls" ,gnutls)
703 ("resample", resample)
704 ("util-linux" ,util-linux "lib")))
705 (native-inputs
706 `(("autoconf" ,autoconf)
707 ("automake" ,automake)
708 ("pkg-config" ,pkg-config)
709 ("libtool" ,libtool)))
710 (arguments
711 `(;; FIXME make: No rule to make target
712 ;; 'pjlib-test-unknown-[something]-gnu'.
713 #:tests? #f
714 ;; #:test-target "selftest"
715 #:phases
716 (modify-phases %standard-phases
717 (add-before 'build 'build-dep
718 (lambda _ (invoke "make" "dep")))
719 (add-before 'patch-source-shebangs 'autoconf
720 (lambda _
721 (invoke "autoconf" "-v" "-f" "-i" "-o"
722 "aconfigure" "aconfigure.ac")))
723 (add-before 'autoconf 'disable-some-tests
724 ;; Three of the six test programs fail due to missing network
725 ;; access.
726 (lambda _
727 (substitute* "Makefile"
728 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
729 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
730 #t)))))
731 (home-page "https://www.pjsip.org")
732 (synopsis "Session Initiation Protocol (SIP) stack")
733 (description "PJProject provides an implementation of the Session
734 Initiation Protocol (SIP) and a multimedia framework.")
735 (license license:gpl2+)))
736
737 (define %jami-version "20191101.3.67671e7")
738
739 (define* (jami-source #:key without-daemon)
740 (origin
741 (method url-fetch)
742 (uri (string-append "https://dl.jami.net/ring-release/tarballs/ring_"
743 %jami-version
744 ".tar.gz"))
745 (modules '((guix build utils)))
746 (snippet
747 (if without-daemon
748 '(begin
749 (delete-file-recursively "daemon/contrib"))
750 #f))
751 (sha256
752 (base32
753 "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0"))))
754
755 (define-public pjproject-jami
756 (package
757 (inherit pjproject)
758 (name "pjproject-jami")
759 (native-inputs
760 `(("savoir-faire-linux-patches" ,(jami-source))
761 ,@(package-native-inputs pjproject)))
762 (arguments
763 `(#:tests? #f
764 ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
765 #:configure-flags
766 (list "--disable-oss"
767 "--disable-sound"
768 "--disable-video"
769 "--enable-ext-sound"
770 "--disable-speex-aec"
771 "--disable-g711-codec"
772 "--disable-l16-codec"
773 "--disable-gsm-codec"
774 "--disable-g722-codec"
775 "--disable-g7221-codec"
776 "--disable-speex-codec"
777 "--disable-ilbc-codec"
778 "--disable-opencore-amr"
779 "--disable-silk"
780 "--disable-sdl"
781 "--disable-ffmpeg"
782 "--disable-v4l2"
783 "--disable-openh264"
784 "--disable-resample"
785 "--disable-libwebrtc"
786 "--with-gnutls"
787 "--with-external-srtp"
788 ;; We need -fPIC or else we get the following error when linking
789 ;; against pjproject-jami:
790 ;; relocation R_X86_64_32S against `.rodata' can not be used when
791 ;; making a shared object;
792 "CFLAGS=-fPIC"
793 "CXXFLAGS=-fPIC")
794 #:phases
795 (modify-phases %standard-phases
796 (add-after 'unpack 'make-git-checkout-writable
797 (lambda _
798 (for-each make-file-writable (find-files "."))
799 #t))
800 (add-after 'unpack 'apply-patches
801 (lambda* (#:key inputs #:allow-other-keys)
802 (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux patches")
803 ;; Comes from
804 ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
805 ;; WARNING: These amount for huge changes in pjproject.
806 (savoir-faire-linux-patches
807 '("fix_turn_alloc_failure"
808 "rfc2466"
809 "ipv6"
810 "multiple_listeners"
811 "pj_ice_sess"
812 "fix_turn_fallback"
813 "fix_ioqueue_ipv6_sendto"
814 "add_dtls_transport"
815 "rfc6544"
816 "ice_config"
817 "sip_config"
818 "fix_first_packet_turn_tcp"
819 "fix_ebusy_turn"
820 "ignore_ipv6_on_transport_check"
821 "fix_turn_connection_failure"
822 ;; "uwp_vs" ; for windows
823 "disable_local_resolution")))
824 (mkdir-p savoir-faire-linux-patches-directory)
825 (invoke "tar" "-xvf" (assoc-ref inputs "savoir-faire-linux-patches")
826 "-C" savoir-faire-linux-patches-directory
827 "--strip-components=5"
828 "ring-project/daemon/contrib/src/pjproject")
829 (for-each
830 (lambda (file)
831 (invoke "patch" "--force" "-p1" "-i"
832 (string-append savoir-faire-linux-patches-directory "/"
833 file ".patch")))
834 savoir-faire-linux-patches))
835 #t))
836 ;; TODO: We could use substitute-keyword-arguments instead of
837 ;; repeating the phases from pjproject, but somehow it does
838 ;; not work.
839 (add-before 'build 'build-dep
840 (lambda _ (invoke "make" "dep")))
841 (add-before 'patch-source-shebangs 'autoconf
842 (lambda _
843 (invoke "autoconf" "-v" "-f" "-i" "-o"
844 "aconfigure" "aconfigure.ac")))
845 (add-before 'autoconf 'disable-some-tests
846 ;; Three of the six test programs fail due to missing network
847 ;; access.
848 (lambda _
849 (substitute* "Makefile"
850 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
851 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
852 #t)))))))
853
854 (define-public libring
855 (package
856 (name "libring")
857 (version %jami-version)
858 (source (jami-source #:without-daemon #t))
859 (build-system gnu-build-system)
860 (inputs
861 ;; Missing (optional?) dep: libnatpmp.
862 `(("alsa-lib" ,alsa-lib)
863 ("boost" ,boost)
864 ("dbus-c++" ,dbus-c++)
865 ("eudev" ,eudev)
866 ("ffmpeg" ,ffmpeg)
867 ("flac" ,flac)
868 ("gmp" ,gmp)
869 ("gsm" ,gsm)
870 ("jack" ,jack-1)
871 ("jsoncpp" ,jsoncpp)
872 ("libogg" ,libogg)
873 ("libva" ,libva)
874 ("opendht" ,opendht)
875 ("opus" ,opus)
876 ("pcre" ,pcre)
877 ("pulseaudio" ,pulseaudio)
878 ("libsamplerate" ,libsamplerate)
879 ("libsndfile" ,libsndfile)
880 ("speex" ,speex)
881 ("speexdsp" ,speexdsp)
882 ("libupnp" ,libupnp)
883 ("libvorbis" ,libvorbis)
884 ("libx264" ,libx264)
885 ("libvdpau" ,libvdpau)
886 ("yaml-cpp" ,yaml-cpp)
887 ("zlib" ,zlib)
888 ("openssl" ,openssl)
889 ("libsecp256k1" ,libsecp256k1)
890 ("python" ,python)
891 ("python-wrapper" ,python-wrapper)
892 ("restinio" ,restinio)
893 ("libx11" ,libx11)
894 ("asio" ,asio)
895 ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
896 ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
897 ("pjproject" ,pjproject-jami)))
898 (native-inputs
899 `(("autoconf" ,autoconf)
900 ("automake" ,automake)
901 ("libtool" ,libtool)
902 ("pkg-config" ,pkg-config)
903 ("which" ,which)
904 ("cppunit" ,cppunit)
905 ("perl" ,perl))) ; Needed for documentation.
906 (arguments
907 `(#:tests? #f ; The tests fail to compile due to missing headers.
908 #:phases
909 (modify-phases %standard-phases
910 (add-after 'unpack 'change-directory
911 (lambda _
912 (chdir "daemon")
913 #t))
914 (add-before 'build 'add-lib-dir
915 (lambda _
916 (mkdir-p "src/lib")
917 #t)))))
918 (synopsis "Distributed multimedia communications platform")
919 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
920 video and chat communication platform that requires no centralized server and
921 leaves the power of privacy in the hands of the user. It supports the SIP and
922 IAX protocols, as well as decentralized calling using P2P-DHT.
923
924 This package provides a library and daemon implementing the Jami core
925 functionality.")
926 (home-page "https://jami.net/")
927 (license license:gpl3+)))
928
929 (define-public libringclient
930 (package
931 (inherit libring)
932 (name "libringclient")
933 (build-system cmake-build-system)
934 (propagated-inputs
935 `(("libring" ,libring) ; For 'dring'.
936 ("qtbase" ,qtbase) ; Qt is included in several installed headers.
937 ("qttools" ,qttools)))
938 (arguments
939 `(#:tests? #f ; There is no testsuite.
940 #:configure-flags
941 (list (string-append "-DRING_BUILD_DIR="
942 (assoc-ref %build-inputs "libring") "/include"))
943 #:phases
944 (modify-phases %standard-phases
945 (add-after 'unpack 'change-directory
946 (lambda _
947 (chdir "lrc")
948 #t))
949 (add-before 'configure 'fix-dbus-interfaces-path
950 (lambda* (#:key inputs #:allow-other-keys)
951 (substitute* "CMakeLists.txt"
952 (("\\$\\{CMAKE_INSTALL_PREFIX\\}(/share/dbus-1/interfaces)" _ dbus-interfaces-path-suffix)
953 (string-append (assoc-ref inputs "libring")
954 dbus-interfaces-path-suffix))))))))
955 (synopsis "Distributed multimedia communications platform")
956 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
957 video and chat communication platform that requires no centralized server and
958 leaves the power of privacy in the hands of the user. It supports the SIP and
959 IAX protocols, as well as decentralized calling using P2P-DHT.
960
961 This package provides a library common to all Jami clients.")
962 (home-page "https://jami.net")
963 (license license:gpl3+)))
964
965 (define-public jami
966 (package
967 (inherit libring)
968 (name "jami")
969 (build-system cmake-build-system)
970 (inputs
971 `(("libringclient" ,libringclient)
972 ("gtk+" ,gtk+)
973 ("qrencode" ,qrencode)
974 ("libnotify" ,libnotify)
975 ("clutter" ,clutter)
976 ("clutter-gtk" ,clutter-gtk)
977 ("libcanberra" ,libcanberra)
978 ("webkitgtk" ,webkitgtk)))
979 (native-inputs
980 `(("pkg-config" ,pkg-config)
981 ("gettext" ,gettext-minimal)
982 ("glib:bin" ,glib "bin")
983 ("doxygen" ,doxygen)))
984 (propagated-inputs
985 `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
986 ("adwaita-icon-theme" ,adwaita-icon-theme)
987 ("evolution-data-server" ,evolution-data-server)))
988 (arguments
989 `(#:tests? #f ; There is no testsuite.
990 #:phases
991 (modify-phases %standard-phases
992 (add-after 'unpack 'change-directory
993 (lambda _
994 (chdir "client-gnome")
995 #t)))))
996 (synopsis "Distributed, privacy-respecting communication program")
997 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
998 video and chat communication platform that requires no centralized server and
999 leaves the power of privacy in the hands of the user. It supports the SIP and
1000 IAX protocols, as well as decentralized calling using P2P-DHT.
1001
1002 This package provides the Jami client for the GNOME desktop.")
1003 (home-page "https://jami.net")
1004 (license license:gpl3+)))
1005
1006 (define-public jami-client-gnome
1007 (deprecated-package "jami-client-gnome" jami))
1008
1009 (define-public libtgvoip
1010 (package
1011 (name "libtgvoip")
1012 (version "2.4.4")
1013 (source
1014 (origin
1015 (method git-fetch)
1016 (uri (git-reference
1017 (url "https://github.com/grishka/libtgvoip.git")
1018 (commit version)))
1019 (file-name (git-file-name name version))
1020 ;; Fix compilation on i686-linux architecture.
1021 ;; NOTE: Applying these patches is order-dependent!
1022 ;; The patch for WebRTC /must/ precede the patch for SSE2.
1023 (patches
1024 (search-patches "libtgvoip-disable-webrtc.patch"
1025 "libtgvoip-disable-sse2.patch"))
1026 (sha256
1027 (base32
1028 "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
1029 (build-system gnu-build-system)
1030 (inputs
1031 `(("alsa-lib" ,alsa-lib)
1032 ("libopusenc" ,libopusenc)
1033 ("openssl" ,openssl)
1034 ("pulseaudio" ,pulseaudio)))
1035 (synopsis "VoIP library for Telegram clients")
1036 (description "A collection of libraries and header files for implementing
1037 telephony functionality into custom Telegram clients.")
1038 (home-page "https://github.com/zevlg/libtgvoip")
1039 (license license:unlicense)))