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, 2020 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
7 ;;; Copyright © 2016 Francesco Frassinelli <fraph24@gmail.com>
8 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
9 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017 Adonay Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
12 ;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
13 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
14 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
15 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
16 ;;; Copyright © 2019 Ivan Vilata i Balaguer <ivan@selidor.net>
17 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
18 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
19 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
20 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
21 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages telephony)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages admin)
41 #:use-module (gnu packages aidc)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages avahi)
45 #:use-module (gnu packages audio)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages boost)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages crypto)
51 #:use-module (gnu packages docbook)
52 #:use-module (gnu packages documentation)
53 #:use-module (gnu packages file)
54 #:use-module (gnu packages protobuf)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages libcanberra)
63 #:use-module (gnu packages linux)
64 #:use-module (gnu packages multiprecision)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages netpbm)
67 #:use-module (gnu packages networking)
68 #:use-module (gnu packages pcre)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages pulseaudio)
72 #:use-module (gnu packages python)
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages serialization)
75 #:use-module (gnu packages speech)
76 #:use-module (gnu packages sqlite)
77 #:use-module (gnu packages tls)
78 #:use-module (gnu packages upnp)
79 #:use-module (gnu packages video)
80 #:use-module (gnu packages webkit)
81 #:use-module (gnu packages xiph)
82 #:use-module (gnu packages xorg)
83 #:use-module (gnu packages xml)
84 #:use-module (gnu packages readline)
85 #:use-module (gnu packages bison)
86 #:use-module (gnu packages flex)
87 #:use-module ((guix licenses) #:prefix license:)
88 #:use-module (guix packages)
89 #:use-module (guix download)
90 #:use-module (guix git-download)
91 #:use-module (guix build-system cmake)
92 #:use-module (guix build-system gnu)
93 #:use-module (guix build-system qt))
95 (define-public spandsp
103 ;; The original upstream has been down since the end of March 2020.
104 (string-append "https://web.archive.org/web/20180626203108/"
105 "https://www.soft-switch.org/downloads/" name "/"
106 name "-" version ".tar.gz"))
108 (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
109 (build-system gnu-build-system)
110 (outputs '("out" "doc" "static")) ;doc contains HTML documentation
112 `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
113 #:parallel-build? #f ;non-deterministic build failures may occur otherwise
114 #:parallel-tests? #f ;fails removing the same the files twice otherwise
115 #:phases (modify-phases %standard-phases
116 (add-after 'unpack 'patch-configure.ac
118 ;; spandsp looks at hard coded locations of the FHS to
120 (substitute* "configure.ac"
121 (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
123 "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
124 "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
125 ;; Force a regeneration of the autotools build system.
126 (delete-file "autogen.sh")
127 (delete-file "configure")
129 (add-after 'unpack 'do-not-install-data-files
130 ;; The .tiff images produced for tests are not
131 ;; reproducible and it is not desirable to have those
134 (substitute* '("test-data/itu/fax/Makefile.am"
135 "test-data/etsi/fax/Makefile.am")
136 (("nobase_data_DATA")
139 (add-after 'install 'install-doc
140 (lambda* (#:key outputs #:allow-other-keys)
141 (let ((doc (string-append (assoc-ref outputs "doc")
142 "/share/doc/" ,name "-" ,version)))
143 (copy-recursively "doc/t38_manual" doc)
145 (add-after 'install 'move-static-libraries
146 (lambda* (#:key outputs #:allow-other-keys)
147 (let ((out (assoc-ref outputs "out"))
148 (static (assoc-ref outputs "static")))
149 (mkdir-p (string-append static "/lib"))
150 (with-directory-excursion out
151 (for-each (lambda (file)
153 (string-append static "/"
155 (find-files "lib" "\\.a$")))
158 `(("autoconf" ,autoconf)
159 ("automake" ,automake)
161 ("pkg-config" ,pkg-config)
165 ("libsndfile" ,libsndfile)
169 ;; For the documentation
170 ("docbook-xml" ,docbook-xml-4.3)
171 ("docbook-xsl" ,docbook-xsl)
174 ("libxslt" ,libxslt)))
175 (synopsis "DSP library for telephony")
176 (description "SpanDSP is a library of DSP functions for telephony, in the
177 8000 sample per second world of E1s, T1s, and higher order PCM channels. It
178 contains low level functions, such as basic filters. It also contains higher
179 level functions, such as cadenced supervisory tone detection, and a complete
180 software FAX machine.")
181 (home-page "https://web.archive.org/web/20180626203108/\
182 https://www.soft-switch.org/index.html")
183 (license (list license:lgpl2.1+ ;for the library
184 license:gpl2+)))) ;for the test suites and support programs
186 (define-public commoncpp
192 (uri (string-append "mirror://gnu/" name "/commoncpp2-"
195 "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
198 (modify-phases %standard-phases
199 (add-before 'configure 'pre-configure
201 (substitute* "src/applog.cpp"
202 (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
204 (build-system gnu-build-system)
205 (synopsis "(u)Common C++ framework for threaded applications")
206 (description "GNU Common C++ is an portable, optimized class framework for
207 threaded applications, supporting concurrent synchronization, inter-process
208 communications via sockets, and various methods for data handling, such as
209 serialization and XML parsing. It includes the uCommon C++ library, a smaller
211 (license license:gpl2+) ; plus runtime exception
212 (properties '((ftp-directory . "/gnu/commoncpp")
213 (upstream-name . "commoncpp2")))
214 (home-page "https://www.gnu.org/software/commoncpp/")))
216 (define-public ucommon
222 (uri (string-append "mirror://gnu/commoncpp/" name "-"
225 "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
226 (build-system gnu-build-system)
227 (inputs `(("gnutls" ,gnutls)))
228 (synopsis "Common C++ framework for threaded applications")
229 (description "GNU uCommon C++ is meant as a very light-weight C++ library
230 to facilitate using C++ design patterns even for very deeply embedded
231 applications, such as for systems using uclibc along with posix threading
233 (license license:gpl3+)
234 (home-page "https://www.gnu.org/software/commoncpp/")
235 (properties '((ftp-directory . "/gnu/commoncpp")))))
243 (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
246 "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
247 (build-system gnu-build-system)
248 (inputs `(("ucommon" ,ucommon)
249 ("libgcrypt" ,libgcrypt)))
250 (native-inputs `(("pkg-config" ,pkg-config)))
251 (synopsis "Implementation of RTP (real-time transport protocol)")
252 (description "GNU ccRTP is an implementation of RTP, the real-time transport
253 protocol from the IETF. It is suitable both for high capacity servers and
254 personal client applications. It is flexible in its design, allowing it to
255 function as a framework for the framework, rather than just being a
256 packet-manipulation library.")
257 (license license:gpl2+) ; plus runtime exception
258 (home-page "https://www.gnu.org/software/ccrtp/")))
267 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
268 (patches (search-patches "osip-CVE-2017-7853.patch"))
271 "0kgnxgzf968kbl6rx3hjsfb3jsg4ydgrsf35gzj319i1f8qjifv1"))))
272 (build-system gnu-build-system)
274 (synopsis "Library implementing SIP (RFC-3261)")
275 (description "GNU oSIP is an implementation of the SIP protocol. It is
276 used to provide multimedia and telecom software developers with an interface
277 to initiate and control SIP sessions.")
278 (license license:lgpl2.1+)
279 (properties '((ftp-directory . "/gnu/osip")
280 (upstream-name . "libosip2")))
281 (home-page "https://www.gnu.org/software/osip/")))
284 (define-public exosip
290 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
293 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
294 (build-system gnu-build-system)
295 (inputs `(("osip" ,osip)))
296 (synopsis "Sip abstraction library")
297 (description "EXosip is a library that hides the complexity of using the
298 SIP protocol for multimedia session establishment. This protocol is mainly to
299 be used by VoIP telephony applications (endpoints or conference server) but
300 might be also useful for any application that wish to establish sessions like
302 (license license:gpl2+)
303 ;; (plus OpenSSL linking exception)
304 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
305 (home-page "https://savannah.nongnu.org/projects/exosip")))
307 (define-public sipwitch
313 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
316 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
317 (build-system gnu-build-system)
318 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
319 ;; cross-compiling. Among other issues there the program name "pkg-config"
320 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
321 ;; Fortunately we can avoid the use of pkg-config and set the dependency
323 (arguments `(#:configure-flags
324 `("--without-pkg-config"
325 ,(string-append "UCOMMON_CFLAGS=-I"
326 (assoc-ref %build-inputs "ucommon") "/include")
327 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
328 ,(string-append "LIBOSIP2_CFLAGS=-I"
329 (assoc-ref %build-inputs "osip") "/include")
330 "LIBOSIP2_LIBS=-losipparser2 -losip2"
331 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
333 "EXOSIP2_LIBS=-leXosip2"
334 ,(string-append "EXOSIP2_CFLAGS=-I"
335 (assoc-ref %build-inputs "exosip")
337 (inputs `(("ucommon" ,ucommon)
340 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
341 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
342 uses the SIP protocol. Calls can be made from behind NAT firewalls and
343 without the need for a service provider. Its peer-to-peer design ensures that
344 there is no central point for media intercept or capture and thus it can be
345 used to construct a secure telephone system that operates over the public
347 (license license:gpl3+)
348 (home-page "https://www.gnu.org/software/sipwitch/")))
350 (define-public libsrtp
357 (url "https://github.com/cisco/libsrtp")
358 (commit (string-append "v" version))))
359 (file-name (git-file-name name version))
362 "1f7i3jdh1wzdv7zjlz7gs3xw5jqig9zw8z9awsqqcp54f94xdpvd"))))
364 `(("psmisc" ,psmisc) ;some tests require 'killall'
366 (build-system gnu-build-system)
368 '(#:test-target "runtest"
369 #:phases (modify-phases %standard-phases
370 (add-after 'build 'build-shared
371 (lambda* (#:key (make-flags '()) #:allow-other-keys)
372 ;; Build the shared library separately because
373 ;; the test runner requires a static build.
374 (apply invoke "make" "shared_library" make-flags)
376 (add-after 'install 'remove-static-library
377 (lambda* (#:key outputs #:allow-other-keys)
378 (delete-file (string-append (assoc-ref outputs "out")
381 (synopsis "Secure RTP (SRTP) Reference Implementation")
383 "This package provides an implementation of the Secure Real-time Transport
384 Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
385 supporting cryptographic kernel.")
386 (home-page "https://github.com/cisco/libsrtp")
387 (license license:bsd-3)))
389 (define-public libiax2
390 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
391 ;; This is the commit used by the Ring Project.
394 (version (string-append "0.0.0-1." (string-take commit 7)))
399 (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
401 (file-name (git-file-name name version))
404 "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
405 (build-system gnu-build-system)
407 `(("autoconf" ,autoconf)
408 ("automake" ,automake)
409 ("libtool" ,libtool)))
410 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
411 (synopsis "Inter-Asterisk-Protocol library")
412 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
413 Voice-over-IP (VoIP) communications.")
414 ;; The file 'src/md5.c' is released into the public domain by RSA Data
415 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
416 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
417 ;; covered under the 'GPL'.
418 ;; The package as a whole is distributed under the LGPL 2.0.
419 (license (list license:lgpl2.0
420 license:public-domain
429 (uri (string-append "http://holdenc.altervista.org/"
430 "seren/downloads/seren-" version
434 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
435 (build-system gnu-build-system)
436 (arguments '(#:tests? #f)) ; no "check" target
438 `(("alsa-lib" ,alsa-lib)
443 (synopsis "Simple VoIP program to create conferences from the terminal")
445 "Seren is a simple VoIP program based on the Opus codec that allows you
446 to create a voice conference from the terminal, with up to 10 participants,
447 without having to register accounts, exchange emails, or add people to contact
448 lists. All you need to join an existing conference is the host name or IP
449 address of one of the participants.")
450 (home-page "http://holdenc.altervista.org/seren/")
451 (license license:gpl3+)))
453 (define-public mumble
459 (uri (string-append "https://mumble.info/snapshot/"
460 name "-" version ".tar.gz"))
463 "03dqg5yf6d7ilc1wydpshnv1ndssppcbadqcq20jm5j4fdaf53cs"))
464 (modules '((guix build utils)))
467 ;; Remove bundled software. Keep arc4random, celt-0.7.0,
468 ;; celt-0.11.0, qqbonjour, rnnoise, smallft.
470 delete-file-recursively
471 '("3rdparty/GL" ; in mesa
472 "3rdparty/mach-override-build" ; for macx
473 "3rdparty/mach-override-src"
474 "3rdparty/minhook-build" ; for win32
475 "3rdparty/minhook-src"
476 "3rdparty/opus-build" ; in opus
478 "3rdparty/sbcelt-helper-build" ; not enabled
479 "3rdparty/sbcelt-lib-build"
480 "3rdparty/sbcelt-src"
481 "3rdparty/speex-build" ; in speex
483 "3rdparty/speexdsp-src" ; in speexdsp
484 "3rdparty/xinputcheck-build" ; for win32
485 "3rdparty/xinputcheck-src"))
487 (build-system qt-build-system)
489 `(#:tests? #f ; no "check" target
491 (modify-phases %standard-phases
493 (lambda* (#:key inputs outputs #:allow-other-keys)
494 (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
495 (string-append "MUMBLE_PYTHON="
496 (string-append (assoc-ref inputs "python")
498 (string-append "CONFIG+="
500 ;; Options used are listed in the same order
501 ;; as in the "INSTALL" file
502 ;; (plus the final "packaged" and "release").
503 (list "no-bundled-speex" ; in speex
504 "no-bundled-opus" ; in opus
505 "no-g15" ; not packaged
506 "no-jackaudio" ; use pulse
508 "no-alsa" ; use pulse
510 "no-embed-qt-translations"
511 "no-ice" ; not packaged
514 (string-append "DEFINES+="
516 (assoc-ref outputs "out")
518 (add-before 'configure 'fix-libspeechd-include
520 (substitute* "src/mumble/TextToSpeech_unix.cpp"
521 (("libspeechd.h") "speech-dispatcher/libspeechd.h"))
523 ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
524 (add-before 'configure 'fix-statistic-gathering-default
526 (substitute* "src/mumble/Settings.cpp"
527 (("bUsage = true;") "bUsage = false;"))
529 (add-before 'install 'disable-murmur-ice
531 (substitute* "scripts/murmur.ini.system"
534 (replace 'install ; install phase does not exist
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let* ((out (assoc-ref outputs "out"))
537 (etc (string-append out "/etc/murmur"))
538 (dbus (string-append out "/etc/dbus-1/system.d/"))
539 (bin (string-append out "/bin"))
540 (services (string-append out "/share/services"))
541 (applications (string-append out "/share/applications"))
542 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
543 (man (string-append out "/share/man/man1"))
544 (lib (string-append out "/lib/mumble")))
545 (install-file "release/mumble" bin)
546 (install-file "scripts/mumble-overlay" bin)
547 (install-file "scripts/mumble.protocol" services)
548 (install-file "scripts/mumble.desktop" applications)
549 (install-file "icons/mumble.svg" icons)
550 (install-file "man/mumble-overlay.1" man)
551 (install-file "man/mumble.1" man)
552 (install-file "release/murmurd" bin)
553 (install-file "scripts/murmur.ini.system" etc)
554 (rename-file (string-append etc "/murmur.ini.system")
555 (string-append etc "/murmur.ini"))
556 (install-file "scripts/murmur.conf" dbus)
557 (install-file "man/murmurd.1" man)
558 (for-each (lambda (file) (install-file file lib))
559 (find-files "." "\\.so\\."))
560 (for-each (lambda (file) (install-file file lib))
561 (find-files "release/plugins" "\\.so$"))))))))
565 ("libsndfile" ,libsndfile)
567 ("mesa" ,mesa) ; avoid bundled
569 ("opus" ,opus) ; avoid bundled
570 ("protobuf" ,protobuf)
571 ("pulseaudio" ,pulseaudio)
574 ("speech-dispatcher" ,speech-dispatcher)
575 ("speex" ,speex) ; avoid bundled
576 ("speexdsp" ,speexdsp))) ; avoid bundled
578 `(("pkg-config" ,pkg-config)
580 ("qttools" ,qttools)))
581 (synopsis "Low-latency, high quality voice chat software")
583 "Mumble is an low-latency, high quality voice chat
584 software primarily intended for use while gaming.
585 Mumble consists of two applications for separate usage:
586 @code{mumble} for the client, and @code{murmur} for the server.")
587 (home-page "https://wiki.mumble.info/wiki/Main_Page")
588 (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
589 license:bsd-2 ; celt-0.11.0
590 license:isc)))) ; arc4random
592 (define-public twinkle
599 (url "https://github.com/LubosD/twinkle")
600 (commit (string-append "v" version))))
601 (file-name (git-file-name name version))
604 "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
605 (build-system cmake-build-system)
607 `(#:tests? #f ; no test target
608 #:configure-flags '("-DWITH_SPEEX=On")
610 (modify-phases %standard-phases
611 (add-after 'install 'wrap-executable
612 (lambda* (#:key inputs outputs #:allow-other-keys)
613 (let ((out (assoc-ref outputs "out")))
614 (wrap-program (string-append out "/bin/twinkle")
615 `("QT_PLUGIN_PATH" ":" prefix
616 ,(map (lambda (label)
617 (string-append (assoc-ref inputs label)
619 '("qtbase" "qtdeclarative")))
620 `("QML2_IMPORT_PATH" ":" prefix
621 ,(map (lambda (label)
622 (string-append (assoc-ref inputs label)
624 '("qtdeclarative" "qtquickcontrols"))))
629 ("readline" ,readline)
635 ("speexdsp" ,speexdsp)
636 ("libsndfile" ,libsndfile)
637 ("alsa-lib" ,alsa-lib)
638 ("qttools" ,qttools)))
641 ("qtdeclarative" ,qtdeclarative)
642 ("qtquickcontrols" ,qtquickcontrols)))
643 (home-page "http://twinkle.dolezel.info/")
644 (synopsis "Softphone for voice over IP and instant messaging")
645 (description "Twinkle is a softphone for your voice over IP and instant
646 messaging communcations using the SIP protocol. You can use it for direct IP
647 phone to IP phone communication or in a network using a SIP proxy to route your
649 (license license:gpl2+)))
651 (define-public pjproject
659 (url "https://github.com/pjsip/pjproject.git")
660 (commit "5dfa75be7d69047387f9b0436dd9492bbbf03fe4")))
661 (modules '((guix build utils)))
664 (let ((third-party-directories
665 ;; Things we don't need:
666 ;; BaseClasses - contains libraries from Windows SDK
667 ;; we don't need it, at least not now.
668 (list "BaseClasses" "g7221" "ilbc" "milenage"
669 "speex" "threademulation" "yuv" "bdsound"
670 "gsm" "mp3" "resample" "srtp" "webrtc"
671 ;; Keep only resample, build and README.txt.
672 "build/baseclasses" "build/g7221" "build/gsm"
673 "build/ilbc" "build/milenage" "build/resample"
674 "build/samplerate" "build/speex" "build/srtp"
675 "build/webrtc" "build/yuv")))
676 ;; Keep only Makefiles related to resample.
677 (for-each (lambda (directory)
678 (delete-file-recursively
679 (string-append "third_party/" directory)))
680 third-party-directories)
682 (let ((third-party-dirs
683 (list "gsm" "ilbc" "speex" "g7221" "srtp"
684 "portaudio" "resample")))
687 (substitute* "third_party/build/os-linux.mak"
688 (((string-append "DIRS += " dirs)) "")))
690 (file-name (git-file-name name version))
693 "1ayj6n7zd5wvd1nzj2k9s57fb4ckc2fv92k5sjvhd87yg69k3393"))))
694 (build-system gnu-build-system)
696 `(("portaudio" ,portaudio)))
698 ;; These packages are referenced in the Libs field of the pkg-config
699 ;; file that will be installed by pjproject.
703 ("resample", resample)
704 ("util-linux" ,util-linux)))
706 `(("autoconf" ,autoconf)
707 ("automake" ,automake)
708 ("pkg-config" ,pkg-config)
709 ("libtool" ,libtool)))
711 `(;; FIXME make: No rule to make target
712 ;; 'pjlib-test-unknown-[something]-gnu'.
714 ;; #:test-target "selftest"
716 (modify-phases %standard-phases
717 (add-before 'build 'build-dep
718 (lambda _ (invoke "make" "dep")))
719 (add-before 'patch-source-shebangs 'autoconf
721 (invoke "autoconf" "-v" "-f" "-i" "-o"
722 "aconfigure" "aconfigure.ac")))
723 (add-before 'autoconf 'disable-some-tests
724 ;; Three of the six test programs fail due to missing network
727 (substitute* "Makefile"
728 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
729 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
731 (home-page "https://www.pjsip.org")
732 (synopsis "Session Initiation Protocol (SIP) stack")
733 (description "PJProject provides an implementation of the Session
734 Initiation Protocol (SIP) and a multimedia framework.")
735 (license license:gpl2+)))
737 (define %jami-version "20191101.3.67671e7")
739 (define* (jami-source #:key without-daemon)
742 (uri (string-append "https://dl.jami.net/ring-release/tarballs/ring_"
745 (modules '((guix build utils)))
749 (delete-file-recursively "daemon/contrib"))
753 "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0"))))
755 (define-public pjproject-jami
758 (name "pjproject-jami")
760 `(("savoir-faire-linux-patches" ,(jami-source))
761 ,@(package-native-inputs pjproject)))
764 ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
766 (list "--disable-oss"
770 "--disable-speex-aec"
771 "--disable-g711-codec"
772 "--disable-l16-codec"
773 "--disable-gsm-codec"
774 "--disable-g722-codec"
775 "--disable-g7221-codec"
776 "--disable-speex-codec"
777 "--disable-ilbc-codec"
778 "--disable-opencore-amr"
785 "--disable-libwebrtc"
787 "--with-external-srtp"
788 ;; We need -fPIC or else we get the following error when linking
789 ;; against pjproject-jami:
790 ;; relocation R_X86_64_32S against `.rodata' can not be used when
791 ;; making a shared object;
795 (modify-phases %standard-phases
796 (add-after 'unpack 'make-git-checkout-writable
798 (for-each make-file-writable (find-files "."))
800 (add-after 'unpack 'apply-patches
801 (lambda* (#:key inputs #:allow-other-keys)
802 (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux patches")
804 ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
805 ;; WARNING: These amount for huge changes in pjproject.
806 (savoir-faire-linux-patches
807 '("fix_turn_alloc_failure"
813 "fix_ioqueue_ipv6_sendto"
818 "fix_first_packet_turn_tcp"
820 "ignore_ipv6_on_transport_check"
821 "fix_turn_connection_failure"
822 ;; "uwp_vs" ; for windows
823 "disable_local_resolution")))
824 (mkdir-p savoir-faire-linux-patches-directory)
825 (invoke "tar" "-xvf" (assoc-ref inputs "savoir-faire-linux-patches")
826 "-C" savoir-faire-linux-patches-directory
827 "--strip-components=5"
828 "ring-project/daemon/contrib/src/pjproject")
831 (invoke "patch" "--force" "-p1" "-i"
832 (string-append savoir-faire-linux-patches-directory "/"
834 savoir-faire-linux-patches))
836 ;; TODO: We could use substitute-keyword-arguments instead of
837 ;; repeating the phases from pjproject, but somehow it does
839 (add-before 'build 'build-dep
840 (lambda _ (invoke "make" "dep")))
841 (add-before 'patch-source-shebangs 'autoconf
843 (invoke "autoconf" "-v" "-f" "-i" "-o"
844 "aconfigure" "aconfigure.ac")))
845 (add-before 'autoconf 'disable-some-tests
846 ;; Three of the six test programs fail due to missing network
849 (substitute* "Makefile"
850 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
851 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
854 (define-public libring
857 (version %jami-version)
858 (source (jami-source #:without-daemon #t))
859 (build-system gnu-build-system)
861 ;; Missing (optional?) dep: libnatpmp.
862 `(("alsa-lib" ,alsa-lib)
864 ("dbus-c++" ,dbus-c++)
877 ("pulseaudio" ,pulseaudio)
878 ("libsamplerate" ,libsamplerate)
879 ("libsndfile" ,libsndfile)
881 ("speexdsp" ,speexdsp)
883 ("libvorbis" ,libvorbis)
885 ("libvdpau" ,libvdpau)
886 ("yaml-cpp" ,yaml-cpp)
889 ("libsecp256k1" ,libsecp256k1)
891 ("python-wrapper" ,python-wrapper)
892 ("restinio" ,restinio)
895 ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
896 ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
897 ("pjproject" ,pjproject-jami)))
899 `(("autoconf" ,autoconf)
900 ("automake" ,automake)
902 ("pkg-config" ,pkg-config)
905 ("perl" ,perl))) ; Needed for documentation.
907 `(#:tests? #f ; The tests fail to compile due to missing headers.
909 (modify-phases %standard-phases
910 (add-after 'unpack 'change-directory
914 (add-before 'build 'add-lib-dir
918 (synopsis "Distributed multimedia communications platform")
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.
924 This package provides a library and daemon implementing the Jami core
926 (home-page "https://jami.net/")
927 (license license:gpl3+)))
929 (define-public libringclient
932 (name "libringclient")
933 (build-system cmake-build-system)
935 `(("libring" ,libring) ; For 'dring'.
936 ("qtbase" ,qtbase) ; Qt is included in several installed headers.
937 ("qttools" ,qttools)))
939 `(#:tests? #f ; There is no testsuite.
941 (list (string-append "-DRING_BUILD_DIR="
942 (assoc-ref %build-inputs "libring") "/include"))
944 (modify-phases %standard-phases
945 (add-after 'unpack 'change-directory
949 (add-before 'configure 'fix-dbus-interfaces-path
950 (lambda* (#:key inputs #:allow-other-keys)
951 (substitute* "CMakeLists.txt"
952 (("\\$\\{CMAKE_INSTALL_PREFIX\\}(/share/dbus-1/interfaces)" _ dbus-interfaces-path-suffix)
953 (string-append (assoc-ref inputs "libring")
954 dbus-interfaces-path-suffix))))))))
955 (synopsis "Distributed multimedia communications platform")
956 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
957 video and chat communication platform that requires no centralized server and
958 leaves the power of privacy in the hands of the user. It supports the SIP and
959 IAX protocols, as well as decentralized calling using P2P-DHT.
961 This package provides a library common to all Jami clients.")
962 (home-page "https://jami.net")
963 (license license:gpl3+)))
969 (build-system cmake-build-system)
971 `(("libringclient" ,libringclient)
973 ("qrencode" ,qrencode)
974 ("libnotify" ,libnotify)
976 ("clutter-gtk" ,clutter-gtk)
977 ("libcanberra" ,libcanberra)
978 ("webkitgtk" ,webkitgtk)
979 ;; TODO: We must wrap ring-client-gnome to force using the
980 ;; `sqlite-with-column-metadata' package instead of `sqlite' or else it
983 ;; /gnu/store/...-qtbase-5.11.2/lib/qt5/plugins/sqldrivers/libqsqlite.so:
984 ;; undefined symbol: sqlite3_column_table_name16
986 ;; qtbase is built against sqlite-with-column-metadata but somehow
987 ;; jami-client-gnome ends up with both `sqlite' and
988 ;; `sqlite-with-column-metadata' as inputs and it seems that
989 ;; libqsqlite.so gets confused.
990 ("sqlite" ,sqlite-with-column-metadata)))
992 `(("pkg-config" ,pkg-config)
993 ("gettext" ,gettext-minimal)
994 ("glib:bin" ,glib "bin")
995 ("doxygen" ,doxygen)))
997 `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
998 ("adwaita-icon-theme" ,adwaita-icon-theme)
999 ("evolution-data-server" ,evolution-data-server)))
1001 `(#:tests? #f ; There is no testsuite.
1003 (modify-phases %standard-phases
1004 (add-after 'unpack 'change-directory
1006 (chdir "client-gnome")
1008 (add-after 'install 'wrap
1009 (lambda* (#:key inputs outputs #:allow-other-keys)
1010 (let* ((out (assoc-ref outputs "out"))
1011 (path (string-append (assoc-ref inputs "sqlite") "/lib")))
1012 (wrap-program (string-append out "/bin/jami-gnome")
1013 `("LD_LIBRARY_PATH" ":" prefix (,path))))
1015 (synopsis "Distributed, privacy-respecting communication program")
1016 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
1017 video and chat communication platform that requires no centralized server and
1018 leaves the power of privacy in the hands of the user. It supports the SIP and
1019 IAX protocols, as well as decentralized calling using P2P-DHT.
1021 This package provides the Jami client for the GNOME desktop.")
1022 (home-page "https://jami.net")
1023 (license license:gpl3+)))
1025 (define-public jami-client-gnome
1026 (deprecated-package "jami-client-gnome" jami))
1028 (define-public libtgvoip
1036 (url "https://github.com/grishka/libtgvoip.git")
1038 (file-name (git-file-name name version))
1039 ;; Fix compilation on i686-linux architecture.
1040 ;; NOTE: Applying these patches is order-dependent!
1041 ;; The patch for WebRTC /must/ precede the patch for SSE2.
1043 (search-patches "libtgvoip-disable-webrtc.patch"
1044 "libtgvoip-disable-sse2.patch"))
1047 "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
1048 (build-system gnu-build-system)
1050 `(("alsa-lib" ,alsa-lib)
1051 ("libopusenc" ,libopusenc)
1052 ("openssl" ,openssl)
1053 ("pulseaudio" ,pulseaudio)))
1054 (synopsis "VoIP library for Telegram clients")
1055 (description "A collection of libraries and header files for implementing
1056 telephony functionality into custom Telegram clients.")
1057 (home-page "https://github.com/zevlg/libtgvoip")
1058 (license license:unlicense)))