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