1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
5 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
7 ;;; Copyright © 2016 Francesco Frassinelli <fraph24@gmail.com>
8 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
9 ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2017 Adonay Felipe Nogueira <https://libreplanet.org/wiki/User:Adfeno> <adfeno@hyperbola.info>
12 ;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
13 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
14 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
15 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
16 ;;; Copyright © 2019 Ivan Vilata i Balaguer <ivan@selidor.net>
17 ;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
18 ;;; 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 tls)
77 #:use-module (gnu packages upnp)
78 #:use-module (gnu packages video)
79 #:use-module (gnu packages webkit)
80 #:use-module (gnu packages xiph)
81 #:use-module (gnu packages xorg)
82 #:use-module (gnu packages xml)
83 #:use-module (gnu packages readline)
84 #:use-module (gnu packages bison)
85 #:use-module (gnu packages flex)
86 #:use-module ((guix licenses) #:prefix license:)
87 #:use-module (guix packages)
88 #:use-module (guix download)
89 #:use-module (guix git-download)
90 #:use-module (guix build-system cmake)
91 #:use-module (guix build-system gnu)
92 #:use-module (guix build-system qt))
94 (define-public spandsp
102 ;; The original upstream has been down since the end of March 2020.
103 (string-append "https://web.archive.org/web/20180626203108/"
104 "https://www.soft-switch.org/downloads/" name "/"
105 name "-" version ".tar.gz"))
107 (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
108 (build-system gnu-build-system)
109 (outputs '("out" "doc" "static")) ;doc contains HTML documentation
111 `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
112 #:parallel-build? #f ;non-deterministic build failures may occur otherwise
113 #:parallel-tests? #f ;fails removing the same the files twice otherwise
114 #:phases (modify-phases %standard-phases
115 (add-after 'unpack 'patch-configure.ac
117 ;; spandsp looks at hard coded locations of the FHS to
119 (substitute* "configure.ac"
120 (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
122 "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
123 "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
124 ;; Force a regeneration of the autotools build system.
125 (delete-file "autogen.sh")
126 (delete-file "configure")
128 (add-after 'unpack 'do-not-install-data-files
129 ;; The .tiff images produced for tests are not
130 ;; reproducible and it is not desirable to have those
133 (substitute* '("test-data/itu/fax/Makefile.am"
134 "test-data/etsi/fax/Makefile.am")
135 (("nobase_data_DATA")
138 (add-after 'install 'install-doc
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let ((doc (string-append (assoc-ref outputs "doc")
141 "/share/doc/" ,name "-" ,version)))
142 (copy-recursively "doc/t38_manual" doc)
144 (add-after 'install 'move-static-libraries
145 (lambda* (#:key outputs #:allow-other-keys)
146 (let ((out (assoc-ref outputs "out"))
147 (static (assoc-ref outputs "static")))
148 (mkdir-p (string-append static "/lib"))
149 (with-directory-excursion out
150 (for-each (lambda (file)
152 (string-append static "/"
154 (find-files "lib" "\\.a$")))
157 `(("autoconf" ,autoconf)
158 ("automake" ,automake)
160 ("pkg-config" ,pkg-config)
164 ("libsndfile" ,libsndfile)
165 ("libjpeg" ,libjpeg-turbo) ;XXX: should be propagated from libtiff
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 (home-page "https://www.gnu.org/software/commoncpp/")))
214 (define-public ucommon
220 (uri (string-append "mirror://gnu/commoncpp/" name "-"
223 "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
224 (build-system gnu-build-system)
225 (inputs `(("gnutls" ,gnutls)))
226 (synopsis "Common C++ framework for threaded applications")
227 (description "GNU uCommon C++ is meant as a very light-weight C++ library
228 to facilitate using C++ design patterns even for very deeply embedded
229 applications, such as for systems using uclibc along with posix threading
231 (license license:gpl3+)
232 (home-page "https://www.gnu.org/software/commoncpp/")
233 (properties '((ftp-directory . "/gnu/commoncpp")))))
241 (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
244 "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
245 (build-system gnu-build-system)
246 (inputs `(("ucommon" ,ucommon)
247 ("libgcrypt" ,libgcrypt)))
248 (native-inputs `(("pkg-config" ,pkg-config)))
249 (synopsis "Implementation of RTP (real-time transport protocol)")
250 (description "GNU ccRTP is an implementation of RTP, the real-time transport
251 protocol from the IETF. It is suitable both for high capacity servers and
252 personal client applications. It is flexible in its design, allowing it to
253 function as a framework for the framework, rather than just being a
254 packet-manipulation library.")
255 (license license:gpl2+) ; plus runtime exception
256 (home-page "https://www.gnu.org/software/ccrtp/")))
265 (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
266 (patches (search-patches "osip-CVE-2017-7853.patch"))
269 "00yznbrm9q04wgd4b831km8iwlvwvsnwv87igf79g5vj9yakr88q"))))
270 (build-system gnu-build-system)
272 (synopsis "Library implementing SIP (RFC-3261)")
273 (description "GNU oSIP is an implementation of the SIP protocol. It is
274 used to provide multimedia and telecom software developers with an interface
275 to initiate and control SIP sessions.")
276 (license license:lgpl2.1+)
277 (home-page "https://www.gnu.org/software/osip/")))
280 (define-public exosip
286 (uri (string-append "mirror://savannah/exosip/libeXosip2-"
289 "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
290 (build-system gnu-build-system)
291 (inputs `(("osip" ,osip)))
292 (synopsis "Sip abstraction library")
293 (description "EXosip is a library that hides the complexity of using the
294 SIP protocol for multimedia session establishment. This protocol is mainly to
295 be used by VoIP telephony applications (endpoints or conference server) but
296 might be also useful for any application that wish to establish sessions like
298 (license license:gpl2+)
299 ;; (plus OpenSSL linking exception)
300 ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
301 (home-page "https://savannah.nongnu.org/projects/exosip")))
303 (define-public sipwitch
309 (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
312 "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
313 (build-system gnu-build-system)
314 ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
315 ;; cross-compiling. Among other issues there the program name "pkg-config"
316 ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
317 ;; Fortunately we can avoid the use of pkg-config and set the dependency
319 (arguments `(#:configure-flags
320 `("--without-pkg-config"
321 ,(string-append "UCOMMON_CFLAGS=-I"
322 (assoc-ref %build-inputs "ucommon") "/include")
323 "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
324 ,(string-append "LIBOSIP2_CFLAGS=-I"
325 (assoc-ref %build-inputs "osip") "/include")
326 "LIBOSIP2_LIBS=-losipparser2 -losip2"
327 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
329 "EXOSIP2_LIBS=-leXosip2"
330 ,(string-append "EXOSIP2_CFLAGS=-I"
331 (assoc-ref %build-inputs "exosip")
333 (inputs `(("ucommon" ,ucommon)
336 (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
337 (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
338 uses the SIP protocol. Calls can be made from behind NAT firewalls and
339 without the need for a service provider. Its peer-to-peer design ensures that
340 there is no central point for media intercept or capture and thus it can be
341 used to construct a secure telephone system that operates over the public
343 (license license:gpl3+)
344 (home-page "https://www.gnu.org/software/sipwitch/")))
346 (define-public libsrtp
353 (url "https://github.com/cisco/libsrtp")
354 (commit (string-append "v" version))))
355 (file-name (git-file-name name version))
358 "1f7i3jdh1wzdv7zjlz7gs3xw5jqig9zw8z9awsqqcp54f94xdpvd"))))
360 `(("psmisc" ,psmisc) ;some tests require 'killall'
362 (build-system gnu-build-system)
364 '(#:test-target "runtest"
365 #:phases (modify-phases %standard-phases
366 (add-after 'build 'build-shared
367 (lambda* (#:key (make-flags '()) #:allow-other-keys)
368 ;; Build the shared library separately because
369 ;; the test runner requires a static build.
370 (apply invoke "make" "shared_library" make-flags)
372 (add-after 'install 'remove-static-library
373 (lambda* (#:key outputs #:allow-other-keys)
374 (delete-file (string-append (assoc-ref outputs "out")
377 (synopsis "Secure RTP (SRTP) Reference Implementation")
379 "This package provides an implementation of the Secure Real-time Transport
380 Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
381 supporting cryptographic kernel.")
382 (home-page "https://github.com/cisco/libsrtp")
383 (license license:bsd-3)))
385 (define-public libiax2
386 (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
387 ;; This is the commit used by the Ring Project.
390 (version (string-append "0.0.0-1." (string-take commit 7)))
395 (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
397 (file-name (git-file-name name version))
400 "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
401 (build-system gnu-build-system)
403 `(("autoconf" ,autoconf)
404 ("automake" ,automake)
405 ("libtool" ,libtool)))
406 (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
407 (synopsis "Inter-Asterisk-Protocol library")
408 (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
409 Voice-over-IP (VoIP) communications.")
410 ;; The file 'src/md5.c' is released into the public domain by RSA Data
411 ;; Security. The files 'src/answer.h', 'src/miniphone.c',
412 ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
413 ;; covered under the 'GPL'.
414 ;; The package as a whole is distributed under the LGPL 2.0.
415 (license (list license:lgpl2.0
416 license:public-domain
425 (uri (string-append "http://holdenc.altervista.org/"
426 "seren/downloads/seren-" version
430 "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
431 (build-system gnu-build-system)
432 (arguments '(#:tests? #f)) ; no "check" target
434 `(("alsa-lib" ,alsa-lib)
439 (synopsis "Simple VoIP program to create conferences from the terminal")
441 "Seren is a simple VoIP program based on the Opus codec that allows you
442 to create a voice conference from the terminal, with up to 10 participants,
443 without having to register accounts, exchange emails, or add people to contact
444 lists. All you need to join an existing conference is the host name or IP
445 address of one of the participants.")
446 (home-page "http://holdenc.altervista.org/seren/")
447 (license license:gpl3+)))
449 (define-public mumble
455 (uri (string-append "https://mumble.info/snapshot/"
456 name "-" version ".tar.gz"))
459 "03dqg5yf6d7ilc1wydpshnv1ndssppcbadqcq20jm5j4fdaf53cs"))
460 (modules '((guix build utils)))
463 ;; Remove bundled software. Keep arc4random, celt-0.7.0,
464 ;; celt-0.11.0, qqbonjour, rnnoise, smallft.
466 delete-file-recursively
467 '("3rdparty/GL" ; in mesa
468 "3rdparty/mach-override-build" ; for macx
469 "3rdparty/mach-override-src"
470 "3rdparty/minhook-build" ; for win32
471 "3rdparty/minhook-src"
472 "3rdparty/opus-build" ; in opus
474 "3rdparty/sbcelt-helper-build" ; not enabled
475 "3rdparty/sbcelt-lib-build"
476 "3rdparty/sbcelt-src"
477 "3rdparty/speex-build" ; in speex
479 "3rdparty/speexdsp-src" ; in speexdsp
480 "3rdparty/xinputcheck-build" ; for win32
481 "3rdparty/xinputcheck-src"))
483 (build-system qt-build-system)
485 `(#:tests? #f ; no "check" target
487 (modify-phases %standard-phases
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
491 (string-append "MUMBLE_PYTHON="
492 (string-append (assoc-ref inputs "python")
494 (string-append "CONFIG+="
496 ;; Options used are listed in the same order
497 ;; as in the "INSTALL" file
498 ;; (plus the final "packaged" and "release").
499 (list "no-bundled-speex" ; in speex
500 "no-bundled-opus" ; in opus
501 "no-g15" ; not packaged
502 "no-jackaudio" ; use pulse
504 "no-alsa" ; use pulse
506 "no-embed-qt-translations"
507 "no-ice" ; not packaged
510 (string-append "DEFINES+="
512 (assoc-ref outputs "out")
514 (add-before 'configure 'fix-libspeechd-include
516 (substitute* "src/mumble/TextToSpeech_unix.cpp"
517 (("libspeechd.h") "speech-dispatcher/libspeechd.h"))
519 ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
520 (add-before 'configure 'fix-statistic-gathering-default
522 (substitute* "src/mumble/Settings.cpp"
523 (("bUsage = true;") "bUsage = false;"))
525 (add-before 'install 'disable-murmur-ice
527 (substitute* "scripts/murmur.ini.system"
530 (replace 'install ; install phase does not exist
531 (lambda* (#:key inputs outputs #:allow-other-keys)
532 (let* ((out (assoc-ref outputs "out"))
533 (etc (string-append out "/etc/murmur"))
534 (dbus (string-append out "/etc/dbus-1/system.d/"))
535 (bin (string-append out "/bin"))
536 (services (string-append out "/share/services"))
537 (applications (string-append out "/share/applications"))
538 (icons (string-append out "/share/icons/hicolor/scalable/apps"))
539 (man (string-append out "/share/man/man1"))
540 (lib (string-append out "/lib/mumble")))
541 (install-file "release/mumble" bin)
542 (install-file "scripts/mumble-overlay" bin)
543 (install-file "scripts/mumble.protocol" services)
544 (install-file "scripts/mumble.desktop" applications)
545 (install-file "icons/mumble.svg" icons)
546 (install-file "man/mumble-overlay.1" man)
547 (install-file "man/mumble.1" man)
548 (install-file "release/murmurd" bin)
549 (install-file "scripts/murmur.ini.system" etc)
550 (rename-file (string-append etc "/murmur.ini.system")
551 (string-append etc "/murmur.ini"))
552 (install-file "scripts/murmur.conf" dbus)
553 (install-file "man/murmurd.1" man)
554 (for-each (lambda (file) (install-file file lib))
555 (find-files "." "\\.so\\."))
556 (for-each (lambda (file) (install-file file lib))
557 (find-files "release/plugins" "\\.so$"))))))))
561 ("libsndfile" ,libsndfile)
563 ("mesa" ,mesa) ; avoid bundled
565 ("opus" ,opus) ; avoid bundled
566 ("protobuf" ,protobuf)
567 ("pulseaudio" ,pulseaudio)
570 ("speech-dispatcher" ,speech-dispatcher)
571 ("speex" ,speex) ; avoid bundled
572 ("speexdsp" ,speexdsp))) ; avoid bundled
574 `(("pkg-config" ,pkg-config)
576 ("qttools" ,qttools)))
577 (synopsis "Low-latency, high quality voice chat software")
579 "Mumble is an low-latency, high quality voice chat
580 software primarily intended for use while gaming.
581 Mumble consists of two applications for separate usage:
582 @code{mumble} for the client, and @code{murmur} for the server.")
583 (home-page "https://wiki.mumble.info/wiki/Main_Page")
584 (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
585 license:bsd-2 ; celt-0.11.0
586 license:isc)))) ; arc4random
588 (define-public twinkle
595 (url "https://github.com/LubosD/twinkle")
596 (commit (string-append "v" version))))
597 (file-name (git-file-name name version))
600 "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
601 (build-system cmake-build-system)
603 `(#:tests? #f ; no test target
604 #:configure-flags '("-DWITH_SPEEX=On")
606 (modify-phases %standard-phases
607 (add-after 'install 'wrap-executable
608 (lambda* (#:key inputs outputs #:allow-other-keys)
609 (let ((out (assoc-ref outputs "out")))
610 (wrap-program (string-append out "/bin/twinkle")
611 `("QT_PLUGIN_PATH" ":" prefix
612 ,(map (lambda (label)
613 (string-append (assoc-ref inputs label)
615 '("qtbase" "qtdeclarative")))
616 `("QML2_IMPORT_PATH" ":" prefix
617 ,(map (lambda (label)
618 (string-append (assoc-ref inputs label)
620 '("qtdeclarative" "qtquickcontrols"))))
625 ("readline" ,readline)
631 ("speexdsp" ,speexdsp)
632 ("libsndfile" ,libsndfile)
633 ("alsa-lib" ,alsa-lib)
634 ("qttools" ,qttools)))
637 ("qtdeclarative" ,qtdeclarative)
638 ("qtquickcontrols" ,qtquickcontrols)))
639 (home-page "http://twinkle.dolezel.info/")
640 (synopsis "Softphone for voice over IP and instant messaging")
641 (description "Twinkle is a softphone for your voice over IP and instant
642 messaging communcations using the SIP protocol. You can use it for direct IP
643 phone to IP phone communication or in a network using a SIP proxy to route your
645 (license license:gpl2+)))
647 (define-public pjproject
655 (url "https://github.com/pjsip/pjproject.git")
656 (commit "5dfa75be7d69047387f9b0436dd9492bbbf03fe4")))
657 (modules '((guix build utils)))
660 (let ((third-party-directories
661 ;; Things we don't need:
662 ;; BaseClasses - contains libraries from Windows SDK
663 ;; we don't need it, at least not now.
664 (list "BaseClasses" "g7221" "ilbc" "milenage"
665 "speex" "threademulation" "yuv" "bdsound"
666 "gsm" "mp3" "resample" "srtp" "webrtc"
667 ;; Keep only resample, build and README.txt.
668 "build/baseclasses" "build/g7221" "build/gsm"
669 "build/ilbc" "build/milenage" "build/resample"
670 "build/samplerate" "build/speex" "build/srtp"
671 "build/webrtc" "build/yuv")))
672 ;; Keep only Makefiles related to resample.
673 (for-each (lambda (directory)
674 (delete-file-recursively
675 (string-append "third_party/" directory)))
676 third-party-directories)
678 (let ((third-party-dirs
679 (list "gsm" "ilbc" "speex" "g7221" "srtp"
680 "portaudio" "resample")))
683 (substitute* "third_party/build/os-linux.mak"
684 (((string-append "DIRS += " dirs)) "")))
686 (file-name (git-file-name name version))
689 "1ayj6n7zd5wvd1nzj2k9s57fb4ckc2fv92k5sjvhd87yg69k3393"))))
690 (build-system gnu-build-system)
692 `(("portaudio" ,portaudio)))
694 ;; These packages are referenced in the Libs field of the pkg-config
695 ;; file that will be installed by pjproject.
699 ("resample", resample)
700 ("util-linux" ,util-linux "lib")))
702 `(("autoconf" ,autoconf)
703 ("automake" ,automake)
704 ("pkg-config" ,pkg-config)
705 ("libtool" ,libtool)))
707 `(;; FIXME make: No rule to make target
708 ;; 'pjlib-test-unknown-[something]-gnu'.
710 ;; #:test-target "selftest"
712 (modify-phases %standard-phases
713 (add-before 'build 'build-dep
714 (lambda _ (invoke "make" "dep")))
715 (add-before 'patch-source-shebangs 'autoconf
717 (invoke "autoconf" "-v" "-f" "-i" "-o"
718 "aconfigure" "aconfigure.ac")))
719 (add-before 'autoconf 'disable-some-tests
720 ;; Three of the six test programs fail due to missing network
723 (substitute* "Makefile"
724 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
725 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
727 (home-page "https://www.pjsip.org")
728 (synopsis "Session Initiation Protocol (SIP) stack")
729 (description "PJProject provides an implementation of the Session
730 Initiation Protocol (SIP) and a multimedia framework.")
731 (license license:gpl2+)))
733 (define %jami-version "20191101.3.67671e7")
735 (define* (jami-source #:key without-daemon)
738 (uri (string-append "https://dl.jami.net/ring-release/tarballs/ring_"
741 (modules '((guix build utils)))
745 (delete-file-recursively "daemon/contrib"))
749 "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0"))))
751 (define-public pjproject-jami
754 (name "pjproject-jami")
756 `(("savoir-faire-linux-patches" ,(jami-source))
757 ,@(package-native-inputs pjproject)))
760 ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
762 (list "--disable-oss"
766 "--disable-speex-aec"
767 "--disable-g711-codec"
768 "--disable-l16-codec"
769 "--disable-gsm-codec"
770 "--disable-g722-codec"
771 "--disable-g7221-codec"
772 "--disable-speex-codec"
773 "--disable-ilbc-codec"
774 "--disable-opencore-amr"
781 "--disable-libwebrtc"
783 "--with-external-srtp"
784 ;; We need -fPIC or else we get the following error when linking
785 ;; against pjproject-jami:
786 ;; relocation R_X86_64_32S against `.rodata' can not be used when
787 ;; making a shared object;
791 (modify-phases %standard-phases
792 (add-after 'unpack 'make-git-checkout-writable
794 (for-each make-file-writable (find-files "."))
796 (add-after 'unpack 'apply-patches
797 (lambda* (#:key inputs #:allow-other-keys)
798 (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux patches")
800 ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
801 ;; WARNING: These amount for huge changes in pjproject.
802 (savoir-faire-linux-patches
803 '("fix_turn_alloc_failure"
809 "fix_ioqueue_ipv6_sendto"
814 "fix_first_packet_turn_tcp"
816 "ignore_ipv6_on_transport_check"
817 "fix_turn_connection_failure"
818 ;; "uwp_vs" ; for windows
819 "disable_local_resolution")))
820 (mkdir-p savoir-faire-linux-patches-directory)
821 (invoke "tar" "-xvf" (assoc-ref inputs "savoir-faire-linux-patches")
822 "-C" savoir-faire-linux-patches-directory
823 "--strip-components=5"
824 "ring-project/daemon/contrib/src/pjproject")
827 (invoke "patch" "--force" "-p1" "-i"
828 (string-append savoir-faire-linux-patches-directory "/"
830 savoir-faire-linux-patches))
832 ;; TODO: We could use substitute-keyword-arguments instead of
833 ;; repeating the phases from pjproject, but somehow it does
835 (add-before 'build 'build-dep
836 (lambda _ (invoke "make" "dep")))
837 (add-before 'patch-source-shebangs 'autoconf
839 (invoke "autoconf" "-v" "-f" "-i" "-o"
840 "aconfigure" "aconfigure.ac")))
841 (add-before 'autoconf 'disable-some-tests
842 ;; Three of the six test programs fail due to missing network
845 (substitute* "Makefile"
846 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
847 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
850 (define-public libring
853 (version %jami-version)
854 (source (jami-source #:without-daemon #t))
855 (build-system gnu-build-system)
857 ;; Missing (optional?) dep: libnatpmp.
858 `(("alsa-lib" ,alsa-lib)
860 ("dbus-c++" ,dbus-c++)
873 ("pulseaudio" ,pulseaudio)
874 ("libsamplerate" ,libsamplerate)
875 ("libsndfile" ,libsndfile)
877 ("speexdsp" ,speexdsp)
879 ("libvorbis" ,libvorbis)
881 ("libvdpau" ,libvdpau)
882 ("yaml-cpp" ,yaml-cpp)
885 ("libsecp256k1" ,libsecp256k1)
887 ("python-wrapper" ,python-wrapper)
888 ("restinio" ,restinio)
891 ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
892 ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
893 ("pjproject" ,pjproject-jami)))
895 `(("autoconf" ,autoconf)
896 ("automake" ,automake)
898 ("pkg-config" ,pkg-config)
901 ("perl" ,perl))) ; Needed for documentation.
903 `(#:tests? #f ; The tests fail to compile due to missing headers.
905 (modify-phases %standard-phases
906 (add-after 'unpack 'change-directory
910 (add-before 'build 'add-lib-dir
914 (synopsis "Distributed multimedia communications platform")
915 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
916 video and chat communication platform that requires no centralized server and
917 leaves the power of privacy in the hands of the user. It supports the SIP and
918 IAX protocols, as well as decentralized calling using P2P-DHT.
920 This package provides a library and daemon implementing the Jami core
922 (home-page "https://jami.net/")
923 (license license:gpl3+)))
925 (define-public libringclient
928 (name "libringclient")
929 (build-system cmake-build-system)
931 `(("libring" ,libring) ; For 'dring'.
932 ("qtbase" ,qtbase) ; Qt is included in several installed headers.
933 ("qttools" ,qttools)))
935 `(#:tests? #f ; There is no testsuite.
937 (list (string-append "-DRING_BUILD_DIR="
938 (assoc-ref %build-inputs "libring") "/include"))
940 (modify-phases %standard-phases
941 (add-after 'unpack 'change-directory
945 (add-before 'configure 'fix-dbus-interfaces-path
946 (lambda* (#:key inputs #:allow-other-keys)
947 (substitute* "CMakeLists.txt"
948 (("\\$\\{CMAKE_INSTALL_PREFIX\\}(/share/dbus-1/interfaces)" _ dbus-interfaces-path-suffix)
949 (string-append (assoc-ref inputs "libring")
950 dbus-interfaces-path-suffix))))))))
951 (synopsis "Distributed multimedia communications platform")
952 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
953 video and chat communication platform that requires no centralized server and
954 leaves the power of privacy in the hands of the user. It supports the SIP and
955 IAX protocols, as well as decentralized calling using P2P-DHT.
957 This package provides a library common to all Jami clients.")
958 (home-page "https://jami.net")
959 (license license:gpl3+)))
965 (build-system cmake-build-system)
967 `(("libringclient" ,libringclient)
969 ("qrencode" ,qrencode)
970 ("libnotify" ,libnotify)
972 ("clutter-gtk" ,clutter-gtk)
973 ("libcanberra" ,libcanberra)
974 ("webkitgtk" ,webkitgtk)))
976 `(("pkg-config" ,pkg-config)
977 ("gettext" ,gettext-minimal)
978 ("glib:bin" ,glib "bin")
979 ("doxygen" ,doxygen)))
981 `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
982 ("adwaita-icon-theme" ,adwaita-icon-theme)
983 ("evolution-data-server" ,evolution-data-server)))
985 `(#:tests? #f ; There is no testsuite.
987 (modify-phases %standard-phases
988 (add-after 'unpack 'change-directory
990 (chdir "client-gnome")
992 (synopsis "Distributed, privacy-respecting communication program")
993 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
994 video and chat communication platform that requires no centralized server and
995 leaves the power of privacy in the hands of the user. It supports the SIP and
996 IAX protocols, as well as decentralized calling using P2P-DHT.
998 This package provides the Jami client for the GNOME desktop.")
999 (home-page "https://jami.net")
1000 (license license:gpl3+)))
1002 (define-public jami-client-gnome
1003 (deprecated-package "jami-client-gnome" jami))
1005 (define-public libtgvoip
1013 (url "https://github.com/grishka/libtgvoip.git")
1015 (file-name (git-file-name name version))
1016 ;; Fix compilation on i686-linux architecture.
1017 ;; NOTE: Applying these patches is order-dependent!
1018 ;; The patch for WebRTC /must/ precede the patch for SSE2.
1020 (search-patches "libtgvoip-disable-webrtc.patch"
1021 "libtgvoip-disable-sse2.patch"))
1024 "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
1025 (build-system gnu-build-system)
1027 `(("alsa-lib" ,alsa-lib)
1028 ("libopusenc" ,libopusenc)
1029 ("openssl" ,openssl)
1030 ("pulseaudio" ,pulseaudio)))
1031 (synopsis "VoIP library for Telegram clients")
1032 (description "A collection of libraries and header files for implementing
1033 telephony functionality into custom Telegram clients.")
1034 (home-page "https://github.com/zevlg/libtgvoip")
1035 (license license:unlicense)))