telephony.scm 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  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 Nikita <nikita@n0.is>
  9. ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
  10. ;;; Copyright © 2017, 2018, 2021 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, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  21. ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
  22. ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
  23. ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
  24. ;;;
  25. ;;; This file is part of GNU Guix.
  26. ;;;
  27. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  28. ;;; under the terms of the GNU General Public License as published by
  29. ;;; the Free Software Foundation; either version 3 of the License, or (at
  30. ;;; your option) any later version.
  31. ;;;
  32. ;;; GNU Guix is distributed in the hope that it will be useful, but
  33. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  34. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  35. ;;; GNU General Public License for more details.
  36. ;;;
  37. ;;; You should have received a copy of the GNU General Public License
  38. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  39. (define-module (gnu packages telephony)
  40. #:use-module (gnu packages)
  41. #:use-module (gnu packages admin)
  42. #:use-module (gnu packages aidc)
  43. #:use-module (gnu packages algebra)
  44. #:use-module (gnu packages autotools)
  45. #:use-module (gnu packages avahi)
  46. #:use-module (gnu packages audio)
  47. #:use-module (gnu packages base)
  48. #:use-module (gnu packages boost)
  49. #:use-module (gnu packages check)
  50. #:use-module (gnu packages compression)
  51. #:use-module (gnu packages crypto)
  52. #:use-module (gnu packages databases)
  53. #:use-module (gnu packages docbook)
  54. #:use-module (gnu packages documentation)
  55. #:use-module (gnu packages file)
  56. #:use-module (gnu packages protobuf)
  57. #:use-module (gnu packages gettext)
  58. #:use-module (gnu packages gl)
  59. #:use-module (gnu packages glib)
  60. #:use-module (gnu packages gnome)
  61. #:use-module (gnu packages gnupg)
  62. #:use-module (gnu packages gtk)
  63. #:use-module (gnu packages image)
  64. #:use-module (gnu packages libcanberra)
  65. #:use-module (gnu packages linphone)
  66. #:use-module (gnu packages linux)
  67. #:use-module (gnu packages multiprecision)
  68. #:use-module (gnu packages ncurses)
  69. #:use-module (gnu packages netpbm)
  70. #:use-module (gnu packages networking)
  71. #:use-module (gnu packages pcre)
  72. #:use-module (gnu packages perl)
  73. #:use-module (gnu packages pkg-config)
  74. #:use-module (gnu packages pulseaudio)
  75. #:use-module (gnu packages python)
  76. #:use-module (gnu packages qt)
  77. #:use-module (gnu packages serialization)
  78. #:use-module (gnu packages speech)
  79. #:use-module (gnu packages tls)
  80. #:use-module (gnu packages upnp)
  81. #:use-module (gnu packages video)
  82. #:use-module (gnu packages webkit)
  83. #:use-module (gnu packages xiph)
  84. #:use-module (gnu packages xorg)
  85. #:use-module (gnu packages xml)
  86. #:use-module (gnu packages readline)
  87. #:use-module (gnu packages bison)
  88. #:use-module (gnu packages flex)
  89. #:use-module ((guix licenses) #:prefix license:)
  90. #:use-module (guix packages)
  91. #:use-module (guix download)
  92. #:use-module (guix git-download)
  93. #:use-module (guix build-system cmake)
  94. #:use-module (guix build-system gnu)
  95. #:use-module (guix build-system qt))
  96. (define-public libilbc
  97. (package
  98. (name "libilbc")
  99. (version "2.0.2")
  100. (source
  101. (origin
  102. (method git-fetch)
  103. (uri
  104. (git-reference
  105. (url "https://github.com/TimothyGu/libilbc")
  106. (commit
  107. (string-append "v" version))))
  108. (file-name
  109. (git-file-name name version))
  110. (sha256
  111. (base32
  112. "1j1pn1w1198qvdiq2hgv9hkyq2nqcvmfnwlgppac633idkjnjrqx"))))
  113. (build-system cmake-build-system)
  114. (arguments
  115. `(#:tests? #f)) ; No target
  116. (native-inputs
  117. `(("pkg-config" ,pkg-config)))
  118. (synopsis "Libre iLBC codec")
  119. (description "LibiLBC is a packaging friendly copy of the iLBC codec from
  120. the WebRTC project. It provides a base for distribution packages and can be
  121. used as drop-in replacement for the non-free code from RFC 3591.")
  122. (home-page "https://github.com/TimothyGu/libilbc")
  123. (license license:bsd-3)))
  124. (define-public spandsp
  125. (package
  126. (name "spandsp")
  127. (version "0.0.6")
  128. (source
  129. (origin
  130. (method url-fetch)
  131. (uri
  132. ;; The original upstream has been down since the end of March 2020.
  133. (string-append "https://web.archive.org/web/20180626203108/"
  134. "https://www.soft-switch.org/downloads/" name "/"
  135. name "-" version ".tar.gz"))
  136. (sha256
  137. (base32 "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc"))))
  138. (build-system gnu-build-system)
  139. (outputs '("out" "doc" "static")) ;doc contains HTML documentation
  140. (arguments
  141. `(#:configure-flags '("--enable-doc=yes" "--enable-tests=yes")
  142. #:parallel-build? #f ;non-deterministic build failures may occur otherwise
  143. #:parallel-tests? #f ;fails removing the same the files twice otherwise
  144. #:phases (modify-phases %standard-phases
  145. (add-after 'unpack 'patch-configure.ac
  146. (lambda _
  147. ;; spandsp looks at hard coded locations of the FHS to
  148. ;; find libxml2.
  149. (substitute* "configure.ac"
  150. (("AC_MSG_CHECKING\\(for libxml/xmlmemory\\.h.*" all)
  151. (string-append all
  152. "PKG_CHECK_MODULES(XML2, libxml-2.0)\n"
  153. "CPPFLAGS+=\" $XML2_CFLAGS\"\n")))
  154. ;; Force a regeneration of the autotools build system.
  155. (delete-file "autogen.sh")
  156. (delete-file "configure")
  157. #t))
  158. (add-after 'unpack 'do-not-install-data-files
  159. ;; The .tiff images produced for tests are not
  160. ;; reproducible and it is not desirable to have those
  161. ;; distributed.
  162. (lambda _
  163. (substitute* '("test-data/itu/fax/Makefile.am"
  164. "test-data/etsi/fax/Makefile.am")
  165. (("nobase_data_DATA")
  166. "noinst_DATA"))
  167. #t))
  168. (add-after 'install 'install-doc
  169. (lambda* (#:key outputs #:allow-other-keys)
  170. (let ((doc (string-append (assoc-ref outputs "doc")
  171. "/share/doc/" ,name "-" ,version)))
  172. (copy-recursively "doc/t38_manual" doc)
  173. #t)))
  174. (add-after 'install 'move-static-libraries
  175. (lambda* (#:key outputs #:allow-other-keys)
  176. (let ((out (assoc-ref outputs "out"))
  177. (static (assoc-ref outputs "static")))
  178. (mkdir-p (string-append static "/lib"))
  179. (with-directory-excursion out
  180. (for-each (lambda (file)
  181. (rename-file file
  182. (string-append static "/"
  183. file)))
  184. (find-files "lib" "\\.a$")))
  185. #t))))))
  186. (native-inputs
  187. `(("autoconf" ,autoconf)
  188. ("automake" ,automake)
  189. ("libtool" ,libtool)
  190. ("pkg-config" ,pkg-config)
  191. ;; For the tests
  192. ("fftw" ,fftw)
  193. ("libpcap" ,libpcap)
  194. ("libsndfile" ,libsndfile)
  195. ("libjpeg" ,libjpeg-turbo) ;XXX: should be propagated from libtiff
  196. ("libtiff" ,libtiff)
  197. ("netpbm" ,netpbm)
  198. ("sox" ,sox)
  199. ;; For the documentation
  200. ("docbook-xml" ,docbook-xml-4.3)
  201. ("docbook-xsl" ,docbook-xsl)
  202. ("doxygen" ,doxygen)
  203. ("libxml2" ,libxml2)
  204. ("libxslt" ,libxslt)))
  205. (synopsis "DSP library for telephony")
  206. (description "SpanDSP is a library of DSP functions for telephony, in the
  207. 8000 sample per second world of E1s, T1s, and higher order PCM channels. It
  208. contains low level functions, such as basic filters. It also contains higher
  209. level functions, such as cadenced supervisory tone detection, and a complete
  210. software FAX machine.")
  211. (home-page "https://web.archive.org/web/20180626203108/\
  212. https://www.soft-switch.org/index.html")
  213. (license (list license:lgpl2.1+ ;for the library
  214. license:gpl2+)))) ;for the test suites and support programs
  215. (define-public commoncpp
  216. (package
  217. (name "commoncpp")
  218. (version "1.8.1")
  219. (source (origin
  220. (method url-fetch)
  221. (uri (string-append "mirror://gnu/" name "/commoncpp2-"
  222. version ".tar.gz"))
  223. (sha256 (base32
  224. "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk"))))
  225. (arguments
  226. `(#:phases
  227. (modify-phases %standard-phases
  228. (add-before 'configure 'pre-configure
  229. (lambda _
  230. (substitute* "src/applog.cpp"
  231. (("^// TODO sc.*") "#include <sys/types.h>\n#include <sys/stat.h>\n"))
  232. #t)))))
  233. (build-system gnu-build-system)
  234. (synopsis "(u)Common C++ framework for threaded applications")
  235. (description "GNU Common C++ is an portable, optimized class framework for
  236. threaded applications, supporting concurrent synchronization, inter-process
  237. communications via sockets, and various methods for data handling, such as
  238. serialization and XML parsing. It includes the uCommon C++ library, a smaller
  239. reimplementation.")
  240. (license license:gpl2+) ; plus runtime exception
  241. (properties '((ftp-directory . "/gnu/commoncpp")
  242. (upstream-name . "commoncpp2")))
  243. (home-page "https://www.gnu.org/software/commoncpp/")))
  244. (define-public ucommon
  245. (package
  246. (name "ucommon")
  247. (version "7.0.0")
  248. (source (origin
  249. (method url-fetch)
  250. (uri (string-append "mirror://gnu/commoncpp/" name "-"
  251. version ".tar.gz"))
  252. (sha256 (base32
  253. "1mv080rvrhyxyhgqiqr8r9jdqhg3xhfawjvfj5zgj47h59nggjba"))))
  254. (build-system gnu-build-system)
  255. (inputs `(("gnutls" ,gnutls)))
  256. (synopsis "Common C++ framework for threaded applications")
  257. (description "GNU uCommon C++ is meant as a very light-weight C++ library
  258. to facilitate using C++ design patterns even for very deeply embedded
  259. applications, such as for systems using uclibc along with posix threading
  260. support.")
  261. (license license:gpl3+)
  262. (home-page "https://www.gnu.org/software/commoncpp/")
  263. (properties '((ftp-directory . "/gnu/commoncpp")))))
  264. (define-public ccrtp
  265. (package
  266. (name "ccrtp")
  267. (version "2.1.2")
  268. (source (origin
  269. (method url-fetch)
  270. (uri (string-append "mirror://gnu/ccrtp/ccrtp-"
  271. version ".tar.gz"))
  272. (sha256 (base32
  273. "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh"))))
  274. (build-system gnu-build-system)
  275. (inputs `(("ucommon" ,ucommon)
  276. ("libgcrypt" ,libgcrypt)))
  277. (native-inputs `(("pkg-config" ,pkg-config)))
  278. (synopsis "Implementation of RTP (real-time transport protocol)")
  279. (description "GNU ccRTP is an implementation of RTP, the real-time transport
  280. protocol from the IETF. It is suitable both for high capacity servers and
  281. personal client applications. It is flexible in its design, allowing it to
  282. function as a framework for the framework, rather than just being a
  283. packet-manipulation library.")
  284. (license license:gpl2+) ; plus runtime exception
  285. (home-page "https://www.gnu.org/software/ccrtp/")))
  286. (define-public zrtpcpp
  287. (package
  288. (name "zrtpcpp")
  289. (version "4.6.6")
  290. (source
  291. (origin
  292. (method git-fetch)
  293. (uri
  294. (git-reference
  295. (url "https://github.com/wernerd/ZRTPCPP")
  296. (commit
  297. (string-append "V" version))))
  298. (file-name
  299. (git-file-name name version))
  300. (sha256
  301. (base32
  302. "06vphvh4dgi7ah5qkq53wqvswv8l273x0xwbc447qmgvamm0x1vs"))))
  303. (build-system cmake-build-system)
  304. (arguments
  305. `(#:tests? #f)) ; No target
  306. (native-inputs
  307. `(("pkg-config" ,pkg-config)))
  308. (inputs
  309. `(("ccrtp" ,ccrtp)
  310. ("ucommon" ,ucommon)))
  311. (synopsis "C++ Implementation of ZRTP protocol")
  312. (description "GNU ZRTP C++ provides a library that adds ZRTP support to the
  313. GNU ccRTP stack and serves as library for other RTP stacks
  314. (PJSIP, GStreamer).")
  315. (home-page "https://www.gnu.org/software/ccrtp/zrtp")
  316. (license license:lgpl3+)))
  317. (define-public osip
  318. (package
  319. (name "osip")
  320. (version "5.2.1")
  321. (source (origin
  322. (method url-fetch)
  323. (uri (string-append "mirror://gnu/osip/libosip2-" version ".tar.gz"))
  324. (patches (search-patches "osip-CVE-2017-7853.patch"))
  325. (sha256
  326. (base32
  327. "1wibs2zs035ay7qvl5ai8drv6f0xw7iscb0frmpgax3pisy88dzf"))))
  328. (build-system gnu-build-system)
  329. (synopsis "Library implementing SIP (RFC-3261)")
  330. (description "GNU oSIP is an implementation of the SIP protocol. It is
  331. used to provide multimedia and telecom software developers with an interface
  332. to initiate and control SIP sessions.")
  333. (license license:lgpl2.1+)
  334. (properties '((ftp-directory . "/gnu/osip")
  335. (upstream-name . "libosip2")))
  336. (home-page "https://www.gnu.org/software/osip/")))
  337. (define-public exosip
  338. (package
  339. (name "exosip")
  340. (version "4.1.0")
  341. (source (origin
  342. (method url-fetch)
  343. (uri (string-append "mirror://savannah/exosip/libeXosip2-"
  344. version ".tar.gz"))
  345. (sha256 (base32
  346. "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw"))))
  347. (build-system gnu-build-system)
  348. (inputs `(("osip" ,osip)))
  349. (synopsis "Sip abstraction library")
  350. (description "EXosip is a library that hides the complexity of using the
  351. SIP protocol for multimedia session establishment. This protocol is mainly to
  352. be used by VoIP telephony applications (endpoints or conference server) but
  353. might be also useful for any application that wish to establish sessions like
  354. multiplayer games.")
  355. (license license:gpl2+)
  356. ;; (plus OpenSSL linking exception)
  357. ;; http://git.savannah.gnu.org/cgit/exosip.git/plain/LICENSE.OpenSSL
  358. (home-page "https://savannah.nongnu.org/projects/exosip")))
  359. (define-public sipwitch
  360. (package
  361. (name "sipwitch")
  362. (version "1.9.15")
  363. (source (origin
  364. (method url-fetch)
  365. (uri (string-append "mirror://gnu/sipwitch/sipwitch-"
  366. version ".tar.gz"))
  367. (sha256 (base32
  368. "10lli9c703d7qbarzc0lgmz963ppncvnrklwrnri0s1zcmmahyia"))))
  369. (build-system gnu-build-system)
  370. ;; The configure.ac uses pkg-config but in a kludgy way which breaks when
  371. ;; cross-compiling. Among other issues there the program name "pkg-config"
  372. ;; is hard coded instead of respecting the PKG_CONFIG environment variable.
  373. ;; Fortunately we can avoid the use of pkg-config and set the dependency
  374. ;; flags ourselves.
  375. (arguments `(#:configure-flags
  376. `("--without-pkg-config"
  377. ,(string-append "UCOMMON_CFLAGS=-I"
  378. (assoc-ref %build-inputs "ucommon") "/include")
  379. "UCOMMON_LIBS=-lusecure -lucommon -lrt -ldl -lpthread"
  380. ,(string-append "LIBOSIP2_CFLAGS=-I"
  381. (assoc-ref %build-inputs "osip") "/include")
  382. "LIBOSIP2_LIBS=-losipparser2 -losip2"
  383. ,(string-append "--sysconfdir=" (assoc-ref %outputs "out")
  384. "/etc")
  385. "EXOSIP2_LIBS=-leXosip2"
  386. ,(string-append "EXOSIP2_CFLAGS=-I"
  387. (assoc-ref %build-inputs "exosip")
  388. "/include"))))
  389. (inputs `(("ucommon" ,ucommon)
  390. ("exosip" ,exosip)
  391. ("osip" ,osip)))
  392. (synopsis "Secure peer-to-peer VoIP server for the SIP protocol")
  393. (description "GNU SIP Witch is a peer-to-peer Voice-over-IP server that
  394. uses the SIP protocol. Calls can be made from behind NAT firewalls and
  395. without the need for a service provider. Its peer-to-peer design ensures that
  396. there is no central point for media intercept or capture and thus it can be
  397. used to construct a secure telephone system that operates over the public
  398. internet.")
  399. (license license:gpl3+)
  400. (home-page "https://www.gnu.org/software/sipwitch/")))
  401. (define-public libsrtp
  402. (package
  403. (name "libsrtp")
  404. (version "2.4.0")
  405. (source (origin
  406. (method git-fetch)
  407. (uri (git-reference
  408. (url "https://github.com/cisco/libsrtp")
  409. (commit (string-append "v" version))))
  410. (file-name (git-file-name name version))
  411. (sha256
  412. (base32
  413. "0syl2ywddgqz29h43d6rc7waf3hp2yc14yhnrvdsja2bg8wrv6sb"))))
  414. (native-inputs
  415. `(("psmisc" ,psmisc) ;some tests require 'killall'
  416. ("procps" ,procps)))
  417. (build-system gnu-build-system)
  418. (arguments
  419. '(#:test-target "runtest"
  420. #:phases (modify-phases %standard-phases
  421. (add-after 'build 'build-shared
  422. (lambda* (#:key (make-flags '()) #:allow-other-keys)
  423. ;; Build the shared library separately because
  424. ;; the test runner requires a static build.
  425. (apply invoke "make" "shared_library" make-flags)
  426. #t))
  427. (add-after 'install 'remove-static-library
  428. (lambda* (#:key outputs #:allow-other-keys)
  429. (delete-file (string-append (assoc-ref outputs "out")
  430. "/lib/libsrtp2.a"))
  431. #t)))))
  432. (synopsis "Secure RTP (SRTP) Reference Implementation")
  433. (description
  434. "This package provides an implementation of the Secure Real-time Transport
  435. Protocol (@dfn{SRTP}), the Universal Security Transform (@dfn{UST}), and a
  436. supporting cryptographic kernel.")
  437. (home-page "https://github.com/cisco/libsrtp")
  438. (license license:bsd-3)))
  439. (define-public libiax2
  440. (let ((commit "0e5980f1d78ce462e2d1ed6bc39ff35c8341f201"))
  441. ;; This is the commit used by the Ring Project.
  442. (package
  443. (name "libiax2")
  444. (version (string-append "0.0.0-1." (string-take commit 7)))
  445. (source
  446. (origin
  447. (method git-fetch)
  448. (uri (git-reference
  449. (url "https://gitlab.savoirfairelinux.com/sflphone/libiax2.git")
  450. (commit commit)))
  451. (file-name (git-file-name name version))
  452. (sha256
  453. (base32
  454. "0d269474kk1933c55hx4azw3sak5ycfrxkw6ida0sb2cm00kfich"))))
  455. (build-system gnu-build-system)
  456. (native-inputs
  457. `(("autoconf" ,autoconf)
  458. ("automake" ,automake)
  459. ("libtool" ,libtool)))
  460. (home-page "https://gitlab.savoirfairelinux.com/sflphone/libiax2")
  461. (synopsis "Inter-Asterisk-Protocol library")
  462. (description "LibIAX2 implements the Inter-Asterisk-Protocol for relaying
  463. Voice-over-IP (VoIP) communications.")
  464. ;; The file 'src/md5.c' is released into the public domain by RSA Data
  465. ;; Security. The files 'src/answer.h', 'src/miniphone.c',
  466. ;; 'src/options.c', 'src/options.h', 'src/ring10.h', 'src/winiphone.c' are
  467. ;; covered under the 'GPL'.
  468. ;; The package as a whole is distributed under the LGPL 2.0.
  469. (license (list license:lgpl2.0
  470. license:public-domain
  471. license:gpl2+)))))
  472. (define-public seren
  473. (package
  474. (name "seren")
  475. (version "0.0.21")
  476. (source (origin
  477. (method url-fetch)
  478. (uri (string-append "http://holdenc.altervista.org/"
  479. "seren/downloads/seren-" version
  480. ".tar.gz"))
  481. (sha256
  482. (base32
  483. "06mams6bng7ib7p2zpfq88kdr4ffril9svzc9lprkb0wjgmkglk9"))))
  484. (build-system gnu-build-system)
  485. (arguments '(#:tests? #f)) ; no "check" target
  486. (inputs
  487. `(("alsa-lib" ,alsa-lib)
  488. ("gmp" ,gmp)
  489. ("libogg" ,libogg)
  490. ("ncurses" ,ncurses)
  491. ("opus" ,opus)))
  492. (synopsis "Simple VoIP program to create conferences from the terminal")
  493. (description
  494. "Seren is a simple VoIP program based on the Opus codec that allows you
  495. to create a voice conference from the terminal, with up to 10 participants,
  496. without having to register accounts, exchange emails, or add people to contact
  497. lists. All you need to join an existing conference is the host name or IP
  498. address of one of the participants.")
  499. (home-page "http://holdenc.altervista.org/seren/")
  500. (license license:gpl3+)))
  501. (define-public mumble
  502. (package
  503. (name "mumble")
  504. (version "1.3.4")
  505. (source (origin
  506. (method url-fetch)
  507. (uri
  508. (string-append
  509. "https://github.com/mumble-voip/mumble/releases/download/"
  510. version "/" name "-" version ".tar.gz"))
  511. (sha256
  512. (base32
  513. "14v0rgy1a5alxmz7ly95y38bdj0hx79yysgkcd8r8p9qqfzlwpv1"))
  514. (modules '((guix build utils)
  515. (ice-9 ftw)
  516. (srfi srfi-1)))
  517. (snippet
  518. `(begin
  519. (let ((keep
  520. '("arc4random-src"
  521. "celt-0.7.0-build"
  522. "celt-0.7.0-src"
  523. "celt-0.11.0-build"
  524. "celt-0.11.0-src"
  525. "qqbonjour-src"
  526. "rnnoise-build"
  527. "rnnoise-src"
  528. "smallft-src")))
  529. (with-directory-excursion "3rdparty"
  530. (for-each delete-file-recursively
  531. (lset-difference string=?
  532. (scandir ".")
  533. (cons* "." ".." keep))))
  534. #t)))))
  535. (build-system qt-build-system)
  536. (arguments
  537. `(#:tests? #f ; no "check" target
  538. #:phases
  539. (modify-phases %standard-phases
  540. (replace 'configure
  541. (lambda* (#:key inputs outputs #:allow-other-keys)
  542. (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
  543. (string-append "MUMBLE_PYTHON="
  544. (search-input-file inputs
  545. "/bin/python3"))
  546. (string-append "CONFIG+="
  547. (string-join
  548. ;; Options used are listed in the same order
  549. ;; as in the "INSTALL" file
  550. ;; (plus the final "packaged" and "release").
  551. (list "no-bundled-speex" ; in speex
  552. "no-bundled-opus" ; in opus
  553. "no-g15" ; not packaged
  554. "no-jackaudio" ; use pulse
  555. "no-oss" ; use pulse
  556. "no-alsa" ; use pulse
  557. "no-update"
  558. "no-embed-qt-translations"
  559. "no-ice" ; not packaged
  560. "packaged"
  561. "release")))
  562. (string-append "DEFINES+="
  563. "PLUGIN_PATH="
  564. (assoc-ref outputs "out")
  565. "/lib/mumble"))))
  566. (add-before 'configure 'fix-libspeechd-include
  567. (lambda _
  568. (substitute* "src/mumble/TextToSpeech_unix.cpp"
  569. (("libspeechd.h") "speech-dispatcher/libspeechd.h"))
  570. #t))
  571. ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
  572. (add-before 'configure 'fix-statistic-gathering-default
  573. (lambda _
  574. (substitute* "src/mumble/Settings.cpp"
  575. (("bUsage = true;") "bUsage = false;"))
  576. #t))
  577. (add-before 'configure 'fix-mumble-overlay
  578. (lambda* (#:key outputs #:allow-other-keys)
  579. (with-output-to-file "scripts/mumble-overlay"
  580. (lambda ()
  581. (format #t "#!~a~%" (which "bash"))
  582. (format #t "export LD_PRELOAD=\"~a $LD_PRELOAD\"~%"
  583. (string-append (assoc-ref outputs "out")
  584. "/lib/mumble/libmumble.so.1"))
  585. (format #t "exec \"${@}\"")))
  586. #t))
  587. (add-before 'install 'disable-murmur-ice
  588. (lambda _
  589. (substitute* "scripts/murmur.ini.system"
  590. (("^ice=") ";ice="))
  591. #t))
  592. (replace 'install ; install phase does not exist
  593. (lambda* (#:key inputs outputs #:allow-other-keys)
  594. (let* ((out (assoc-ref outputs "out"))
  595. (etc (string-append out "/etc/murmur"))
  596. (dbus (string-append out "/etc/dbus-1/system.d/"))
  597. (bin (string-append out "/bin"))
  598. (services (string-append out "/share/services"))
  599. (applications (string-append out "/share/applications"))
  600. (icons (string-append out "/share/icons/hicolor/scalable/apps"))
  601. (man (string-append out "/share/man/man1"))
  602. (lib (string-append out "/lib/mumble")))
  603. (install-file "release/mumble" bin)
  604. (install-file "scripts/mumble-overlay" bin)
  605. (install-file "scripts/mumble.protocol" services)
  606. (install-file "scripts/mumble.desktop" applications)
  607. (install-file "icons/mumble.svg" icons)
  608. (install-file "man/mumble-overlay.1" man)
  609. (install-file "man/mumble.1" man)
  610. (install-file "release/murmurd" bin)
  611. (install-file "scripts/murmur.ini.system" etc)
  612. (rename-file (string-append etc "/murmur.ini.system")
  613. (string-append etc "/murmur.ini"))
  614. (install-file "scripts/murmur.conf" dbus)
  615. (install-file "man/murmurd.1" man)
  616. (for-each (lambda (file) (install-file file lib))
  617. (find-files "." "\\.so\\."))
  618. (for-each (lambda (file) (install-file file lib))
  619. (find-files "release/plugins" "\\.so$"))
  620. #t))))))
  621. (inputs
  622. `(("avahi" ,avahi)
  623. ("boost" ,boost)
  624. ("libsndfile" ,libsndfile)
  625. ("libxi" ,libxi)
  626. ("mesa" ,mesa) ; avoid bundled
  627. ("openssl" ,openssl)
  628. ("opus" ,opus) ; avoid bundled
  629. ("protobuf" ,protobuf)
  630. ("pulseaudio" ,pulseaudio)
  631. ("qtbase" ,qtbase-5)
  632. ("qtsvg" ,qtsvg)
  633. ("speech-dispatcher" ,speech-dispatcher)
  634. ("speex" ,speex) ; avoid bundled
  635. ("speexdsp" ,speexdsp))) ; avoid bundled
  636. (native-inputs
  637. `(("pkg-config" ,pkg-config)
  638. ("python" ,python)
  639. ("qttools" ,qttools)))
  640. (synopsis "Low-latency, high quality voice chat software")
  641. (description
  642. "Mumble is an low-latency, high quality voice chat
  643. software primarily intended for use while gaming.
  644. Mumble consists of two applications for separate usage:
  645. @code{mumble} for the client, and @code{murmur} for the server.")
  646. (home-page "https://wiki.mumble.info/wiki/Main_Page")
  647. (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
  648. license:bsd-2 ; celt-0.11.0
  649. license:isc)))) ; arc4random
  650. (define-public twinkle
  651. (package
  652. (name "twinkle")
  653. (version "1.10.2")
  654. (source
  655. (origin
  656. (method git-fetch)
  657. (uri
  658. (git-reference
  659. (url "https://github.com/LubosD/twinkle")
  660. (commit
  661. (string-append "v" version))))
  662. (file-name
  663. (git-file-name name version))
  664. (patches
  665. (search-patches "twinkle-bcg729.patch")) ; To support new BCG729 API.
  666. (sha256
  667. (base32
  668. "0s0gi03xwvzp02ah4q6j33r9jx9nbayr6dxlg2ck9pwbay1nq1hx"))))
  669. (build-system qt-build-system)
  670. (arguments
  671. `(#:tests? #f ; no test target
  672. #:configure-flags
  673. (list
  674. ;; FIX-ME: Make Twinkle compatible with libre version of iLBC.
  675. ;; "-DWITH_ILBC=On" ; For iLBC Codec Support
  676. "-DWITH_ZRTP=On" ; For ZRTP Support
  677. "-DWITH_G729=On" ; For G729 Codec Support
  678. "-DWITH_SPEEX=On"))) ; For Speex Codec Support
  679. (native-inputs
  680. `(("bison" ,bison)
  681. ("flex" ,flex)
  682. ("qttools" ,qttools)))
  683. (inputs
  684. `(("alsa-lib" ,alsa-lib)
  685. ("bcg729" ,bcg729)
  686. ("zrtpcpp" ,zrtpcpp)
  687. ("ccrtp" ,ccrtp)
  688. ("file" ,file)
  689. ("libilbc" ,libilbc)
  690. ("libsndfile" ,libsndfile)
  691. ("libxml2" ,libxml2)
  692. ("qtbase" ,qtbase-5)
  693. ("qtdeclarative" ,qtdeclarative)
  694. ("qtquickcontrols" ,qtquickcontrols)
  695. ("readline" ,readline)
  696. ("speex" ,speex)
  697. ("speexdsp" ,speexdsp)
  698. ("ucommon" ,ucommon)))
  699. (synopsis "Softphone for voice over IP and instant messaging")
  700. (description "Twinkle is a softphone for your voice over IP and instant
  701. messaging communcations using the SIP protocol. You can use it for direct
  702. IP phone to IP phone communication or in a network using a SIP proxy to route
  703. your calls and messages.")
  704. (home-page "http://twinkle.dolezel.info/")
  705. (license license:gpl2+)))
  706. (define-public pjproject
  707. (package
  708. (name "pjproject")
  709. (version "2.11")
  710. (source
  711. (origin
  712. (method git-fetch)
  713. (uri (git-reference
  714. (url "https://github.com/pjsip/pjproject")
  715. (commit version)))
  716. (file-name (git-file-name name version))
  717. (sha256
  718. (base32
  719. "1kn9g1x1vmh4130ghph8mldz5m89gsjs4vpdzlzm98m3808gk5an"))
  720. (modules '((guix build utils)))
  721. (snippet
  722. '(begin
  723. ;; Remove bundled libraries.
  724. (delete-file-recursively "third_party")
  725. (substitute* "aconfigure.ac"
  726. (("third_party/build/os-auto.mak") ""))
  727. (substitute* "Makefile"
  728. (("third_party/build") ""))))))
  729. (build-system gnu-build-system)
  730. (outputs '("out" "debug" "static"))
  731. (arguments
  732. `(#:tests? #t
  733. #:test-target "selftest"
  734. #:configure-flags
  735. (list "--enable-shared"
  736. "--with-external-speex"
  737. "--with-external-gsm"
  738. "--with-external-srtp"
  739. "--with-external-pa"
  740. ;; The following flag is Linux specific.
  741. ,@(if (string-contains (or (%current-system)
  742. (%current-target-system)) "linux")
  743. '("--enable-epoll")
  744. '())
  745. "--with-gnutls" ;disable OpenSSL checks
  746. "--disable-libyuv" ;TODO: add missing package
  747. "--disable-silk" ;TODO: add missing package
  748. "--disable-libwebrtc" ;TODO: add missing package
  749. "--disable-ilbc-codec" ;cannot be unbundled
  750. "--disable-g7221-codec" ;TODO: add missing package
  751. "--enable-libsamplerate"
  752. ;; -DNDEBUG is set to prevent pjproject from raising
  753. ;; assertions that aren't critical, crashing
  754. ;; applications as the result.
  755. "CFLAGS=-DNDEBUG"
  756. ;; Specify a runpath reference to itself, which is missing and
  757. ;; causes the validate-runpath phase to fail.
  758. (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out")
  759. "/lib"))
  760. #:phases
  761. (modify-phases %standard-phases
  762. (add-after 'unpack 'make-source-files-writable
  763. ;; Make all the files writable to prevent the following error:
  764. ;; "autom4te: cannot open aconfigure: Permission denied".
  765. (lambda _
  766. (for-each make-file-writable (find-files "."))))
  767. (add-before 'build 'build-dep
  768. (lambda _ (invoke "make" "dep")))
  769. ;; The check phases is moved after the install phase so to
  770. ;; use the installed shared libraries for the tests.
  771. (delete 'check)
  772. (add-after 'install 'move-static-libraries
  773. (lambda* (#:key outputs #:allow-other-keys)
  774. (let ((out (assoc-ref outputs "out"))
  775. (s (string-append (assoc-ref outputs "static") "/lib")))
  776. (mkdir-p s)
  777. (with-directory-excursion out
  778. (for-each (lambda (f)
  779. (rename-file f (string-append s "/" (basename f))))
  780. (find-files "." "\\.a$"))))))
  781. (add-after 'install 'check
  782. (assoc-ref %standard-phases 'check))
  783. (add-before 'patch-source-shebangs 'autoconf
  784. (lambda _
  785. (invoke "autoconf" "-v" "-f" "-i" "-o"
  786. "aconfigure" "aconfigure.ac")))
  787. (add-before 'autoconf 'disable-some-tests
  788. (lambda _
  789. (substitute* "pjlib/src/pjlib-test/test.h"
  790. ;; Disable network tests which are slow and/or require an
  791. ;; actual network.
  792. (("#define GROUP_NETWORK.*")
  793. "#define GROUP_NETWORK 0\n"))
  794. (substitute* "self-test.mak"
  795. ;; Fails with: pjlib-util-test-x86_64-unknown-linux-gnu:
  796. ;; ../src/pjlib-util-test/resolver_test.c:1501: action2_1:
  797. ;; Assertio n `pj_strcmp2(&pkt->q[0].name, "_sip._udp."
  798. ;; "domain2.com")==0' failed.
  799. ((" pjlib_util_test ") ""))
  800. (substitute* "pjsip/src/test/test.h"
  801. ;; Fails with: Error: unable to acquire TCP transport:
  802. ;; [pj_status_t=120101] Network is unreachable.
  803. (("#define INCLUDE_TCP_TEST.*")
  804. "#define INCLUDE_TCP_TEST 0\n")
  805. ;; The TSX tests takes a very long time to run; skip them.
  806. (("#define INCLUDE_TSX_GROUP.*")
  807. "#define INCLUDE_TSX_GROUP 0\n"))
  808. (substitute* "pjsip/src/test/dns_test.c"
  809. ;; The round_robin_test fails non-deterministically (depending
  810. ;; on load); skip it (see:
  811. ;; https://github.com/pjsip/pjproject/issues/2500).
  812. (("round_robin_test(pool)") 0))
  813. (substitute* "pjmedia/src/test/test.h"
  814. ;; The following tests require a sound card.
  815. (("#define HAS_MIPS_TEST.*")
  816. "#define HAS_MIPS_TEST 0\n")
  817. (("#define HAS_JBUF_TEST.*")
  818. "#define HAS_JBUF_TEST 0\n"))
  819. (substitute* "Makefile"
  820. ;; Disable the pjnath and pjsua tests, which require an actual
  821. ;; network and an actual sound card, respectively.
  822. (("pjnath-test pjmedia-test pjsip-test pjsua-test")
  823. "pjmedia-test pjsip-test")))))))
  824. (native-inputs
  825. `(("autoconf" ,autoconf)
  826. ("automake" ,automake)
  827. ("libtool" ,libtool)
  828. ("pkg-config" ,pkg-config)))
  829. (inputs
  830. `(("bcg729" ,bcg729)
  831. ("gnutls" ,gnutls)
  832. ("gsm" ,gsm)
  833. ("libsamplerate" ,libsamplerate)
  834. ("libsrtp" ,libsrtp)
  835. ("opus" ,opus)
  836. ("portaudio" ,portaudio)
  837. ("speex" ,speex)
  838. ("speexdsp" ,speexdsp)))
  839. (home-page "https://www.pjsip.org")
  840. (synopsis "Session Initiation Protocol (SIP) stack")
  841. (description "PJProject provides an implementation of the Session
  842. Initiation Protocol (SIP) and a multimedia framework.")
  843. (license license:gpl2+)))
  844. (define-public libtgvoip
  845. (package
  846. (name "libtgvoip")
  847. (version "2.4.4")
  848. (source
  849. (origin
  850. (method git-fetch)
  851. (uri (git-reference
  852. (url "https://github.com/grishka/libtgvoip")
  853. (commit version)))
  854. (file-name (git-file-name name version))
  855. ;; Fix compilation on i686-linux architecture.
  856. ;; NOTE: Applying these patches is order-dependent!
  857. ;; The patch for WebRTC /must/ precede the patch for SSE2.
  858. (patches
  859. (search-patches "libtgvoip-disable-webrtc.patch"
  860. "libtgvoip-disable-sse2.patch"))
  861. (sha256
  862. (base32
  863. "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
  864. (build-system gnu-build-system)
  865. (inputs
  866. `(("alsa-lib" ,alsa-lib)
  867. ("openssl" ,openssl)
  868. ("opus" ,opus)
  869. ("pulseaudio" ,pulseaudio)))
  870. (arguments
  871. `(#:phases
  872. (modify-phases %standard-phases
  873. ;; libtgvoip wants to dlopen libpulse and libasound, so tell it where
  874. ;; they are.
  875. (add-after 'unpack 'patch-dlopen
  876. (lambda* (#:key inputs #:allow-other-keys)
  877. (substitute* "os/linux/AudioPulse.cpp"
  878. (("libpulse\\.so")
  879. (search-input-file inputs "/lib/libpulse.so")))
  880. (substitute* '("os/linux/AudioInputALSA.cpp"
  881. "os/linux/AudioOutputALSA.cpp")
  882. (("libasound\\.so")
  883. (search-input-file inputs "/lib/libasound.so"))))))))
  884. (synopsis "VoIP library for Telegram clients")
  885. (description "A collection of libraries and header files for implementing
  886. telephony functionality into custom Telegram clients.")
  887. (home-page "https://github.com/zevlg/libtgvoip")
  888. (license license:unlicense)))