5ef93fc3f1e7f1a1e4b41b9bfa99db34f7312ada
[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 Nikita <nikita@n0.is>
9 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017, 2018, 2021 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, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
21 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
22 ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
23 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
24 ;;; Copyright © 2021 Demis Balbach <db@minikn.xyz>
25 ;;;
26 ;;; This file is part of GNU Guix.
27 ;;;
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
32 ;;;
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
37 ;;;
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40
41 (define-module (gnu packages telephony)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages admin)
44 #:use-module (gnu packages aidc)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages avahi)
48 #:use-module (gnu packages audio)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages cpp)
54 #:use-module (gnu packages crypto)
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages file)
59 #:use-module (gnu packages protobuf)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gnupg)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages libcanberra)
68 #:use-module (gnu packages linphone)
69 #:use-module (gnu packages linux)
70 #:use-module (gnu packages multiprecision)
71 #:use-module (gnu packages ncurses)
72 #:use-module (gnu packages netpbm)
73 #:use-module (gnu packages networking)
74 #:use-module (gnu packages pcre)
75 #:use-module (gnu packages perl)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages pulseaudio)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages qt)
80 #:use-module (gnu packages serialization)
81 #:use-module (gnu packages speech)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages upnp)
84 #:use-module (gnu packages video)
85 #:use-module (gnu packages webkit)
86 #:use-module (gnu packages xiph)
87 #:use-module (gnu packages xorg)
88 #:use-module (gnu packages xml)
89 #:use-module (gnu packages readline)
90 #:use-module (gnu packages bison)
91 #:use-module (gnu packages flex)
92 #:use-module ((guix licenses) #:prefix license:)
93 #:use-module (guix utils)
94 #:use-module (guix packages)
95 #:use-module (guix gexp)
96 #:use-module (guix download)
97 #:use-module (guix git-download)
98 #:use-module (guix build-system cmake)
99 #:use-module (guix build-system gnu)
100 #:use-module (guix build-system qt))
101
102 (define-public phonesim
103 (package
104 (name "phonesim")
105 (version "1.21")
106 (source
107 (origin
108 (method git-fetch)
109 (uri (git-reference
110 (url "https://git.kernel.org/pub/scm/network/ofono/phonesim")
111 (commit "a7c844d45b047b2dae5b0877816c346fce4c47b9")))
112 (file-name (git-file-name name version))
113 (sha256
114 (base32 "0rc1c2vr03dmi1dr3skj57v77ga9c22g29xs1qiphqms4isby9cq"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:configure-flags
118 (list "--enable-maintainer-mode"
119 "CC=" ,(cc-for-target))))
120 (native-inputs
121 (list automake autoconf pkg-config))
122 (inputs
123 (list qtbase-5 qtdeclarative-5))
124 (synopsis "Phone Simulator for modem testing")
125 (description
126 "Phonesim is a modem emulator that oFono uses for development and
127 testing. This allows oFono to be used by any host without requiring special
128 GSM (or other) hardware.")
129 (home-page "https://git.kernel.org/pub/scm/network/ofono/phonesim")
130 (license license:gpl2+)))
131
132 (define-public libilbc
133 (package
134 (name "libilbc")
135 (version "2.0.2")
136 (source
137 (origin
138 (method git-fetch)
139 (uri
140 (git-reference
141 (url "https://github.com/TimothyGu/libilbc")
142 (commit
143 (string-append "v" version))))
144 (file-name
145 (git-file-name name version))
146 (sha256
147 (base32
148 "1j1pn1w1198qvdiq2hgv9hkyq2nqcvmfnwlgppac633idkjnjrqx"))))
149 (build-system cmake-build-system)
150 (arguments
151 `(#:tests? #f)) ; No target
152 (native-inputs
153 (list pkg-config))
154 (synopsis "Libre iLBC codec")
155 (description "LibiLBC is a packaging friendly copy of the iLBC codec from
156 the WebRTC project. It provides a base for distribution packages and can be
157 used as drop-in replacement for the non-free code from RFC 3591.")
158 (home-page "https://github.com/TimothyGu/libilbc")
159 (license license:bsd-3)))
160
161 (define-public spandsp
162 (package
163 (name "spandsp")
164 (version "0.0.6")
165 (source
166 (origin
167 (method url-fetch)
168 (uri
169 ;; The original upstream has been down since the end of March 2020.
170 (string-append "https://web.archive.org/web/20180626203108/"
171 "https://www.soft-switch.org/downloads/" name "/"
172 name "-" version ".tar.gz"))
173 (sha256
174 (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
175 (build-system gnu-build-system)
176 (outputs '("out" "doc" "static")) ;doc contains HTML documentation
177 (arguments
178 `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
179 #:parallel-build? #f ;non-deterministic build failures may occur otherwise
180 #:parallel-tests? #f ;fails removing the same the files twice otherwise
181 #:phases (modify-phases %standard-phases
182 (add-after 'unpack 'patch-configure.ac
183 (lambda _
184 ;; spandsp looks at hard coded locations of the FHS to
185 ;; find libxml2.
186 (substitute* "configure.ac"
187 (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
188 (string-append all
189 "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
190 "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
191 ;; Force a regeneration of the autotools build system.
192 (delete-file "autogen.sh")
193 (delete-file "configure")
194 #t))
195 (add-after 'unpack 'do-not-install-data-files
196 ;; The .tiff images produced for tests are not
197 ;; reproducible and it is not desirable to have those
198 ;; distributed.
199 (lambda _
200 (substitute* '("test-data/itu/fax/Makefile.am"
201 "test-data/etsi/fax/Makefile.am")
202 (("nobase_data_DATA")
203 "noinst_DATA"))
204 #t))
205 (add-after 'install 'install-doc
206 (lambda* (#:key outputs #:allow-other-keys)
207 (let ((doc (string-append (assoc-ref outputs "doc")
208 "/share/doc/" ,name "-" ,version)))
209 (copy-recursively "doc/t38_manual" doc)
210 #t)))
211 (add-after 'install 'move-static-libraries
212 (lambda* (#:key outputs #:allow-other-keys)
213 (let ((out (assoc-ref outputs "out"))
214 (static (assoc-ref outputs "static")))
215 (mkdir-p (string-append static "/lib"))
216 (with-directory-excursion out
217 (for-each (lambda (file)
218 (rename-file file
219 (string-append static "/"
220 file)))
221 (find-files "lib" "\\.a$")))
222 #t))))))
223 (native-inputs
224 `(("autoconf" ,autoconf)
225 ("automake" ,automake)
226 ("libtool" ,libtool)
227 ("pkg-config" ,pkg-config)
228 ;; For the tests
229 ("fftw" ,fftw)
230 ("libpcap" ,libpcap)
231 ("libsndfile" ,libsndfile)
232 ("libjpeg" ,libjpeg-turbo) ;XXX: should be propagated from libtiff
233 ("libtiff" ,libtiff)
234 ("netpbm" ,netpbm)
235 ("sox" ,sox)
236 ;; For the documentation
237 ("docbook-xml" ,docbook-xml-4.3)
238 ("docbook-xsl" ,docbook-xsl)
239 ("doxygen" ,doxygen)
240 ("libxml2" ,libxml2)
241 ("libxslt" ,libxslt)))
242 (synopsis "DSP library for telephony")
243 (description "SpanDSP is a library of DSP functions for telephony, in the
244 8000 sample per second world of E1s, T1s, and higher order PCM channels. It
245 contains low level functions, such as basic filters. It also contains higher
246 level functions, such as cadenced supervisory tone detection, and a complete
247 software FAX machine.")
248 (home-page "https://web.archive.org/web/20180626203108/\
249 https://www.soft-switch.org/index.html")
250 (license (list license:lgpl2.1+ ;for the library
251 license:gpl2+)))) ;for the test suites and support programs
252
253 (define-public commoncpp
254 (package
255 (name "commoncpp")
256 (version "1.8.1")
257 (source (origin
258 (method url-fetch)
259 (uri (string-append "mirror://gnu/" name "/commoncpp2-"
260 version ".tar.gz"))
261 (sha256 (base32
262 "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
263 (arguments
264 `(#:phases
265 (modify-phases %standard-phases
266 (add-before 'configure 'pre-configure
267 (lambda _
268 (substitute* "src/applog.cpp"
269 (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
270 #t)))))
271 (build-system gnu-build-system)
272 (synopsis "(u)Common C++ framework for threaded applications")
273 (description "GNU Common C++ is an portable, optimized class framework for
274 threaded applications, supporting concurrent synchronization, inter-process
275 communications via sockets, and various methods for data handling, such as
276 serialization and XML parsing. It includes the uCommon C++ library, a smaller
277 reimplementation.")
278 (license license:gpl2+) ; plus runtime exception
279 (properties '((ftp-directory . "/gnu/commoncpp")
280 (upstream-name . "commoncpp2")))
281 (home-page "https://www.gnu.org/software/commoncpp/")))
282
283 (define-public ucommon
284 (package
285 (name "ucommon")
286 (version "7.0.0")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "mirror://gnu/commoncpp/" name "-"
290 version ".tar.gz"))
291 (sha256 (base32
292 "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
293 (build-system gnu-build-system)
294 (inputs (list gnutls))
295 (synopsis "Common C++ framework for threaded applications")
296 (description "GNU uCommon C++ is meant as a very light-weight C++ library
297 to facilitate using C++ design patterns even for very deeply embedded
298 applications, such as for systems using uclibc along with posix threading
299 support.")
300 (license license:gpl3+)
301 (home-page "https://www.gnu.org/software/commoncpp/")
302 (properties '((ftp-directory . "/gnu/commoncpp")))))
303
304 (define-public ccrtp
305 (package
306 (name "ccrtp")
307 (version "2.1.2")
308 (source (origin
309 (method url-fetch)
310 (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
311 version ".tar.gz"))
312 (sha256 (base32
313 "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
314 (build-system gnu-build-system)
315 (inputs (list ucommon libgcrypt))
316 (native-inputs (list pkg-config))
317 (synopsis "Implementation of RTP (real-time transport protocol)")
318 (description "GNU ccRTP is an implementation of RTP, the real-time transport
319 protocol from the IETF. It is suitable both for high capacity servers and
320 personal client applications. It is flexible in its design, allowing it to
321 function as a framework for the framework, rather than just being a
322 packet-manipulation library.")
323 (license license:gpl2+) ; plus runtime exception
324 (home-page "https://www.gnu.org/software/ccrtp/")))
325
326 (define-public zrtpcpp
327 (package
328 (name "zrtpcpp")
329 (version "4.6.6")
330 (source
331 (origin
332 (method git-fetch)
333 (uri
334 (git-reference
335 (url "https://github.com/wernerd/ZRTPCPP")
336 (commit
337 (string-append "V" version))))
338 (file-name
339 (git-file-name name version))
340 (sha256
341 (base32
342 "06vphvh4dgi7ah5qkq53wqvswv8l273x0xwbc447qmgvamm0x1vs"))))
343 (build-system cmake-build-system)
344 (arguments
345 `(#:tests? #f)) ; No target
346 (native-inputs
347 (list pkg-config))
348 (inputs
349 (list ccrtp ucommon))
350 (synopsis "C++ Implementation of ZRTP protocol")
351 (description "GNU ZRTP C++ provides a library that adds ZRTP support to the
352 GNU ccRTP stack and serves as library for other RTP stacks
353 (PJSIP, GStreamer).")
354 (home-page "https://www.gnu.org/software/ccrtp/zrtp")
355 (license license:lgpl3+)))
356
357 (define-public osip
358 (package
359 (name "osip")
360 (version "5.2.1")
361 (source (origin
362 (method url-fetch)
363 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
364 (patches (search-patches "osip-CVE-2017-7853.patch"))
365 (sha256
366 (base32
367 "1wibs2zs035ay7qvl5ai8drv6f0xw7iscb0frmpgax3pisy88dzf"))))
368 (build-system gnu-build-system)
369
370 (synopsis "Library implementing SIP (RFC-3261)")
371 (description "GNU oSIP is an implementation of the SIP protocol. It is
372 used to provide multimedia and telecom software developers with an interface
373 to initiate and control SIP sessions.")
374 (license license:lgpl2.1+)
375 (properties '((ftp-directory . "/gnu/osip")
376 (upstream-name . "libosip2")))
377 (home-page "https://www.gnu.org/software/osip/")))
378
379
380 (define-public exosip
381 (package
382 (name "exosip")
383 (version "4.1.0")
384 (source (origin
385 (method url-fetch)
386 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
387 version ".tar.gz"))
388 (sha256 (base32
389 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
390 (build-system gnu-build-system)
391 (inputs (list osip))
392 (synopsis "Sip abstraction library")
393 (description "EXosip is a library that hides the complexity of using the
394 SIP protocol for multimedia session establishment. This protocol is mainly to
395 be used by VoIP telephony applications (endpoints or conference server) but
396 might be also useful for any application that wish to establish sessions like
397 multiplayer games.")
398 (license license:gpl2+)
399 ;; (plus OpenSSL linking exception)
400 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
401 (home-page "https://savannah.nongnu.org/projects/exosip")))
402
403 (define-public sipwitch
404 (package
405 (name "sipwitch")
406 (version "1.9.15")
407 (source (origin
408 (method url-fetch)
409 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
410 version ".tar.gz"))
411 (sha256 (base32
412 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
413 (build-system gnu-build-system)
414 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
415 ;; cross-compiling. Among other issues there the program name "pkg-config"
416 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
417 ;; Fortunately we can avoid the use of pkg-config and set the dependency
418 ;; flags ourselves.
419 (arguments `(#:configure-flags
420 `("--without-pkg-config"
421 ,(string-append "UCOMMON_CFLAGS=-I"
422 (assoc-ref %build-inputs "ucommon") "/include")
423 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
424 ,(string-append "LIBOSIP2_CFLAGS=-I"
425 (assoc-ref %build-inputs "osip") "/include")
426 "LIBOSIP2_LIBS=-losipparser2 -losip2"
427 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
428 "/etc")
429 "EXOSIP2_LIBS=-leXosip2"
430 ,(string-append "EXOSIP2_CFLAGS=-I"
431 (assoc-ref %build-inputs "exosip")
432 "/include"))))
433 (inputs (list ucommon exosip osip))
434 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
435 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
436 uses the SIP protocol. Calls can be made from behind NAT firewalls and
437 without the need for a service provider. Its peer-to-peer design ensures that
438 there is no central point for media intercept or capture and thus it can be
439 used to construct a secure telephone system that operates over the public
440 internet.")
441 (license license:gpl3+)
442 (home-page "https://www.gnu.org/software/sipwitch/")))
443
444 (define-public libsrtp
445 (package
446 (name "libsrtp")
447 (version "2.4.2")
448 (source (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/cisco/libsrtp")
452 (commit (string-append "v" version))))
453 (file-name (git-file-name name version))
454 (sha256
455 (base32
456 "1gswpjm4jacfxmgglbf8hxi3yzsag4drk4q943p0wkmv21zj8l78"))))
457 (native-inputs
458 (list psmisc ;some tests require 'killall'
459 procps))
460 (build-system gnu-build-system)
461 (arguments
462 '(#:test-target "runtest"
463 #:phases (modify-phases %standard-phases
464 (add-after 'build 'build-shared
465 (lambda* (#:key (make-flags '()) #:allow-other-keys)
466 ;; Build the shared library separately because
467 ;; the test runner requires a static build.
468 (apply invoke "make" "shared_library" make-flags)
469 #t))
470 (add-after 'install 'remove-static-library
471 (lambda* (#:key outputs #:allow-other-keys)
472 (delete-file (string-append (assoc-ref outputs "out")
473 "/lib/libsrtp2.a"))
474 #t)))))
475 (synopsis "Secure RTP (SRTP) Reference Implementation")
476 (description
477 "This package provides an implementation of the Secure Real-time Transport
478 Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
479 supporting cryptographic kernel.")
480 (home-page "https://github.com/cisco/libsrtp")
481 (license license:bsd-3)))
482
483 (define-public libiax2
484 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
485 ;; This is the commit used by the Ring Project.
486 (package
487 (name "libiax2")
488 (version (string-append "0.0.0-1." (string-take commit 7)))
489 (source
490 (origin
491 (method git-fetch)
492 (uri (git-reference
493 (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
494 (commit commit)))
495 (file-name (git-file-name name version))
496 (sha256
497 (base32
498 "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
499 (build-system gnu-build-system)
500 (native-inputs
501 (list autoconf automake libtool))
502 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
503 (synopsis "Inter-Asterisk-Protocol library")
504 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
505 Voice-over-IP (VoIP) communications.")
506 ;; The file 'src/md5.c' is released into the public domain by RSA Data
507 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
508 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
509 ;; covered under the 'GPL'.
510 ;; The package as a whole is distributed under the LGPL 2.0.
511 (license (list license:lgpl2.0
512 license:public-domain
513 license:gpl2+)))))
514
515 (define-public seren
516 (package
517 (name "seren")
518 (version "0.0.21")
519 (source (origin
520 (method url-fetch)
521 (uri (string-append "http://holdenc.altervista.org/"
522 "seren/downloads/seren-" version
523 ".tar.gz"))
524 (sha256
525 (base32
526 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
527 (build-system gnu-build-system)
528 (arguments '(#:tests? #f)) ; no "check" target
529 (inputs
530 (list alsa-lib gmp libogg ncurses opus))
531 (synopsis "Simple VoIP program to create conferences from the terminal")
532 (description
533 "Seren is a simple VoIP program based on the Opus codec that allows you
534 to create a voice conference from the terminal, with up to 10 participants,
535 without having to register accounts, exchange emails, or add people to contact
536 lists. All you need to join an existing conference is the host name or IP
537 address of one of the participants.")
538 (home-page "http://holdenc.altervista.org/seren/")
539 (license license:gpl3+)))
540
541 (define find-python-interpreter-cmake-modules
542 (let ((commit "bb4d3ea8434eebef40df35434a9b6ef410fce0b2")
543 (revision "0"))
544 (origin
545 (method git-fetch)
546 (uri (git-reference
547 (url "https://github.com/Krzmbrzl/FindPythonInterpreter")
548 (commit commit)))
549 (file-name (git-file-name "find-python-interpreter"
550 (git-version "0" revision commit)))
551 (sha256
552 (base32
553 "1ryhda2yqgrhnwndfg52mscdsclg1ivv746hvalcay5m1wy2h5bm")))))
554
555 (define-public mumble
556 (package
557 (name "mumble")
558 (version "1.4.230")
559 (source (origin
560 (method url-fetch)
561 (uri
562 (string-append
563 "https://github.com/mumble-voip/mumble/releases/download/v"
564 version "/" name "-" version ".tar.gz"))
565 (sha256
566 (base32
567 "1c1lwj0cpyawr74adpdrsnxk8ra5kqrjbg65cnwk8n6cwss84zdn"))
568 (modules '((guix build utils)
569 (ice-9 ftw)
570 (srfi srfi-1)))
571 (snippet
572 `(begin
573 (let ((keep
574 '("arc4random"
575 "celt-0.7.0-build"
576 "celt-0.7.0-src"
577 "celt-0.11.0-build"
578 "celt-0.11.0-src"
579 "qqbonjour"
580 "rnnoise-build"
581 "rnnoise-src"
582 "smallft")))
583 (with-directory-excursion "3rdparty"
584 (for-each delete-file-recursively
585 (lset-difference string=?
586 (scandir ".")
587 (cons* "." ".." keep))))
588 #t)))))
589 (build-system qt-build-system)
590 (arguments
591 (list
592 #:configure-flags
593 #~(list "-Dbundled-speex=off"
594 "-Dbundled-opus=off"
595 ;; "-Dbundled-rnnoise=off" ; XXX: not yet in release
596 "-Dalsa=off" ; use pulse
597 "-Dcoreaudio=off" ; use pulse
598 "-Dice=off" ; not packaged
599 "-Djackaudio=off" ; use pulse
600 "-Doss=off" ; use pulse
601 "-Dpulseaudio=on"
602 "-Dportaudio=off" ; use pulse
603 "-Dpipewire=off" ; use pulse
604 "-Doverlay-xcompile=off"
605 "-Dupdate=off" ; don't phone home
606 "-Dtests=on"
607 "-Dbundle-qt-translations=off")
608 #:phases
609 #~(modify-phases %standard-phases
610 (add-after 'unpack 'unpack-submodules
611 (lambda _
612 (copy-recursively #$find-python-interpreter-cmake-modules
613 "3rdparty/FindPythonInterpreter")))
614 (add-after 'unpack 'disable-murmur-ice
615 (lambda _
616 (substitute* "scripts/murmur.ini"
617 (("^ice=") ";ice="))))
618 ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
619 (add-after 'unpack 'fix-statistic-gathering-default
620 (lambda _
621 (substitute* "src/mumble/Settings.h"
622 (("bUsage *= true;") "bUsage = false;"))))
623 (add-after 'unpack 'fix-mumble-overlay
624 (lambda* (#:key inputs outputs #:allow-other-keys)
625 (with-output-to-file "scripts/mumble-overlay"
626 (lambda ()
627 (format #t "#!~a~%" (search-input-file inputs "/bin/bash"))
628 (format #t "export LD_PRELOAD=\"~a $LD_PRELOAD\"~%"
629 (string-append (assoc-ref outputs "out")
630 "/lib/mumble/libmumbleoverlay.so"))
631 (format #t "exec \"${@}\"")))))
632 (add-after 'unpack 'hardcode-pulseaudio
633 (lambda* (#:key inputs #:allow-other-keys)
634 (substitute* "src/mumble/PulseAudio.cpp"
635 (("libpulse.so") (search-input-file inputs "/lib/libpulse.so"))))))))
636 (inputs
637 (list avahi
638 boost
639 glib ; for speech-dispatcher
640 libsndfile
641 libxi
642 mesa ; avoid bundled
643 openssl
644 opus ; avoid bundled
645 poco
646 protobuf
647 pulseaudio
648 qtbase-5
649 qtsvg-5
650 speech-dispatcher
651 speex ; avoid bundled
652 speexdsp ; avoid bundled
653 ;; xiph-rnnoise ; TODO: unbundle rnnoise
654 ))
655 (native-inputs
656 (list pkg-config python qttools))
657 (synopsis "Low-latency, high quality voice chat software")
658 (description
659 "Mumble is an low-latency, high quality voice chat
660 software primarily intended for use while gaming.
661 Mumble consists of two applications for separate usage:
662 @code{mumble} for the client, and @code{murmur} for the server.")
663 (home-page "https://wiki.mumble.info/wiki/Main_Page")
664 (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
665 license:bsd-2 ; celt-0.11.0
666 license:isc)))) ; arc4random
667
668 (define-public twinkle
669 (package
670 (name "twinkle")
671 (version "1.10.2")
672 (source
673 (origin
674 (method git-fetch)
675 (uri
676 (git-reference
677 (url "https://github.com/LubosD/twinkle")
678 (commit
679 (string-append "v" version))))
680 (file-name
681 (git-file-name name version))
682 (patches
683 (search-patches "twinkle-bcg729.patch")) ; To support new BCG729 API.
684 (sha256
685 (base32
686 "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
687 (build-system qt-build-system)
688 (arguments
689 `(#:tests? #f ; no test target
690 #:configure-flags
691 (list
692 ;; FIX-ME: Make Twinkle compatible with libre version of iLBC.
693 ;; "-DWITH_ILBC=On" ; For iLBC Codec Support
694 "-DWITH_ZRTP=On" ; For ZRTP Support
695 "-DWITH_G729=On" ; For G729 Codec Support
696 "-DWITH_SPEEX=On"))) ; For Speex Codec Support
697 (native-inputs
698 (list bison flex qttools))
699 (inputs
700 (list alsa-lib
701 bcg729
702 zrtpcpp
703 ccrtp
704 file
705 libilbc
706 libsndfile
707 libxml2
708 qtbase-5
709 qtdeclarative-5
710 qtquickcontrols
711 readline
712 speex
713 speexdsp
714 ucommon))
715 (synopsis "Softphone for voice over IP and instant messaging")
716 (description "Twinkle is a softphone for your voice over IP and instant
717 messaging communcations using the SIP protocol. You can use it for direct
718 IP phone to IP phone communication or in a network using a SIP proxy to route
719 your calls and messages.")
720 (home-page "http://twinkle.dolezel.info/")
721 (license license:gpl2+)))
722
723 (define-public pjproject
724 (package
725 (name "pjproject")
726 (version "2.11.1")
727 (source
728 (origin
729 (method git-fetch)
730 (uri (git-reference
731 (url "https://github.com/pjsip/pjproject")
732 (commit version)))
733 (file-name (git-file-name name version))
734 (sha256
735 (base32
736 "04s4bgr2d22ym2ajjk6q507hyqss1p59yp8avyyyf5f8032nbaws"))
737 (modules '((guix build utils)))
738 (snippet
739 '(begin
740 ;; Remove bundled libraries.
741 (delete-file-recursively "third_party")
742 (substitute* "aconfigure.ac"
743 (("third_party/build/os-auto.mak") ""))
744 (substitute* "Makefile"
745 (("third_party/build") ""))))
746 (patches (search-patches "pjproject-install-libpjsua2.patch"))))
747 (build-system gnu-build-system)
748 (outputs '("out" "debug" "static"))
749 (arguments
750 `(#:test-target "selftest"
751 #:configure-flags
752 (list "--enable-shared"
753 "--with-external-speex"
754 "--with-external-gsm"
755 "--with-external-srtp"
756 "--with-external-pa"
757 ;; The following flag is Linux specific.
758 ,@(if (string-contains (or (%current-system)
759 (%current-target-system)) "linux")
760 '("--enable-epoll")
761 '())
762 "--with-gnutls" ;disable OpenSSL checks
763 "--disable-libyuv" ;TODO: add missing package
764 "--disable-silk" ;TODO: add missing package
765 "--disable-libwebrtc" ;TODO: add missing package
766 "--disable-ilbc-codec" ;cannot be unbundled
767 "--disable-g7221-codec" ;TODO: add missing package
768 "--enable-libsamplerate"
769 ;; -DNDEBUG is set to prevent pjproject from raising
770 ;; assertions that aren't critical, crashing
771 ;; applications as the result.
772 "CFLAGS=-DNDEBUG"
773 ;; Specify a runpath reference to itself, which is missing and
774 ;; causes the validate-runpath phase to fail.
775 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out")
776 "/lib"))
777 #:phases
778 (modify-phases %standard-phases
779 (add-before 'build 'build-dep
780 (lambda _ (invoke "make" "dep")))
781 ;; The check phases is moved after the install phase so to
782 ;; use the installed shared libraries for the tests.
783 (delete 'check)
784 (add-after 'install 'move-static-libraries
785 (lambda* (#:key outputs #:allow-other-keys)
786 (let ((out (assoc-ref outputs "out"))
787 (s (string-append (assoc-ref outputs "static") "/lib")))
788 (mkdir-p s)
789 (with-directory-excursion out
790 (for-each (lambda (f)
791 (rename-file f (string-append s "/" (basename f))))
792 (find-files "." "\\.a$"))))))
793 (add-after 'install 'check
794 (assoc-ref %standard-phases 'check))
795 (add-before 'patch-source-shebangs 'autoconf
796 (lambda _
797 (invoke "autoconf" "-v" "-f" "-i" "-o"
798 "aconfigure" "aconfigure.ac")))
799 (add-before 'autoconf 'disable-some-tests
800 (lambda _
801 (substitute* "pjlib/src/pjlib-test/test.h"
802 ;; Disable network tests which are slow and/or require an
803 ;; actual network.
804 (("#define GROUP_NETWORK.*")
805 "#define GROUP_NETWORK 0\n"))
806 (substitute* "self-test.mak"
807 ;; Fails with: pjlib-util-test-x86_64-unknown-linux-gnu:
808 ;; ../src/pjlib-util-test/resolver_test.c:1501: action2_1:
809 ;; Assertio n `pj_strcmp2(&pkt->q[0].name, "_sip._udp."
810 ;; "domain2.com")==0' failed.
811 ((" pjlib_util_test ") ""))
812 (substitute* "pjsip/src/test/test.h"
813 ;; Fails with: Error: unable to acquire TCP transport:
814 ;; [pj_status_t=120101] Network is unreachable.
815 (("#define INCLUDE_TCP_TEST.*")
816 "#define INCLUDE_TCP_TEST 0\n")
817 ;; The TSX tests takes a very long time to run; skip them.
818 (("#define INCLUDE_TSX_GROUP.*")
819 "#define INCLUDE_TSX_GROUP 0\n"))
820 (substitute* "pjsip/src/test/dns_test.c"
821 ;; The round_robin_test fails non-deterministically (depending
822 ;; on load); skip it (see:
823 ;; https://github.com/pjsip/pjproject/issues/2500).
824 (("round_robin_test(pool)") 0))
825 (substitute* "pjmedia/src/test/test.h"
826 ;; The following tests require a sound card.
827 (("#define HAS_MIPS_TEST.*")
828 "#define HAS_MIPS_TEST 0\n")
829 (("#define HAS_JBUF_TEST.*")
830 "#define HAS_JBUF_TEST 0\n"))
831 (substitute* "Makefile"
832 ;; Disable the pjnath and pjsua tests, which require an actual
833 ;; network and an actual sound card, respectively.
834 (("pjnath-test pjmedia-test pjsip-test pjsua-test")
835 "pjmedia-test pjsip-test")))))))
836 (native-inputs
837 (list autoconf automake libtool pkg-config))
838 (inputs
839 (list bcg729
840 gnutls
841 gsm
842 libsamplerate
843 libsrtp
844 opus
845 portaudio
846 speex
847 speexdsp))
848 (home-page "https://www.pjsip.org")
849 (synopsis "Session Initiation Protocol (SIP) stack")
850 (description "PJProject provides an implementation of the Session
851 Initiation Protocol (SIP) and a multimedia framework.")
852 (license license:gpl2+)))
853
854 (define-public libtgvoip
855 (package
856 (name "libtgvoip")
857 (version "2.4.4")
858 (source
859 (origin
860 (method git-fetch)
861 (uri (git-reference
862 (url "https://github.com/grishka/libtgvoip")
863 (commit version)))
864 (file-name (git-file-name name version))
865 ;; Fix compilation on i686-linux architecture.
866 ;; NOTE: Applying these patches is order-dependent!
867 ;; The patch for WebRTC /must/ precede the patch for SSE2.
868 (patches
869 (search-patches "libtgvoip-disable-webrtc.patch"
870 "libtgvoip-disable-sse2.patch"))
871 (sha256
872 (base32
873 "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
874 (build-system gnu-build-system)
875 (inputs
876 (list alsa-lib openssl opus pulseaudio))
877 (arguments
878 `(#:phases
879 (modify-phases %standard-phases
880 ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
881 ;; they are.
882 (add-after 'unpack 'patch-dlopen
883 (lambda* (#:key inputs #:allow-other-keys)
884 (substitute* "os/linux/AudioPulse.cpp"
885 (("libpulse\\.so")
886 (search-input-file inputs "/lib/libpulse.so")))
887 (substitute* '("os/linux/AudioInputALSA.cpp"
888 "os/linux/AudioOutputALSA.cpp")
889 (("libasound\\.so")
890 (search-input-file inputs "/lib/libasound.so"))))))))
891 (synopsis "VoIP library for Telegram clients")
892 (description "A collection of libraries and header files for implementing
893 telephony functionality into custom Telegram clients.")
894 (home-page "https://github.com/zevlg/libtgvoip")
895 (license license:unlicense)))