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