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