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