370748220ad14852d409eb9c8519fd753469f991
[jackhill/guix/guix.git] / gnu / packages / linphone.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;;
3 ;;; Copyright © 2020, 2021 Raghav Gururajan <raghavgururajan@disroot.org>
4 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
5 ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages linphone)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages admin)
25 #:use-module (gnu packages audio)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages crypto)
29 #:use-module (gnu packages documentation)
30 #:use-module (gnu packages gettext)
31 #:use-module (gnu packages gl)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gnome)
34 #:use-module (gnu packages gnome-xyz)
35 #:use-module (gnu packages graphviz)
36 #:use-module (gnu packages gtk)
37 #:use-module (gnu packages image)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pulseaudio)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages python-xyz)
44 #:use-module (gnu packages qt)
45 #:use-module (gnu packages java)
46 #:use-module (gnu packages sqlite)
47 #:use-module (gnu packages telephony)
48 #:use-module (gnu packages tls)
49 #:use-module (gnu packages video)
50 #:use-module (gnu packages xiph)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages xorg)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix download)
56 #:use-module (guix git-download)
57 #:use-module (guix build-system cmake)
58 #:use-module (guix build-system qt)
59 #:use-module (guix build-system glib-or-gtk)
60 #:use-module (guix build-system gnu))
61
62 (define-public bcunit
63 (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae")
64 (revision "0"))
65 (package
66 (name "bcunit")
67 (version (git-version "3.0.2" revision commit))
68 (source
69 (origin
70 (method git-fetch)
71 (uri (git-reference
72 (url "git://git.linphone.org/bcunit")
73 (commit commit)))
74 (file-name (git-file-name name version))
75 (sha256
76 (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b"))))
77 (build-system cmake-build-system)
78 (outputs '("out" "doc"))
79 (arguments
80 `(#:configure-flags (list "-DENABLE_STATIC=NO"
81 "-DENABLE_CURSES=ON"
82 "-DENABLE_DOC=ON"
83 "-DENABLE_EXAMPLES=ON"
84 "-DENABLE_TEST=ON"
85 "-DENABLE_MEMTRACE=ON")
86 #:phases
87 (modify-phases %standard-phases
88 (add-after 'unpack 'patch-source
89 (lambda _
90 ;; Include BCunit headers for examples.
91 (substitute* "Examples/CMakeLists.txt"
92 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}")
93 (string-append "${CMAKE_CURRENT_SOURCE_DIR} "
94 "${PROJECT_SOURCE_DIR}/BCUnit/Headers "
95 "${CMAKE_BINARY_DIR}/BCUnit/Headers")))
96 ;; Link bcunit and bcunit_tests libraries.
97 (substitute* "BCUnit/Sources/CMakeLists.txt"
98 (("target_include_directories\\(bcunit_test PUBLIC Test\\)")
99 (string-append
100 "target_include_directories(bcunit_test PUBLIC Test)\n"
101 "target_link_libraries(bcunit_test bcunit)")))))
102 (replace 'check
103 (lambda _
104 (with-directory-excursion "BCUnit/Sources/Test"
105 (invoke "./test_bcunit"))))
106 (add-after 'install 'move-doc
107 (lambda* (#:key outputs #:allow-other-keys)
108 (let ((out (assoc-ref outputs "out"))
109 (doc (assoc-ref outputs "doc")))
110 (for-each mkdir-p
111 `(,(string-append doc "/share/doc")
112 ,(string-append doc "/share/BCUnit")))
113 (rename-file
114 (string-append out "/share/doc/BCUnit")
115 (string-append doc "/share/doc/BCUnit"))
116 (rename-file
117 (string-append out "/share/BCUnit/Examples")
118 (string-append doc "/share/BCUnit/Examples"))))))))
119 (inputs
120 `(("ncurses" ,ncurses)))
121 (synopsis "Belledonne Communications Unit Testing Framework")
122 (description "BCUnit is a fork of the defunct project CUnit, with
123 several fixes and patches applied. It is a unit testing framework for
124 writing, administering, and running unit tests in C.")
125 (home-page "https://gitlab.linphone.org/BC/public/bcunit")
126 (license license:lgpl2.0+))))
127
128 (define-public bctoolbox
129 (package
130 (name "bctoolbox")
131 (version "4.4.34")
132 (source
133 (origin
134 (method git-fetch)
135 (uri (git-reference
136 (url "https://gitlab.linphone.org/BC/public/bctoolbox.git")
137 (commit version)))
138 (file-name (git-file-name name version))
139 (sha256
140 (base32 "0bfswwvvdshaahg4jd2j10f0sci8809s4khajd0m6b059zwc7y25"))))
141 (build-system cmake-build-system)
142 (outputs '("out" "debug"))
143 (arguments
144 `(#:configure-flags '("-DENABLE_STATIC=OFF")
145 #:phases
146 (modify-phases %standard-phases
147 (add-after 'unpack 'patch-cmake
148 (lambda* (#:key inputs #:allow-other-keys)
149 ;; Fix decaf dependency (see:
150 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3).
151 (let* ((decaf (assoc-ref inputs "decaf")))
152 (substitute* (find-files "." "CMakeLists.txt")
153 (("find_package\\(Decaf CONFIG\\)")
154 "set(DECAF_FOUND 1)")
155 (("\\$\\{DECAF_INCLUDE_DIRS\\}")
156 (string-append decaf "/include/decaf"))
157 (("\\$\\{DECAF_TARGETNAME\\}")
158 "decaf")))))
159 (add-after 'unpack 'skip-problematic-tests
160 (lambda _
161 ;; The following test relies on networking; disable it.
162 (substitute* "tester/port.c"
163 (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\)")
164 ""))))
165 (add-after 'unpack 'fix-installed-resource-directory-detection
166 (lambda _
167 ;; There's some broken logic in tester.c that checks if CWD, or
168 ;; if its parent exist, and if so, sets the prefix where the test
169 ;; resources are looked up to; disable it (see:
170 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4).
171 (substitute* "src/tester.c"
172 (("if \\(file_exists\\(\".\"\\)\\)")
173 "if (NULL)")
174 (("if \\(file_exists\\(\"..\"\\)\\)")
175 "if (NULL)"))))
176 (replace 'check
177 (lambda _
178 (with-directory-excursion "tester"
179 (invoke "./bctoolbox_tester")))))))
180 (inputs
181 `(("bcunit" ,bcunit)
182 ("decaf" ,libdecaf)
183 ("mbedtls" ,mbedtls-apache)))
184 (synopsis "Belledonne Communications Tool Box")
185 (description "BcToolBox is an utilities library used by Belledonne
186 Communications software like belle-sip, mediastreamer2 and linphone.")
187 (home-page "https://gitlab.linphone.org/BC/public/bctoolbox")
188 (license license:gpl3+)))
189
190 (define-public belr
191 (package
192 (name "belr")
193 (version "4.4.34")
194 (source
195 (origin
196 (method git-fetch)
197 (uri (git-reference
198 (url "https://gitlab.linphone.org/BC/public/belr.git")
199 (commit version)))
200 (file-name (git-file-name name version))
201 (sha256
202 (base32 "0w2canwwm0qb99whnangvaybvjzq8xg6vksqxykgr8fbx7clw03h"))))
203 (build-system cmake-build-system)
204 (outputs '("out" "debug" "tester"))
205 (arguments
206 `(#:configure-flags '("-DENABLE_STATIC=OFF")
207 #:phases
208 (modify-phases %standard-phases
209 (delete 'check) ;moved after the install phase
210 (add-after 'install 'check
211 (lambda* (#:key outputs #:allow-other-keys)
212 (let* ((tester (assoc-ref outputs "tester"))
213 (belr_tester (string-append tester "/bin/belr_tester"))
214 (tester-share (string-append tester "/share/belr_tester")))
215 (invoke belr_tester))))
216 (add-after 'install 'move-tester
217 (lambda* (#:key outputs #:allow-other-keys)
218 (let* ((out (assoc-ref outputs "out"))
219 (tester (assoc-ref outputs "tester")))
220 (for-each mkdir-p
221 (list (string-append tester "/bin")
222 (string-append tester "/share")))
223 (rename-file
224 (string-append out "/bin/belr_tester")
225 (string-append tester "/bin/belr_tester"))
226 (rename-file
227 (string-append out "/share/belr-tester")
228 ;; The detect_res_prefix procedure in bctoolbox's tester.c
229 ;; resolves the resource path based on the executable path and
230 ;; name, so have it match.
231 (string-append tester "/share/belr_tester"))))))))
232 (inputs
233 `(("bctoolbox" ,bctoolbox)))
234 (synopsis "Belledonne Communications Language Recognition Library")
235 (description "Belr is Belledonne Communications' language recognition
236 library, written in C++11. It parses text inputs formatted according to a
237 language defined by an ABNF grammar, such as the protocols standardized at
238 IETF.")
239 (home-page "https://gitlab.linphone.org/BC/public/belr")
240 (license license:gpl3+)))
241
242 (define-public belcard
243 (package
244 (name "belcard")
245 (version "4.4.34")
246 (source
247 (origin
248 (method git-fetch)
249 (uri (git-reference
250 (url "https://gitlab.linphone.org/BC/public/belcard.git")
251 (commit version)))
252 (file-name (git-file-name name version))
253 (sha256
254 (base32 "16x2xp8d0a115132zhy1kpxkyj86ia7vrsnpjdg78fnbvmvysc8m"))))
255 (build-system cmake-build-system)
256 (outputs '("out" "debug" "tester"))
257 (arguments
258 `(#:tests? #t
259 #:configure-flags '("-DENABLE_STATIC=OFF")
260 #:phases
261 (modify-phases %standard-phases
262 (add-after 'unpack 'patch-vcard-grammar-location
263 (lambda* (#:key outputs #:allow-other-keys)
264 (let* ((out (assoc-ref outputs "out"))
265 (vcard-grammar
266 (string-append out "/share/belr/grammars/vcard_grammar")))
267 (substitute* "include/belcard/vcard_grammar.hpp"
268 (("define VCARD_GRAMMAR \"vcard_grammar\"")
269 (format #f "define VCARD_GRAMMAR ~s" vcard-grammar))))))
270 (add-after 'install 'install-tester
271 (lambda* (#:key inputs outputs #:allow-other-keys)
272 (let ((out (assoc-ref outputs "out"))
273 (tester (assoc-ref outputs "tester"))
274 (test-name (string-append ,name "_tester")))
275 (for-each mkdir-p
276 (list (string-append tester "/bin")
277 (string-append tester "/share")))
278 (rename-file (string-append out "/bin/" test-name)
279 (string-append tester "/bin/" test-name))
280 (rename-file (string-append out "/share/" test-name)
281 (string-append tester "/share/" test-name)))))
282 (delete 'check)
283 (add-after 'install-tester 'check
284 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
285 (when tests?
286 (let* ((tester (assoc-ref outputs "tester"))
287 (belcard_tester (string-append tester
288 "/bin/belcard_tester")))
289 (invoke belcard_tester))))))))
290 (inputs
291 `(("bctoolbox" ,bctoolbox)
292 ("belr" ,belr)))
293 (synopsis "Belledonne Communications VCard Library")
294 (description "Belcard is a C++ library to manipulate VCard standard
295 format.")
296 (home-page "https://gitlab.linphone.org/BC/public/belcard")
297 (license license:gpl3+)))
298
299 (define-public bcmatroska2
300 (package
301 (name "bcmatroska2")
302 (version "0.23")
303 (source
304 (origin
305 (method git-fetch)
306 (uri (git-reference
307 (url "https://gitlab.linphone.org/BC/public/bcmatroska2.git")
308 (commit version)))
309 (file-name (git-file-name name version))
310 (sha256
311 (base32 "1avl9w18kh4dxm3g8j0bkw39bksd7bz3nfxvyibqqnz63ds8vfi2"))))
312 (build-system cmake-build-system)
313 (arguments
314 `(#:tests? #f ; No test target
315 #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required
316 (synopsis "Belledonne Communications Media Container")
317 (description "BcMatroska is a free and open standard multi-media container
318 format. It can hold an unlimited number of video, audio, picture, or subtitle
319 tracks in one file. This project provides a convenient distribution of the
320 Matroska multimedia container format.")
321 (home-page "https://gitlab.linphone.org/BC/public/bcmatroska2")
322 (license (list license:gpl2+ ;for this package (build system files)
323 license:bsd-4 ;for Core C and LibEBML2
324 license:lgpl2.1+)))) ;for LibMatroska2
325
326 (define-public bcg729
327 (package
328 (name "bcg729")
329 (version "1.1.1")
330 (source
331 (origin
332 (method git-fetch)
333 (uri (git-reference
334 (url "git://git.linphone.org/bcg729")
335 (commit version)))
336 (file-name (git-file-name name version))
337 (sha256
338 (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739"))))
339 (build-system cmake-build-system)
340 (arguments
341 `(#:configure-flags (list "-DENABLE_STATIC=NO"
342 "-DENABLE_TESTS=YES")
343 #:phases
344 (modify-phases %standard-phases
345 (add-before 'check 'copy-inputs
346 (lambda* (#:key inputs #:allow-other-keys)
347 (let ((test-patterns (assoc-ref inputs "test-patterns"))
348 (dest (string-append "test/bcg729-patterns.zip")))
349 (copy-recursively test-patterns dest))))
350 (replace 'check
351 (lambda _
352 (with-directory-excursion "test"
353 (invoke "unzip" "bcg729-patterns.zip")
354 (for-each
355 (lambda (test-name)
356 (invoke "./testCampaign" "-s" test-name))
357 (list "fixedCodebookSearch"
358 "postProcessing"
359 "adaptativeCodebookSearch"
360 "computeLP"
361 "computeAdaptativeCodebookGain"
362 "postFilter"
363 "decoder"
364 "LPSynthesisFilter"
365 "decodeLSP"
366 ;; "encoder"
367 ;; "LSPQuantization"
368 "preProcessing"
369 "decodeFixedCodeVector"
370 "CNGdecoder"
371 ;; "LP2LSPConversion"
372 "gainQuantization"
373 "findOpenLoopPitchDelay"
374 "decodeGains"
375 "computeWeightedSpeech"
376 "interpolateqLSPAndConvert2LP"
377 "decodeAdaptativeCodeVector"))))))))
378 (native-inputs
379 `(("perl" ,perl)
380 ("test-patterns"
381 ,(origin
382 (method url-fetch)
383 (uri (string-append "http://www.belledonne-communications.com/"
384 "bc-downloads/bcg729-patterns.zip"))
385 (sha256
386 (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh"))))
387 ("unzip" ,unzip)))
388 (synopsis "Belledonne Communications G729 Codec")
389 (description "BcG729 is an implementation of both encoder and decoder of
390 the ITU G729 speech codec. The library written in C 99 is fully portable and
391 can be executed on many platforms including both ARM and x86 processors. It
392 supports concurrent channels encoding and decoding for multi call application
393 such as conferencing.")
394 (home-page "https://linphone.org/technical-corner/bcg729")
395 (license license:gpl3+)))
396
397 (define-public ortp
398 (package
399 (name "ortp")
400 (version "4.4.34")
401 (source
402 (origin
403 (method git-fetch)
404 (uri (git-reference
405 (url "https://gitlab.linphone.org/BC/public/ortp.git")
406 (commit version)))
407 (file-name (git-file-name name version))
408 (sha256
409 (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
410 (build-system cmake-build-system)
411 (outputs '("out""tester"
412 "doc")) ;1.5 MiB of HTML doc
413 (arguments
414 `(#:tests? #f ;requires networking
415 #:configure-flags (list "-DENABLE_STATIC=NO"
416 "-DENABLE_TESTS=YES")
417 #:phases
418 (modify-phases %standard-phases
419 (add-after 'unpack 'fix-version-strings
420 (lambda _
421 (substitute* "CMakeLists.txt"
422 (("VERSION 4.4.0")
423 (string-append "VERSION " ,version))
424 (("\\$\\{ORTP_DOC_VERSION\\}")
425 ,version))))
426 (add-after 'install 'separate-outputs
427 (lambda* (#:key outputs #:allow-other-keys)
428 (let* ((out (assoc-ref outputs "out"))
429 (doc (assoc-ref outputs "doc"))
430 (doc-src (string-append out "/share/doc/ortp-" ,version))
431 (doc-dest (string-append doc "/share/doc/ortp-" ,version))
432 (tester (assoc-ref outputs "tester")))
433 (for-each mkdir-p (list (string-append doc "/share/doc")
434 (string-append tester "/bin")))
435 (rename-file doc-src doc-dest)
436 (rename-file (string-append out "/bin")
437 (string-append tester "/bin"))))))))
438 (native-inputs
439 `(("dot" ,graphviz)
440 ("doxygen" ,doxygen)))
441 (inputs
442 `(("bctoolbox" ,bctoolbox)))
443 (synopsis "Belledonne Communications RTP Library")
444 (description "oRTP is a C library implementing the RTP protocol. It
445 implements the RFC 3550 standard.")
446 (home-page "https://linphone.org/technical-corner/ortp")
447 (license license:gpl3+)))
448
449 (define-public bzrtp
450 (package
451 (name "bzrtp")
452 (version "4.4.34")
453 (source
454 (origin
455 (method git-fetch)
456 (uri (git-reference
457 (url "https://gitlab.linphone.org/BC/public/bzrtp")
458 (commit version)))
459 (file-name (git-file-name name version))
460 (sha256
461 (base32 "1yjmsbqmymzl4r7sba6w4a2yld8m6hzafr6jf7sj0syhwpnc3zv6"))))
462 (build-system cmake-build-system)
463 (arguments
464 `(#:configure-flags
465 (list
466 "-DENABLE_STATIC=NO"
467 "-DENABLE_TESTS=YES")))
468 (inputs
469 `(("bctoolbox" ,bctoolbox)
470 ("sqlite3" ,sqlite)
471 ("xml2" ,libxml2)))
472 (synopsis "Belledonne Communications ZRTP Library")
473 (description "BZRTP is an implementation of ZRTP keys exchange protocol,
474 written in C. It is fully portable and can be executed on many platforms
475 including both ARM and x86.")
476 (home-page "https://gitlab.linphone.org/BC/public/bzrtp")
477 (license license:gpl3+)))
478
479 (define-public belle-sip
480 (package
481 (name "belle-sip")
482 (version "1.6.3")
483 (source
484 (origin
485 (method url-fetch)
486 (uri
487 (string-append "https://www.linphone.org/releases/sources/" name
488 "/" name "-" version ".tar.gz"))
489 (sha256
490 (base32 "0s55kggmgxap54dkw5856bgk4xg7yvbzialpxnjm0zhpic3hff1z"))))
491 (build-system cmake-build-system)
492 (arguments
493 `(#:tests? #f ; Requires network access
494 #:configure-flags
495 (list "-DENABLE_STATIC=NO") ; Not required
496 #:phases
497 (modify-phases %standard-phases
498 (add-after 'unpack 'patch
499 (lambda _
500 (substitute* "src/CMakeLists.txt"
501 ;; ANTLR would use multithreaded DFA generation otherwise,
502 ;; which would not be reproducible.
503 (("-Xmultithreaded ") ""))
504 #t)))))
505 (inputs
506 `(("antlr3" ,antlr3-3.3)
507 ("antlr3c" ,libantlr3c)
508 ("bctoolbox" ,bctoolbox)
509 ("java" ,icedtea)
510 ("zlib" ,zlib)))
511 (synopsis "Belledonne Communications SIP Library")
512 (description "Belle-sip is a modern library implementing SIP transport,
513 transaction and dialog layers. It is written in C, with an object-oriented
514 API. It also comprises a simple HTTP/HTTPS client implementation.")
515 (home-page "https://gitlab.linphone.org/BC/public/belle-sip")
516 (license license:gpl2+)))
517
518 (define-public mediastreamer2
519 (package
520 (name "mediastreamer2")
521 (version "2.16.1")
522 (source
523 (origin
524 (method url-fetch)
525 (uri
526 (string-append "https://www.linphone.org/releases/sources/"
527 "mediastreamer/mediastreamer-" version ".tar.gz"))
528 (sha256
529 (base32 "0whpqr69wz0pnzvragkpfblxhd0rds8k06c3mw5a0ag216a1yd9k"))
530 (patches (search-patches "mediastreamer2-srtp2.patch"))))
531 (outputs '("out" "doc" "tester"))
532 (build-system cmake-build-system)
533 (arguments
534 `(#:tests? #f ; No test target
535 #:configure-flags
536 (list "-DENABLE_STATIC=NO" ; Not required
537 "-DENABLE_STRICT=NO" ; Would otherwise treat warnings as err
538 "-DENABLE_BV16=NO" ; Not available
539 "-DCMAKE_C_FLAGS=-DMS2_GIT_VERSION=\\\"unknown\\\""
540 "-DCMAKE_CXX_FLAGS=-DMS2_GIT_VERSION=\\\"unknown\\\"")
541 #:phases
542 (modify-phases %standard-phases
543 (add-after 'install 'separate-outputs
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let* ((out (assoc-ref outputs "out"))
546 (doc (assoc-ref outputs "doc"))
547 (tester (assoc-ref outputs "tester"))
548 (tester-name (string-append ,name "_tester")))
549 ;; Copy the tester executable.
550 (mkdir-p (string-append tester "/bin"))
551 (rename-file (string-append out "/bin/" tester-name)
552 (string-append tester "/bin/" tester-name))
553 ;; Copy the tester data files.
554 (copy-recursively (string-append out "/share/" tester-name)
555 (string-append tester "/share/" tester-name))
556 (delete-file-recursively (string-append out "/share/"
557 tester-name))
558 ;; Copy the HTML documentation.
559 (copy-recursively (string-append out "/share/doc/"
560 ,name "-" ,version "/html")
561 (string-append doc "/share/doc/"
562 ,name "-" ,version "/html"))
563 (delete-file-recursively (string-append out "/share/doc/"
564 ,name "-" ,version
565 "/html"))
566 #t))))))
567 (native-inputs
568 `(("dot" ,graphviz)
569 ("doxygen" ,doxygen)
570 ("python" ,python)))
571 (inputs
572 `(("alsa" ,alsa-lib)
573 ("bcg729" ,bcg729)
574 ("bcmatroska2" ,bcmatroska2)
575 ("bctoolbox" ,bctoolbox)
576 ("ffmpeg" ,ffmpeg)
577 ("glew" ,glew)
578 ("glu" ,glu)
579 ("glx" ,mesa-utils)
580 ("gsm" ,gsm)
581 ("opengl" ,mesa)
582 ("opus" ,opus)
583 ("ortp" ,ortp)
584 ("pcap" ,libpcap)
585 ("portaudio" ,portaudio)
586 ("pulseaudio" ,pulseaudio)
587 ("spandsp" ,spandsp)
588 ("speex" ,speex)
589 ("speexdsp" ,speexdsp)
590 ("srtp" ,libsrtp)
591 ("theora" ,libtheora)
592 ("turbojpeg" ,libjpeg-turbo)
593 ("v4l" ,v4l-utils)
594 ("vpx" ,libvpx)
595 ("x11" ,libx11)
596 ("xv" ,libxv)
597 ("zrtp" ,bzrtp)))
598 (synopsis "Belledonne Communications Streaming Engine")
599 (description "Mediastreamer2 is a powerful and lightweight streaming engine
600 for telephony applications. This media processing and streaming toolkit is
601 responsible for receiving and sending all multimedia streams in Linphone,
602 including media capture, encoding and decoding, and rendering.")
603 (home-page "https://gitlab.linphone.org/BC/public/mediastreamer2")
604 (license license:gpl2+)))
605
606 (define-public liblinphone
607 (package
608 (name "liblinphone")
609 (version "3.12.0")
610 (source
611 (origin
612 (method url-fetch)
613 (uri
614 (string-append "https://www.linphone.org/releases/sources/linphone"
615 "/linphone-" version ".tar.gz"))
616 (sha256
617 (base32 "0phhkx55xdyg28d4wn8l8q4yvsmdgzmjiw584d4s190sq1azm91x"))))
618 (outputs '("out" "doc" "tester"))
619 (build-system cmake-build-system)
620 (arguments
621 `(#:tests? #f ; No test target
622 #:configure-flags
623 (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
624 (string-append (assoc-ref %build-inputs "gtk2")
625 "/lib/gtk-2.0/include"))
626 (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
627 (string-append (assoc-ref %build-inputs "glib")
628 "/lib/glib-2.0/include"))
629 "-DENABLE_STATIC=NO" ; Not required
630 "-DENABLE_STRICT=NO"
631 "-DENABLE_GTK_UI=YES") ; for legacy UI
632 #:imported-modules (,@%cmake-build-system-modules
633 (guix build glib-or-gtk-build-system))
634 #:modules ((guix build cmake-build-system)
635 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
636 (guix build utils))
637 #:phases
638 (modify-phases %standard-phases
639 (add-after 'unpack 'patch
640 (lambda _
641 (substitute* "gtk/main.c"
642 (("#include \"liblinphone_gitversion.h\"")
643 ""))
644 #t))
645 (add-after 'install 'separate-outputs
646 (lambda* (#:key outputs #:allow-other-keys)
647 (let* ((out (assoc-ref outputs "out"))
648 (doc (assoc-ref outputs "doc"))
649 (tester (assoc-ref outputs "tester"))
650 (tester-name (string-append ,name "_tester")))
651 ;; Copy the tester executable.
652 (mkdir-p (string-append tester "/bin"))
653 (rename-file (string-append out "/bin/" tester-name)
654 (string-append tester "/bin/" tester-name))
655 ;; Copy the tester data files.
656 (mkdir-p (string-append tester "/share/"))
657 (rename-file (string-append out "/share/" tester-name)
658 (string-append tester "/share/" tester-name))
659 ;; Copy the HTML and XML documentation.
660 (copy-recursively
661 (string-append out "/share/doc/linphone-" ,version)
662 (string-append doc "/share/doc/" ,name "-" ,version))
663 (delete-file-recursively
664 (string-append out "/share/doc/linphone-" ,version))
665 #t)))
666 (add-after 'install 'install-man-pages
667 (lambda* (#:key outputs #:allow-other-keys)
668 (let* ((out (assoc-ref outputs "out"))
669 (man (string-append out "/share/man/man1")))
670 (for-each (lambda (file)
671 (install-file file man))
672 (find-files ".." ".*.1$"))
673 #t)))
674 (add-after 'separate-outputs 'glib-or-gtk-compile-schemas
675 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
676 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
677 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
678 (native-inputs
679 `(("gettext" ,gettext-minimal)
680 ("udev" ,eudev) ;for libudev.h
681 ;; For generating the C++ wrappers.
682 ("dot" ,graphviz)
683 ("doxygen" ,doxygen)
684 ("python" ,python)
685 ("pystache" ,python-pystache)
686 ("six" ,python-six)))
687 (inputs
688 `(("bctoolbox" ,bctoolbox)
689 ("belcard" ,belcard)
690 ("bellesip" ,belle-sip)
691 ("bzrtp" ,bzrtp)
692 ("iconv" ,libiconv)
693 ("glib" ,glib)
694 ("gtk2" ,gtk+-2)
695 ("mediastreamer2" ,mediastreamer2)
696 ("notify" ,libnotify)
697 ("ortp" ,ortp)
698 ("sqlite" ,sqlite)
699 ("xml2" ,libxml2)
700 ("zlib" ,zlib)))
701 (synopsis "Belledonne Communications Softphone Library")
702 (description "Liblinphone is a high-level SIP library integrating
703 all calling and instant messaging features into an unified
704 easy-to-use API. It is the cross-platform VoIP library on which the
705 Linphone application is based on, and that anyone can use to add audio
706 and video calls or instant messaging capabilities to an application.")
707 (home-page "https://gitlab.linphone.org/BC/public/liblinphone")
708 (license license:gpl2+)))
709
710 (define-public linphoneqt
711 (package
712 (name "linphoneqt")
713 (version "4.1.1")
714 (source
715 (origin
716 (method url-fetch)
717 (uri
718 (string-append "https://www.linphone.org/releases/sources/" name
719 "/" name "-" version ".tar.gz"))
720 (sha256
721 (base32 "1g2zrr9li0g1hgs6vys06vr98h5dx36z22hx7a6ry231536c002a"))
722 (patches (search-patches "linphoneqt-tabbutton.patch"))))
723 (build-system qt-build-system)
724 (arguments
725 `(#:tests? #f ; No test target
726 #:phases
727 (modify-phases %standard-phases
728 (add-after 'unpack 'fix-cmake-error
729 (lambda _
730 ;; This is fixed in commit efed2fd8 of the master branch.
731 (substitute* "CMakeLists.txt"
732 (("js)\\$\"")
733 "js$\""))
734 #t))
735 (add-after 'unpack 'set-version-string
736 (lambda _
737 (substitute* "src/app/AppController.cpp"
738 (("LINPHONE_QT_GIT_VERSION")
739 (format #f "~s" ,version)))
740 #t))
741 (add-after 'install 'extend-shared-resources
742 ;; Not using the FHS exposes an issue where the client refers to
743 ;; its own "share" directory, which lacks sound files installed by
744 ;; liblinphone.
745 (lambda* (#:key inputs outputs #:allow-other-keys)
746 (let ((liblinphone (assoc-ref inputs "linphone"))
747 (out (assoc-ref outputs "out")))
748 (symlink (string-append liblinphone "/share/sounds")
749 (string-append out "/share/sounds"))
750 #t))))))
751 (native-inputs
752 `(("qttools" ,qttools)))
753 (inputs
754 `(("bctoolbox" ,bctoolbox)
755 ("belcard" ,belcard)
756 ("bellesip" ,belle-sip)
757 ("linphone" ,liblinphone)
758 ("mediastreamer2" ,mediastreamer2)
759 ("qtbase" ,qtbase)
760 ("qtdeclarative" ,qtdeclarative)
761 ("qtgraphicaleffects" ,qtgraphicaleffects)
762 ("qtquickcontrols" ,qtquickcontrols)
763 ("qtquickcontrols2" ,qtquickcontrols2)
764 ("qtsvg" ,qtsvg)))
765 (synopsis "Desktop client for the Linphone SIP softphone")
766 (description "Linphone is a SIP softphone for voice and video over IP calling
767 (VoIP) and instant messaging. Amongst its features are:
768 @itemize
769 @item High Definition (HD) audio and video calls
770 @item Multiple call management (pause and resume)
771 @item Call transfer
772 @item Audio conferencing (merge calls into a conference call)
773 @item Call recording and replay (audio only)
774 @item Instant Messaging with message delivery status (IMDN)
775 @item Picture and file sharing
776 @item Echo cancellation
777 @item Secure user authentication using TLS client certificates
778 @item SRTP, zRTP and SRTP-DTLS voice and video encryption
779 @item Telephone tone (DTMF) support using SIP INFO or RFC 4733
780 @item Audio codecs: opus, speex, g711, g729, gsm, iLBC, g722, SILK, etc.
781 @item Video codecs: VP8, H.264 and H.265 with resolutions up to 1080P, MPEG4
782 @end itemize")
783 (home-page "https://gitlab.linphone.org/BC/public/linphone-desktop")
784 (license license:gpl2+)))
785
786 (define-public msopenh264
787 (package
788 (name "msopenh264")
789 (version "1.2.1")
790 (source
791 (origin
792 (method url-fetch)
793 (uri
794 (string-append "https://www.linphone.org/releases/sources/plugins/"
795 name "/" name "-" version ".tar.gz"))
796 (sha256
797 (base32 "0rdxgazm52560g52pp6mp3mwx6j1z3h2zyizzfycp8y8zi92fqm8"))
798 (patches
799 (list
800 ;; For support for OpenH264 version >= 2.
801 (origin
802 (method url-fetch)
803 (uri
804 (string-append "https://gitlab.linphone.org/BC/public/msopenh264/"
805 "commit/493d147d28c9a0f788ba4e50b47a1ce7b18bf326"
806 ".diff"))
807 (file-name "msopenh264-openh264.patch")
808 (sha256
809 (base32
810 "0mmd7nz5n9ian4rcwn200nldmy5j0dpdrna7r32rqnaw82bx3kdb")))))))
811 (build-system cmake-build-system)
812 (arguments
813 `(#:tests? #f ; No test target
814 #:configure-flags
815 (list "-DENABLE_STATIC=NO"))) ; Not required
816 (inputs
817 `(("mediastreamer2" ,mediastreamer2)
818 ("openh264" ,openh264)
819 ("ortp" ,ortp)))
820 (synopsis "Media Streamer H.264 Codec")
821 (description "MsOpenH264 is an H.264 encoder/decoder plugin for
822 mediastreamer2 based on the openh264 library.")
823 (home-page "https://gitlab.linphone.org/BC/public/msopenh264")
824 (license license:gpl2+)))
825
826 (define-public mssilk
827 (package
828 (name "mssilk")
829 (version "1.1.1")
830 (source
831 (origin
832 (method url-fetch)
833 (uri
834 (string-append "https://www.linphone.org/releases/sources/plugins/"
835 name "/" name "-" version ".tar.gz"))
836 (sha256
837 (base32 "07ip0vd29d1n98lnqs5wpimcsmpm65yl7g5vk4hbqghcbsjw94lj"))))
838 (build-system cmake-build-system)
839 (arguments
840 `(#:tests? #f ; No test target
841 #:configure-flags
842 (list "-DENABLE_STATIC=NO"))) ; Not required
843 (inputs
844 `(("mediastreamer2" ,mediastreamer2)
845 ("ortp" ,ortp)))
846 (synopsis "Media Streamer SILK Codec")
847 (description "MSSILK is a plugin of MediaStreamer, adding support for AMR
848 codec. It is based on the Skype's SILK implementation.")
849 (home-page "https://gitlab.linphone.org/BC/public/mssilk")
850 (license license:gpl2+)))
851
852 (define-public mswebrtc
853 (package
854 (name "mswebrtc")
855 (version "1.1.1")
856 (source
857 (origin
858 (method url-fetch)
859 (uri
860 (string-append "https://www.linphone.org/releases/sources/plugins/"
861 name "/" name "-" version ".tar.gz"))
862 (sha256
863 (base32 "1wj28hl9myhshqmn64xg0jf07aw75gmnilb5rff6rcbdxim87mqr"))))
864 (build-system cmake-build-system)
865 (arguments
866 `(#:tests? #f ; No test target
867 #:configure-flags
868 (list
869 "-DENABLE_STATIC=NO"))) ; Not required
870 (inputs
871 `(("bctoolbox" ,bctoolbox)
872 ("mediastreamer2" ,mediastreamer2)
873 ("ortp" ,ortp)))
874 (synopsis "Media Streamer WebRTC Codec")
875 (description "MSWebRTC is a plugin of MediaStreamer, adding support for
876 WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.")
877 (home-page "https://gitlab.linphone.org/BC/public/mswebrtc")
878 (license license:gpl2+)))
879
880 (define-public msamr
881 (package
882 (name "msamr")
883 (version "1.1.3")
884 (source
885 (origin
886 (method url-fetch)
887 (uri
888 (string-append "https://www.linphone.org/releases/sources/plugins/"
889 name "/" name "-" version ".tar.gz"))
890 (sha256
891 (base32 "16c9f3z4wnj73k7y8gb0fgpr4axsm7b5zrbjvy8vsgz9gyg3agm5"))))
892 (build-system cmake-build-system)
893 (arguments
894 `(#:tests? #f ; No test target
895 #:configure-flags
896 (list "-DENABLE_STATIC=NO" ; Not required
897 "-DENABLE_WIDEBAND=YES")))
898 (inputs
899 `(("mediastreamer2" ,mediastreamer2)
900 ("opencoreamr" ,opencore-amr)
901 ("ortp" ,ortp)
902 ("voamrwbenc" ,vo-amrwbenc)))
903 (synopsis "Media Streamer AMR Codec")
904 (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
905 codec. It is based on the opencore-amr implementation.")
906 (home-page "https://gitlab.linphone.org/BC/public/msamr")
907 (license license:gpl3+)))