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