gnu: emacs-sly: Update to 20200228.
[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 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages telephony)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages aidc)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages avahi)
39 #:use-module (gnu packages audio)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages boost)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages documentation)
46 #:use-module (gnu packages file)
47 #:use-module (gnu packages protobuf)
48 #:use-module (gnu packages gettext)
49 #:use-module (gnu packages gl)
50 #:use-module (gnu packages glib)
51 #:use-module (gnu packages gnome)
52 #:use-module (gnu packages gnupg)
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages libcanberra)
55 #:use-module (gnu packages linux)
56 #:use-module (gnu packages multiprecision)
57 #:use-module (gnu packages ncurses)
58 #:use-module (gnu packages networking)
59 #:use-module (gnu packages pcre)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages pkg-config)
62 #:use-module (gnu packages pulseaudio)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages qt)
65 #:use-module (gnu packages serialization)
66 #:use-module (gnu packages speech)
67 #:use-module (gnu packages sqlite)
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 (add-before 'install 'disable-murmur-ice
466 (lambda _
467 (substitute* "scripts/murmur.ini.system"
468 (("^ice=") ";ice="))
469 #t))
470 (replace 'install ; install phase does not exist
471 (lambda* (#:key inputs outputs #:allow-other-keys)
472 (let* ((out (assoc-ref outputs "out"))
473 (etc (string-append out "/etc/murmur"))
474 (dbus (string-append out "/etc/dbus-1/system.d/"))
475 (bin (string-append out "/bin"))
476 (services (string-append out "/share/services"))
477 (applications (string-append out "/share/applications"))
478 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
479 (man (string-append out "/share/man/man1"))
480 (lib (string-append out "/lib/mumble")))
481 (install-file "release/mumble" bin)
482 (install-file "scripts/mumble-overlay" bin)
483 (install-file "scripts/mumble.protocol" services)
484 (install-file "scripts/mumble.desktop" applications)
485 (install-file "icons/mumble.svg" icons)
486 (install-file "man/mumble-overlay.1" man)
487 (install-file "man/mumble.1" man)
488 (install-file "release/murmurd" bin)
489 (install-file "scripts/murmur.ini.system" etc)
490 (rename-file (string-append etc "/murmur.ini.system")
491 (string-append etc "/murmur.ini"))
492 (install-file "scripts/murmur.conf" dbus)
493 (install-file "man/murmurd.1" man)
494 (for-each (lambda (file) (install-file file lib))
495 (find-files "." "\\.so\\."))
496 (for-each (lambda (file) (install-file file lib))
497 (find-files "release/plugins" "\\.so$"))))))))
498 (inputs
499 `(("avahi" ,avahi)
500 ("boost" ,boost)
501 ("libsndfile" ,libsndfile)
502 ("libxi" ,libxi)
503 ("mesa" ,mesa) ; avoid bundled
504 ("openssl" ,openssl)
505 ("opus" ,opus) ; avoid bundled
506 ("protobuf" ,protobuf)
507 ("pulseaudio" ,pulseaudio)
508 ("qtbase" ,qtbase)
509 ("qtsvg" ,qtsvg)
510 ("speech-dispatcher" ,speech-dispatcher)
511 ("speex" ,speex) ; avoid bundled
512 ("speexdsp" ,speexdsp))) ; avoid bundled
513 (native-inputs
514 `(("pkg-config" ,pkg-config)
515 ("python" ,python)
516 ("qttools" ,qttools)))
517 (synopsis "Low-latency, high quality voice chat software")
518 (description
519 "Mumble is an low-latency, high quality voice chat
520 software primarily intended for use while gaming.
521 Mumble consists of two applications for separate usage:
522 @code{mumble} for the client, and @code{murmur} for the server.")
523 (home-page "https://wiki.mumble.info/wiki/Main_Page")
524 (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
525 license:bsd-2 ; celt-0.11.0
526 license:isc)))) ; arc4random
527
528 (define-public twinkle
529 (package
530 (name "twinkle")
531 (version "1.10.2")
532 (source (origin
533 (method git-fetch)
534 (uri (git-reference
535 (url "https://github.com/LubosD/twinkle")
536 (commit (string-append "v" version))))
537 (file-name (git-file-name name version))
538 (sha256
539 (base32
540 "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
541 (build-system cmake-build-system)
542 (arguments
543 `(#:tests? #f ; no test target
544 #:configure-flags '("-DWITH_SPEEX=On")
545 #:phases
546 (modify-phases %standard-phases
547 (add-after 'install 'wrap-executable
548 (lambda* (#:key inputs outputs #:allow-other-keys)
549 (let ((out (assoc-ref outputs "out")))
550 (wrap-program (string-append out "/bin/twinkle")
551 `("QT_PLUGIN_PATH" ":" prefix
552 ,(map (lambda (label)
553 (string-append (assoc-ref inputs label)
554 "/lib/qt5/plugins"))
555 '("qtbase" "qtdeclarative")))
556 `("QML2_IMPORT_PATH" ":" prefix
557 ,(map (lambda (label)
558 (string-append (assoc-ref inputs label)
559 "/lib/qt5/qml"))
560 '("qtdeclarative" "qtquickcontrols"))))
561 #t))))))
562 (native-inputs
563 `(("bison" ,bison)
564 ("flex" ,flex)
565 ("readline" ,readline)
566 ("file" ,file)
567 ("ucommon" ,ucommon)
568 ("ccrtp" ,ccrtp)
569 ("libxml2" ,libxml2)
570 ("speex" ,speex)
571 ("speexdsp" ,speexdsp)
572 ("libsndfile" ,libsndfile)
573 ("alsa-lib" ,alsa-lib)
574 ("qttools" ,qttools)))
575 (inputs
576 `(("qtbase" ,qtbase)
577 ("qtdeclarative" ,qtdeclarative)
578 ("qtquickcontrols" ,qtquickcontrols)))
579 (home-page "http://twinkle.dolezel.info/")
580 (synopsis "Softphone for voice over IP and instant messaging")
581 (description "Twinkle is a softphone for your voice over IP and instant
582 messaging communcations using the SIP protocol. You can use it for direct IP
583 phone to IP phone communication or in a network using a SIP proxy to route your
584 calls and messages")
585 (license license:gpl2+)))
586
587 (define-public pjproject
588 (package
589 (name "pjproject")
590 (version "2.9")
591 (source
592 (origin
593 (method git-fetch)
594 (uri (git-reference
595 (url "https://github.com/pjsip/pjproject.git")
596 (commit "5dfa75be7d69047387f9b0436dd9492bbbf03fe4")))
597 (modules '((guix build utils)))
598 (snippet
599 '(begin
600 (let ((third-party-directories
601 ;; Things we don't need:
602 ;; BaseClasses - contains libraries from Windows SDK
603 ;; we don't need it, at least not now.
604 (list "BaseClasses" "g7221" "ilbc" "milenage"
605 "speex" "threademulation" "yuv" "bdsound"
606 "gsm" "mp3" "resample" "srtp" "webrtc"
607 ;; Keep only resample, build and README.txt.
608 "build/baseclasses" "build/g7221" "build/gsm"
609 "build/ilbc" "build/milenage" "build/resample"
610 "build/samplerate" "build/speex" "build/srtp"
611 "build/webrtc" "build/yuv")))
612 ;; Keep only Makefiles related to resample.
613 (for-each (lambda (directory)
614 (delete-file-recursively
615 (string-append "third_party/" directory)))
616 third-party-directories)
617 #t)
618 (let ((third-party-dirs
619 (list "gsm" "ilbc" "speex" "g7221" "srtp"
620 "portaudio" "resample")))
621 (for-each
622 (lambda (dirs)
623 (substitute* "third_party/build/os-linux.mak"
624 (((string-append "DIRS += " dirs)) "")))
625 third-party-dirs))))
626 (file-name (git-file-name name version))
627 (sha256
628 (base32
629 "1ayj6n7zd5wvd1nzj2k9s57fb4ckc2fv92k5sjvhd87yg69k3393"))))
630 (build-system gnu-build-system)
631 (inputs
632 `(("portaudio" ,portaudio)))
633 (propagated-inputs
634 ;; These packages are referenced in the Libs field of the pkg-config
635 ;; file that will be installed by pjproject.
636 `(("speex" ,speex)
637 ("libsrtp" ,libsrtp)
638 ("gnutls" ,gnutls)
639 ("resample", resample)
640 ("util-linux" ,util-linux)))
641 (native-inputs
642 `(("autoconf" ,autoconf)
643 ("automake" ,automake)
644 ("pkg-config" ,pkg-config)
645 ("libtool" ,libtool)))
646 (arguments
647 `(;; FIXME make: No rule to make target
648 ;; 'pjlib-test-unknown-[something]-gnu'.
649 #:tests? #f
650 ;; #:test-target "selftest"
651 #:phases
652 (modify-phases %standard-phases
653 (add-before 'build 'build-dep
654 (lambda _ (invoke "make" "dep")))
655 (add-before 'patch-source-shebangs 'autoconf
656 (lambda _
657 (invoke "autoconf" "-v" "-f" "-i" "-o"
658 "aconfigure" "aconfigure.ac")))
659 (add-before 'autoconf 'disable-some-tests
660 ;; Three of the six test programs fail due to missing network
661 ;; access.
662 (lambda _
663 (substitute* "Makefile"
664 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
665 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
666 #t)))))
667 (home-page "https://www.pjsip.org")
668 (synopsis "Session Initiation Protocol (SIP) stack")
669 (description "PJProject provides an implementation of the Session
670 Initiation Protocol (SIP) and a multimedia framework.")
671 (license license:gpl2+)))
672
673 (define %jami-version "20191101.3.67671e7")
674
675 (define* (jami-source #:key without-daemon)
676 (origin
677 (method url-fetch)
678 (uri (string-append "https://dl.jami.net/ring-release/tarballs/ring_"
679 %jami-version
680 ".tar.gz"))
681 (modules '((guix build utils)))
682 (snippet
683 (if without-daemon
684 '(begin
685 (delete-file-recursively "daemon/contrib"))
686 #f))
687 (sha256
688 (base32
689 "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0"))))
690
691 (define-public pjproject-jami
692 (package
693 (inherit pjproject)
694 (name "pjproject-jami")
695 (native-inputs
696 `(("savoir-faire-linux-patches" ,(jami-source))
697 ,@(package-native-inputs pjproject)))
698 (arguments
699 `(#:tests? #f
700 ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
701 #:configure-flags
702 (list "--disable-oss"
703 "--disable-sound"
704 "--disable-video"
705 "--enable-ext-sound"
706 "--disable-speex-aec"
707 "--disable-g711-codec"
708 "--disable-l16-codec"
709 "--disable-gsm-codec"
710 "--disable-g722-codec"
711 "--disable-g7221-codec"
712 "--disable-speex-codec"
713 "--disable-ilbc-codec"
714 "--disable-opencore-amr"
715 "--disable-silk"
716 "--disable-sdl"
717 "--disable-ffmpeg"
718 "--disable-v4l2"
719 "--disable-openh264"
720 "--disable-resample"
721 "--disable-libwebrtc"
722 "--with-gnutls"
723 "--with-external-srtp"
724 ;; We need -fPIC or else we get the following error when linking
725 ;; against pjproject-jami:
726 ;; relocation R_X86_64_32S against `.rodata' can not be used when
727 ;; making a shared object;
728 "CFLAGS=-fPIC"
729 "CXXFLAGS=-fPIC")
730 #:phases
731 (modify-phases %standard-phases
732 (add-after 'unpack 'make-git-checkout-writable
733 (lambda _
734 (for-each make-file-writable (find-files "."))
735 #t))
736 (add-after 'unpack 'apply-patches
737 (lambda* (#:key inputs #:allow-other-keys)
738 (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux patches")
739 ;; Comes from
740 ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
741 ;; WARNING: These amount for huge changes in pjproject.
742 (savoir-faire-linux-patches
743 '("fix_turn_alloc_failure"
744 "rfc2466"
745 "ipv6"
746 "multiple_listeners"
747 "pj_ice_sess"
748 "fix_turn_fallback"
749 "fix_ioqueue_ipv6_sendto"
750 "add_dtls_transport"
751 "rfc6544"
752 "ice_config"
753 "sip_config"
754 "fix_first_packet_turn_tcp"
755 "fix_ebusy_turn"
756 "ignore_ipv6_on_transport_check"
757 "fix_turn_connection_failure"
758 ;; "uwp_vs" ; for windows
759 "disable_local_resolution")))
760 (mkdir-p savoir-faire-linux-patches-directory)
761 (invoke "tar" "-xvf" (assoc-ref inputs "savoir-faire-linux-patches")
762 "-C" savoir-faire-linux-patches-directory
763 "--strip-components=5"
764 "ring-project/daemon/contrib/src/pjproject")
765 (for-each
766 (lambda (file)
767 (invoke "patch" "--force" "-p1" "-i"
768 (string-append savoir-faire-linux-patches-directory "/"
769 file ".patch")))
770 savoir-faire-linux-patches))
771 #t))
772 ;; TODO: We could use substitute-keyword-arguments instead of
773 ;; repeating the phases from pjproject, but somehow it does
774 ;; not work.
775 (add-before 'build 'build-dep
776 (lambda _ (invoke "make" "dep")))
777 (add-before 'patch-source-shebangs 'autoconf
778 (lambda _
779 (invoke "autoconf" "-v" "-f" "-i" "-o"
780 "aconfigure" "aconfigure.ac")))
781 (add-before 'autoconf 'disable-some-tests
782 ;; Three of the six test programs fail due to missing network
783 ;; access.
784 (lambda _
785 (substitute* "Makefile"
786 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
787 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
788 #t)))))))
789
790 (define-public libring
791 (package
792 (name "libring")
793 (version %jami-version)
794 (source (jami-source #:without-daemon #t))
795 (build-system gnu-build-system)
796 (inputs
797 ;; Missing (optional?) dep: libnatpmp.
798 `(("alsa-lib" ,alsa-lib)
799 ("boost" ,boost)
800 ("dbus-c++" ,dbus-c++)
801 ("eudev" ,eudev)
802 ("ffmpeg" ,ffmpeg)
803 ("flac" ,flac)
804 ("gmp" ,gmp)
805 ("gsm" ,gsm)
806 ("jack" ,jack-1)
807 ("jsoncpp" ,jsoncpp)
808 ("libogg" ,libogg)
809 ("libva" ,libva)
810 ("opendht" ,opendht)
811 ("opus" ,opus)
812 ("pcre" ,pcre)
813 ("pulseaudio" ,pulseaudio)
814 ("libsamplerate" ,libsamplerate)
815 ("libsndfile" ,libsndfile)
816 ("speex" ,speex)
817 ("speexdsp" ,speexdsp)
818 ("libupnp" ,libupnp)
819 ("libvorbis" ,libvorbis)
820 ("libx264" ,libx264)
821 ("libvdpau" ,libvdpau)
822 ("yaml-cpp" ,yaml-cpp)
823 ("zlib" ,zlib)
824 ("openssl" ,openssl)
825 ("libsecp256k1" ,libsecp256k1)
826 ("python" ,python)
827 ("python-wrapper" ,python-wrapper)
828 ("restinio" ,restinio)
829 ("libx11" ,libx11)
830 ("asio" ,asio)
831 ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
832 ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
833 ("pjproject" ,pjproject-jami)))
834 (native-inputs
835 `(("autoconf" ,autoconf)
836 ("automake" ,automake)
837 ("libtool" ,libtool)
838 ("pkg-config" ,pkg-config)
839 ("which" ,which)
840 ("cppunit" ,cppunit)
841 ("perl" ,perl))) ; Needed for documentation.
842 (arguments
843 `(#:tests? #f ; The tests fail to compile due to missing headers.
844 #:phases
845 (modify-phases %standard-phases
846 (add-after 'unpack 'change-directory
847 (lambda _
848 (chdir "daemon")
849 #t))
850 (add-before 'build 'add-lib-dir
851 (lambda _
852 (mkdir-p "src/lib")
853 #t)))))
854 (synopsis "Distributed multimedia communications platform")
855 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
856 video and chat communication platform that requires no centralized server and
857 leaves the power of privacy in the hands of the user. It supports the SIP and
858 IAX protocols, as well as decentralized calling using P2P-DHT.
859
860 This package provides a library and daemon implementing the Jami core
861 functionality.")
862 (home-page "https://jami.net/")
863 (license license:gpl3+)))
864
865 (define-public libringclient
866 (package
867 (inherit libring)
868 (name "libringclient")
869 (build-system cmake-build-system)
870 (propagated-inputs
871 `(("libring" ,libring) ; For 'dring'.
872 ("qtbase" ,qtbase) ; Qt is included in several installed headers.
873 ("qttools" ,qttools)))
874 (arguments
875 `(#:tests? #f ; There is no testsuite.
876 #:configure-flags
877 (list (string-append "-DRING_BUILD_DIR="
878 (assoc-ref %build-inputs "libring") "/include"))
879 #:phases
880 (modify-phases %standard-phases
881 (add-after 'unpack 'change-directory
882 (lambda _
883 (chdir "lrc")
884 #t))
885 (add-before 'configure 'fix-dbus-interfaces-path
886 (lambda* (#:key inputs #:allow-other-keys)
887 (substitute* "CMakeLists.txt"
888 (("\\$\\{CMAKE_INSTALL_PREFIX\\}(/share/dbus-1/interfaces)" _ dbus-interfaces-path-suffix)
889 (string-append (assoc-ref inputs "libring")
890 dbus-interfaces-path-suffix))))))))
891 (synopsis "Distributed multimedia communications platform")
892 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
893 video and chat communication platform that requires no centralized server and
894 leaves the power of privacy in the hands of the user. It supports the SIP and
895 IAX protocols, as well as decentralized calling using P2P-DHT.
896
897 This package provides a library common to all Jami clients.")
898 (home-page "https://jami.net")
899 (license license:gpl3+)))
900
901 (define-public jami
902 (package
903 (inherit libring)
904 (name "jami")
905 (build-system cmake-build-system)
906 (inputs
907 `(("libringclient" ,libringclient)
908 ("gtk+" ,gtk+)
909 ("qrencode" ,qrencode)
910 ("libnotify" ,libnotify)
911 ("clutter" ,clutter)
912 ("clutter-gtk" ,clutter-gtk)
913 ("gettext" ,gnu-gettext)
914 ("libcanberra" ,libcanberra)
915 ("webkitgtk" ,webkitgtk)
916 ;; TODO: We must wrap ring-client-gnome to force using the
917 ;; `sqlite-with-column-metadata' package instead of `sqlite' or else it
918 ;; fails with:
919 ;;
920 ;; /gnu/store/...-qtbase-5.11.2/lib/qt5/plugins/sqldrivers/libqsqlite.so:
921 ;; undefined symbol: sqlite3_column_table_name16
922 ;;
923 ;; qtbase is built against sqlite-with-column-metadata but somehow
924 ;; jami-client-gnome ends up with both `sqlite' and
925 ;; `sqlite-with-column-metadata' as inputs and it seems that
926 ;; libqsqlite.so gets confused.
927 ("sqlite" ,sqlite-with-column-metadata)))
928 (native-inputs
929 `(("pkg-config" ,pkg-config)
930 ("glib:bin" ,glib "bin")
931 ("doxygen" ,doxygen)))
932 (propagated-inputs
933 `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
934 ("adwaita-icon-theme" ,adwaita-icon-theme)
935 ("evolution-data-server" ,evolution-data-server)))
936 (arguments
937 `(#:tests? #f ; There is no testsuite.
938 #:phases
939 (modify-phases %standard-phases
940 (add-after 'unpack 'change-directory
941 (lambda _
942 (chdir "client-gnome")
943 #t))
944 (add-after 'install 'wrap
945 (lambda* (#:key inputs outputs #:allow-other-keys)
946 (let* ((out (assoc-ref outputs "out"))
947 (path (string-append (assoc-ref inputs "sqlite") "/lib")))
948 (wrap-program (string-append out "/bin/jami-gnome")
949 `("LD_LIBRARY_PATH" ":" prefix (,path))))
950 #t)))))
951 (synopsis "Distributed, privacy-respecting communication program")
952 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
953 video and chat communication platform that requires no centralized server and
954 leaves the power of privacy in the hands of the user. It supports the SIP and
955 IAX protocols, as well as decentralized calling using P2P-DHT.
956
957 This package provides the Jami client for the GNOME desktop.")
958 (home-page "https://jami.net")
959 (license license:gpl3+)))
960
961 (define-public jami-client-gnome
962 (deprecated-package "jami-client-gnome" jami))
963
964 (define-public libtgvoip
965 (package
966 (name "libtgvoip")
967 (version "2.4.4")
968 (source
969 (origin
970 (method git-fetch)
971 (uri (git-reference
972 (url "https://github.com/grishka/libtgvoip.git")
973 (commit version)))
974 (file-name (git-file-name name version))
975 ;; Fix compilation on i686-linux architecture.
976 ;; NOTE: Applying these patches is order-dependent!
977 ;; The patch for WebRTC /must/ precede the patch for SSE2.
978 (patches
979 (search-patches "libtgvoip-disable-webrtc.patch"
980 "libtgvoip-disable-sse2.patch"))
981 (sha256
982 (base32
983 "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
984 (build-system gnu-build-system)
985 (inputs
986 `(("alsa-lib" ,alsa-lib)
987 ("libopusenc" ,libopusenc)
988 ("openssl" ,openssl)
989 ("pulseaudio" ,pulseaudio)))
990 (synopsis "VoIP library for Telegram clients")
991 (description "A collection of libraries and header files for implementing
992 telephony functionality into custom Telegram clients.")
993 (home-page "https://github.com/zevlg/libtgvoip")
994 (license license:unlicense)))