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