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