gnu: python-deepmerge: Use pyproject-build-system.
[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 avahi)
27 #:use-module (gnu packages cpp)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages crypto)
30 #:use-module (gnu packages databases)
31 #:use-module (gnu packages documentation)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages gl)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages gnome)
36 #:use-module (gnu packages gnome-xyz)
37 #:use-module (gnu packages graphviz)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages linux)
41 #:use-module (gnu packages ncurses)
42 #:use-module (gnu packages openldap)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages pulseaudio)
46 #:use-module (gnu packages python)
47 #:use-module (gnu packages python-xyz)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages java)
50 #:use-module (gnu packages sqlite)
51 #:use-module (gnu packages telephony)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages video)
54 #:use-module (gnu packages xiph)
55 #:use-module (gnu packages xml)
56 #:use-module (gnu packages xorg)
57 #:use-module ((guix licenses) #:prefix license:)
58 #:use-module (guix packages)
59 #:use-module (guix download)
60 #:use-module (guix git-download)
61 #:use-module (guix build-system cmake)
62 #:use-module (guix build-system qt)
63 #:use-module (guix build-system glib-or-gtk)
64 #:use-module (guix build-system gnu))
65
66 (define-public bcunit
67 (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae")
68 (revision "0"))
69 (package
70 (name "bcunit")
71 (version (git-version "3.0.2" revision commit))
72 (source
73 (origin
74 (method git-fetch)
75 (uri (git-reference
76 (url "git://git.linphone.org/bcunit")
77 (commit commit)))
78 (file-name (git-file-name name version))
79 (sha256
80 (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b"))))
81 (build-system cmake-build-system)
82 (outputs '("out" "doc"))
83 (arguments
84 `(#:configure-flags (list "-DENABLE_STATIC=NO"
85 "-DENABLE_CURSES=ON"
86 "-DENABLE_DOC=ON"
87 "-DENABLE_EXAMPLES=ON"
88 "-DENABLE_TEST=ON"
89 "-DENABLE_MEMTRACE=ON")
90 #:phases
91 (modify-phases %standard-phases
92 (add-after 'unpack 'patch-source
93 (lambda _
94 ;; Include BCunit headers for examples.
95 (substitute* "Examples/CMakeLists.txt"
96 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}")
97 (string-append "${CMAKE_CURRENT_SOURCE_DIR} "
98 "${PROJECT_SOURCE_DIR}/BCUnit/Headers "
99 "${CMAKE_BINARY_DIR}/BCUnit/Headers")))
100 ;; Link bcunit and bcunit_tests libraries.
101 (substitute* "BCUnit/Sources/CMakeLists.txt"
102 (("target_include_directories\\(bcunit_test PUBLIC Test\\)")
103 (string-append
104 "target_include_directories(bcunit_test PUBLIC Test)\n"
105 "target_link_libraries(bcunit_test bcunit)")))))
106 (replace 'check
107 (lambda _
108 (with-directory-excursion "BCUnit/Sources/Test"
109 (invoke "./test_bcunit"))))
110 (add-after 'install 'move-doc
111 (lambda* (#:key outputs #:allow-other-keys)
112 (let ((out (assoc-ref outputs "out"))
113 (doc (assoc-ref outputs "doc")))
114 (for-each mkdir-p
115 `(,(string-append doc "/share/doc")
116 ,(string-append doc "/share/BCUnit")))
117 (rename-file
118 (string-append out "/share/doc/BCUnit")
119 (string-append doc "/share/doc/BCUnit"))
120 (rename-file
121 (string-append out "/share/BCUnit/Examples")
122 (string-append doc "/share/BCUnit/Examples"))))))))
123 (inputs
124 (list ncurses))
125 (synopsis "Belledonne Communications Unit Testing Framework")
126 (description "BCUnit is a fork of the defunct project CUnit, with
127 several fixes and patches applied. It is a unit testing framework for
128 writing, administering, and running unit tests in C.")
129 (home-page "https://gitlab.linphone.org/BC/public/bcunit")
130 (license license:lgpl2.0+))))
131
132 (define-public bctoolbox
133 (package
134 (name "bctoolbox")
135 (version "4.4.34")
136 (source
137 (origin
138 (method git-fetch)
139 (uri (git-reference
140 (url "https://gitlab.linphone.org/BC/public/bctoolbox.git")
141 (commit version)))
142 (file-name (git-file-name name version))
143 (sha256
144 (base32 "0bfswwvvdshaahg4jd2j10f0sci8809s4khajd0m6b059zwc7y25"))))
145 (build-system cmake-build-system)
146 (outputs '("out" "debug"))
147 (arguments
148 `(#:configure-flags '("-DENABLE_STATIC=OFF")
149 #:phases
150 (modify-phases %standard-phases
151 (add-after 'unpack 'patch-cmake
152 (lambda* (#:key inputs #:allow-other-keys)
153 ;; Fix decaf dependency (see:
154 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3).
155 (let* ((decaf (assoc-ref inputs "decaf")))
156 (substitute* (find-files "." "CMakeLists.txt")
157 (("find_package\\(Decaf CONFIG\\)")
158 "set(DECAF_FOUND 1)")
159 (("\\$\\{DECAF_INCLUDE_DIRS\\}")
160 (string-append decaf "/include/decaf"))
161 (("\\$\\{DECAF_TARGETNAME\\}")
162 "decaf")))))
163 (add-after 'unpack 'skip-problematic-tests
164 (lambda _
165 ;; The following test relies on networking; disable it.
166 (substitute* "tester/port.c"
167 (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\)")
168 ""))))
169 (add-after 'unpack 'fix-installed-resource-directory-detection
170 (lambda _
171 ;; There's some broken logic in tester.c that checks if CWD, or
172 ;; if its parent exist, and if so, sets the prefix where the test
173 ;; resources are looked up to; disable it (see:
174 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4).
175 (substitute* "src/tester.c"
176 (("if \\(file_exists\\(\".\"\\)\\)")
177 "if (NULL)")
178 (("if \\(file_exists\\(\"..\"\\)\\)")
179 "if (NULL)"))))
180 (replace 'check
181 (lambda _
182 (with-directory-excursion "tester"
183 (invoke "./bctoolbox_tester")))))))
184 (inputs
185 `(("bcunit" ,bcunit)
186 ("decaf" ,libdecaf)
187 ("mbedtls" ,mbedtls-apache)))
188 (synopsis "Belledonne Communications Tool Box")
189 (description "BcToolBox is an utilities library used by Belledonne
190 Communications software like belle-sip, mediastreamer2 and linphone.")
191 (home-page "https://gitlab.linphone.org/BC/public/bctoolbox")
192 (license license:gpl3+)))
193
194 (define-public belr
195 (package
196 (name "belr")
197 (version "4.4.34")
198 (source
199 (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://gitlab.linphone.org/BC/public/belr.git")
203 (commit version)))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32 "0w2canwwm0qb99whnangvaybvjzq8xg6vksqxykgr8fbx7clw03h"))))
207 (build-system cmake-build-system)
208 (outputs '("out" "debug" "tester"))
209 (arguments
210 `(#:configure-flags '("-DENABLE_STATIC=OFF")
211 #:phases
212 (modify-phases %standard-phases
213 (delete 'check) ;moved after the install phase
214 (add-after 'install 'check
215 (lambda* (#:key outputs #:allow-other-keys)
216 (let* ((tester (assoc-ref outputs "tester"))
217 (belr_tester (string-append tester "/bin/belr_tester"))
218 (tester-share (string-append tester "/share/belr_tester")))
219 (invoke belr_tester))))
220 (add-after 'install 'move-tester
221 (lambda* (#:key outputs #:allow-other-keys)
222 (let* ((out (assoc-ref outputs "out"))
223 (tester (assoc-ref outputs "tester")))
224 (for-each mkdir-p
225 (list (string-append tester "/bin")
226 (string-append tester "/share")))
227 (rename-file
228 (string-append out "/bin/belr_tester")
229 (string-append tester "/bin/belr_tester"))
230 (rename-file
231 (string-append out "/share/belr-tester")
232 ;; The detect_res_prefix procedure in bctoolbox's tester.c
233 ;; resolves the resource path based on the executable path and
234 ;; name, so have it match.
235 (string-append tester "/share/belr_tester"))))))))
236 (inputs
237 (list bctoolbox))
238 (synopsis "Belledonne Communications Language Recognition Library")
239 (description "Belr is Belledonne Communications' language recognition
240 library, written in C++11. It parses text inputs formatted according to a
241 language defined by an ABNF grammar, such as the protocols standardized at
242 IETF.")
243 (home-page "https://gitlab.linphone.org/BC/public/belr")
244 (license license:gpl3+)))
245
246 (define-public belcard
247 (package
248 (name "belcard")
249 (version "4.4.34")
250 (source
251 (origin
252 (method git-fetch)
253 (uri (git-reference
254 (url "https://gitlab.linphone.org/BC/public/belcard.git")
255 (commit version)))
256 (file-name (git-file-name name version))
257 (sha256
258 (base32 "16x2xp8d0a115132zhy1kpxkyj86ia7vrsnpjdg78fnbvmvysc8m"))))
259 (build-system cmake-build-system)
260 (outputs '("out" "debug" "tester"))
261 (arguments
262 `(#:configure-flags '("-DENABLE_STATIC=OFF")
263 #:phases
264 (modify-phases %standard-phases
265 (add-after 'unpack 'patch-vcard-grammar-location
266 (lambda* (#:key outputs #:allow-other-keys)
267 (let* ((out (assoc-ref outputs "out"))
268 (vcard-grammar
269 (string-append out "/share/belr/grammars/vcard_grammar")))
270 (substitute* "include/belcard/vcard_grammar.hpp"
271 (("define VCARD_GRAMMAR \"vcard_grammar\"")
272 (format #f "define VCARD_GRAMMAR ~s" vcard-grammar))))))
273 (add-after 'install 'install-tester
274 (lambda* (#:key inputs outputs #:allow-other-keys)
275 (let ((out (assoc-ref outputs "out"))
276 (tester (assoc-ref outputs "tester"))
277 (test-name (string-append ,name "_tester")))
278 (for-each mkdir-p
279 (list (string-append tester "/bin")
280 (string-append tester "/share")))
281 (rename-file (string-append out "/bin/" test-name)
282 (string-append tester "/bin/" test-name))
283 (rename-file (string-append out "/share/" test-name)
284 (string-append tester "/share/" test-name)))))
285 (delete 'check)
286 (add-after 'install-tester 'check
287 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
288 (when tests?
289 (let* ((tester (assoc-ref outputs "tester"))
290 (belcard_tester (string-append tester
291 "/bin/belcard_tester")))
292 (invoke belcard_tester))))))))
293 (inputs
294 (list bctoolbox belr))
295 (synopsis "Belledonne Communications VCard Library")
296 (description "Belcard is a C++ library to manipulate VCard standard
297 format.")
298 (home-page "https://gitlab.linphone.org/BC/public/belcard")
299 (license license:gpl3+)))
300
301 (define-public bcmatroska2
302 (package
303 (name "bcmatroska2")
304 (version "0.23")
305 (source
306 (origin
307 (method git-fetch)
308 (uri (git-reference
309 (url "https://gitlab.linphone.org/BC/public/bcmatroska2.git")
310 (commit version)))
311 (file-name (git-file-name name version))
312 (sha256
313 (base32 "1avl9w18kh4dxm3g8j0bkw39bksd7bz3nfxvyibqqnz63ds8vfi2"))))
314 (build-system cmake-build-system)
315 (arguments
316 `(#:tests? #f ; No test target
317 #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required
318 (synopsis "Belledonne Communications Media Container")
319 (description "BcMatroska is a free and open standard multi-media container
320 format. It can hold an unlimited number of video, audio, picture, or subtitle
321 tracks in one file. This project provides a convenient distribution of the
322 Matroska multimedia container format.")
323 (home-page "https://gitlab.linphone.org/BC/public/bcmatroska2")
324 (license (list license:gpl2+ ;for this package (build system files)
325 license:bsd-4 ;for Core C and LibEBML2
326 license:lgpl2.1+)))) ;for LibMatroska2
327
328 (define-public bcg729
329 (package
330 (name "bcg729")
331 (version "1.1.1")
332 (source
333 (origin
334 (method git-fetch)
335 (uri (git-reference
336 (url "git://git.linphone.org/bcg729")
337 (commit version)))
338 (file-name (git-file-name name version))
339 (sha256
340 (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739"))))
341 (build-system cmake-build-system)
342 (arguments
343 `(#:configure-flags (list "-DENABLE_STATIC=NO"
344 "-DENABLE_TESTS=YES")
345 #:phases
346 (modify-phases %standard-phases
347 (add-before 'check 'copy-inputs
348 (lambda* (#:key inputs #:allow-other-keys)
349 (let ((test-patterns (assoc-ref inputs "test-patterns"))
350 (dest (string-append "test/bcg729-patterns.zip")))
351 (copy-recursively test-patterns dest))))
352 (replace 'check
353 (lambda _
354 (with-directory-excursion "test"
355 (invoke "unzip" "bcg729-patterns.zip")
356 (for-each
357 (lambda (test-name)
358 (invoke "./testCampaign" "-s" test-name))
359 (list "fixedCodebookSearch"
360 "postProcessing"
361 "adaptativeCodebookSearch"
362 "computeLP"
363 "computeAdaptativeCodebookGain"
364 "postFilter"
365 "decoder"
366 "LPSynthesisFilter"
367 "decodeLSP"
368 ;; "encoder"
369 ;; "LSPQuantization"
370 "preProcessing"
371 "decodeFixedCodeVector"
372 "CNGdecoder"
373 ;; "LP2LSPConversion"
374 "gainQuantization"
375 "findOpenLoopPitchDelay"
376 "decodeGains"
377 "computeWeightedSpeech"
378 "interpolateqLSPAndConvert2LP"
379 "decodeAdaptativeCodeVector"))))))))
380 (native-inputs
381 `(("perl" ,perl)
382 ("test-patterns"
383 ,(origin
384 (method url-fetch)
385 (uri (string-append "http://www.belledonne-communications.com/"
386 "bc-downloads/bcg729-patterns.zip"))
387 (sha256
388 (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh"))))
389 ("unzip" ,unzip)))
390 (synopsis "Belledonne Communications G729 Codec")
391 (description "BcG729 is an implementation of both encoder and decoder of
392 the ITU G729 speech codec. The library written in C 99 is fully portable and
393 can be executed on many platforms including both ARM and x86 processors. It
394 supports concurrent channels encoding and decoding for multi call application
395 such as conferencing.")
396 (home-page "https://linphone.org/technical-corner/bcg729")
397 (license license:gpl3+)))
398
399 (define-public ortp
400 (package
401 (name "ortp")
402 (version "4.4.34")
403 (source
404 (origin
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://gitlab.linphone.org/BC/public/ortp.git")
408 (commit version)))
409 (file-name (git-file-name name version))
410 (sha256
411 (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
412 (build-system cmake-build-system)
413 (outputs '("out""tester"
414 "doc")) ;1.5 MiB of HTML doc
415 (arguments
416 `(#:tests? #f ;requires networking
417 #:configure-flags (list "-DENABLE_STATIC=NO"
418 "-DENABLE_TESTS=YES")
419 #:phases
420 (modify-phases %standard-phases
421 (add-after 'unpack 'fix-version-strings
422 ;; See: https://gitlab.linphone.org/BC/public/ortp/-/issues/5.
423 (lambda _
424 (substitute* "CMakeLists.txt"
425 (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+")
426 (string-append "VERSION " ,version))
427 (("\\$\\{ORTP_DOC_VERSION\\}")
428 ,version))))
429 (add-after 'install 'separate-outputs
430 (lambda* (#:key outputs #:allow-other-keys)
431 (let* ((out (assoc-ref outputs "out"))
432 (doc (assoc-ref outputs "doc"))
433 (doc-src (string-append out "/share/doc/ortp-" ,version))
434 (doc-dest (string-append doc "/share/doc/ortp-" ,version))
435 (tester (assoc-ref outputs "tester")))
436 (for-each mkdir-p (list (string-append doc "/share/doc")
437 (string-append tester "/bin")))
438 (rename-file doc-src doc-dest)
439 (rename-file (string-append out "/bin")
440 (string-append tester "/bin"))))))))
441 (native-inputs
442 `(("dot" ,graphviz)
443 ("doxygen" ,doxygen)))
444 (inputs
445 (list bctoolbox))
446 (synopsis "Belledonne Communications RTP Library")
447 (description "oRTP is a C library implementing the RTP protocol. It
448 implements the RFC 3550 standard.")
449 (home-page "https://linphone.org/technical-corner/ortp")
450 (license license:gpl3+)))
451
452 (define-public bzrtp
453 (package
454 (name "bzrtp")
455 (version "4.4.34")
456 (source
457 (origin
458 (method git-fetch)
459 (uri (git-reference
460 (url "https://gitlab.linphone.org/BC/public/bzrtp")
461 (commit version)))
462 (file-name (git-file-name name version))
463 (sha256
464 (base32 "1yjmsbqmymzl4r7sba6w4a2yld8m6hzafr6jf7sj0syhwpnc3zv6"))))
465 (build-system cmake-build-system)
466 (arguments
467 `(#:configure-flags
468 (list
469 "-DENABLE_STATIC=NO"
470 "-DENABLE_TESTS=YES")))
471 (inputs
472 `(("bctoolbox" ,bctoolbox)
473 ("sqlite3" ,sqlite)
474 ("xml2" ,libxml2)))
475 (synopsis "Belledonne Communications ZRTP Library")
476 (description "BZRTP is an implementation of ZRTP keys exchange protocol,
477 written in C. It is fully portable and can be executed on many platforms
478 including both ARM and x86.")
479 (home-page "https://gitlab.linphone.org/BC/public/bzrtp")
480 (license license:gpl3+)))
481
482 (define-public belle-sip
483 (package
484 (name "belle-sip")
485 (version "4.4.34")
486 (source
487 (origin
488 (method git-fetch)
489 (uri (git-reference
490 (url "https://gitlab.linphone.org/BC/public/belle-sip.git")
491 (commit version)))
492 (file-name (git-file-name name version))
493 (sha256
494 (base32 "1kknnlczq7dpqaj1dwxvy092dzrqjy11ndkv90rqwmdryigkjk6z"))))
495 (build-system cmake-build-system)
496 (outputs '("out" "tester"))
497 (arguments
498 `(#:configure-flags (list "-DENABLE_STATIC=NO"
499 "-DENABLE_MDNS=ON")
500 #:phases
501 (modify-phases %standard-phases
502 (add-after 'unpack 'patch
503 (lambda* (#:key inputs #:allow-other-keys)
504 ;; Fix mDNS dependency.
505 (let* ((avahi (assoc-ref inputs "avahi")))
506 (substitute* (find-files "." "CMakeLists.txt")
507 (("find_package\\(DNSSD REQUIRED\\)")
508 "set(DNSSD_FOUND 1)")
509 (("\\$\\{DNSSD_INCLUDE_DIRS\\}")
510 (string-append avahi "/include/avahi-compat-libdns_sd"))
511 (("\\$\\{DNSSD_LIBRARIES\\}")
512 "dns_sd")))
513 (substitute* "src/CMakeLists.txt"
514 ;; ANTLR would use multithreaded DFA generation otherwise,
515 ;; which would not be reproducible.
516 (("-Xmultithreaded ") ""))))
517 (delete 'check) ;move after install
518 (add-after 'install 'separate-outputs
519 (lambda* (#:key outputs #:allow-other-keys)
520 (let* ((out (assoc-ref outputs "out"))
521 (tester (assoc-ref outputs "tester"))
522 (tester-name "belle_sip_tester"))
523 (for-each mkdir-p (list (string-append tester "/bin")
524 (string-append tester "/share")))
525 (rename-file (string-append out "/bin")
526 (string-append tester "/bin"))
527 (rename-file (string-append out "/share/" tester-name)
528 (string-append tester "/share/" tester-name)))))
529 (add-after 'separate-outputs 'check
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let ((tester (string-append (assoc-ref outputs "tester")
532 "/bin/belle_sip_tester")))
533 (for-each (lambda (suite-name)
534 (invoke tester "--suite" suite-name))
535 (list "Object inheritance"
536 "SIP URI"
537 "FAST SIP URI"
538 "FAST SIP URI 2"
539 "Generic uri"
540 "Headers"
541 "Core"
542 "SDP"
543 ;;"Resolver"
544 "Message"
545 "Authentication helper"
546 ;;"Register"
547 ;;"Dialog"
548 "Refresher"
549 ;;"HTTP stack"
550 "Object"))))))))
551 (inputs
552 (list avahi bctoolbox zlib))
553 (synopsis "Belledonne Communications SIP Library")
554 (description "Belle-sip is a modern library implementing SIP transport,
555 transaction and dialog layers. It is written in C, with an object-oriented
556 API. It also comprises a simple HTTP/HTTPS client implementation.")
557 (home-page "https://linphone.org/technical-corner/belle-sip")
558 (license license:gpl3+)))
559
560 (define-public mediastreamer2
561 (package
562 (name "mediastreamer2")
563 (version "4.4.34")
564 (source
565 (origin
566 (method git-fetch)
567 (uri (git-reference
568 (url "https://gitlab.linphone.org/BC/public/mediastreamer2.git")
569 (commit version)))
570 (file-name (git-file-name name version))
571 (sha256
572 (base32 "0989h3d0h7qrx4kjx8gg09j8c5hvvi3h8qi1iq1dqbppwbaxbz8c"))))
573 (outputs '("out" "doc" "tester"))
574 (build-system cmake-build-system)
575 (arguments
576 `(#:configure-flags (list "-DENABLE_STATIC=NO"
577 "-DENABLE_PCAP=YES"
578 ;; Do not fail on compile warnings.
579 "-DENABLE_STRICT=NO"
580 "-DENABLE_PORTAUDIO=YES"
581 "-DENABLE_G729B_CNG=YES")
582 #:phases
583 (modify-phases %standard-phases
584 (add-after 'unpack 'fix-version
585 (lambda _
586 (substitute* "CMakeLists.txt"
587 (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+")
588 (string-append "VERSION " ,version)))))
589 (add-after 'unpack 'patch-source
590 (lambda _
591 (substitute* "src/otherfilters/mspcapfileplayer.c"
592 (("O_BINARY") "L_INCR"))))
593 (add-before 'check 'pre-check
594 (lambda _
595 ;; Tests require a running X server.
596 (system "Xvfb :1 +extension GLX &")
597 (setenv "DISPLAY" ":1")
598 ;; Tests write to $HOME.
599 (setenv "HOME" (getenv "TEMP"))))
600 (delete 'check) ;move after install
601 (add-after 'install 'separate-outputs
602 (lambda* (#:key outputs #:allow-other-keys)
603 (let* ((out (assoc-ref outputs "out"))
604 (tester (assoc-ref outputs "tester"))
605 (tester-name (string-append ,name "_tester"))
606 (doc (assoc-ref outputs "doc"))
607 (doc-name (string-append ,name "-" ,version)))
608 (for-each mkdir-p
609 (list (string-append tester "/bin")
610 (string-append tester "/share")
611 (string-append doc "/share/doc")))
612 ;; Move the tester executable.
613 (rename-file (string-append out "/bin/" tester-name)
614 (string-append tester "/bin/" tester-name))
615 ;; Move the tester data files.
616 (rename-file (string-append out "/share/" tester-name)
617 (string-append tester "/share/" tester-name))
618 ;; Move the HTML documentation.
619 (rename-file (string-append out "/share/doc/" doc-name)
620 (string-append doc "/share/doc/" doc-name)))))
621 (add-after 'separate-outputs 'check
622 (lambda* (#:key outputs #:allow-other-keys)
623 (let ((tester (string-append (assoc-ref outputs "tester")
624 "/bin/mediastreamer2_tester")))
625 (for-each (lambda (suite-name)
626 (invoke tester "--suite" suite-name))
627 ;; Some tests fail, due to requiring access to the
628 ;; sound card or the network.
629 (list "Basic Audio"
630 ;; "Sound Card"
631 ;; "AdaptiveAlgorithm"
632 ;; "AudioStream"
633 ;; "VideoStream"
634 "H26x Tools"
635 "Framework"
636 ;; "Player"
637 "TextStream"))))))))
638 (native-inputs
639 `(("dot" ,graphviz)
640 ("doxygen" ,doxygen)
641 ("python" ,python-wrapper)
642 ("xorg-server" ,xorg-server-for-tests)))
643 (inputs
644 `(("alsa" ,alsa-lib)
645 ("bcg729" ,bcg729)
646 ("bcmatroska2" ,bcmatroska2)
647 ("bctoolbox" ,bctoolbox)
648 ("ffmpeg" ,ffmpeg)
649 ("glew" ,glew)
650 ("glu" ,glu)
651 ("glx" ,mesa-utils)
652 ("gsm" ,gsm)
653 ("opengl" ,mesa)
654 ("opus" ,opus)
655 ("ortp" ,ortp)
656 ("pcap" ,libpcap)
657 ("portaudio" ,portaudio)
658 ("pulseaudio" ,pulseaudio)
659 ("spandsp" ,spandsp)
660 ("speex" ,speex)
661 ("speexdsp" ,speexdsp)
662 ("srtp" ,libsrtp)
663 ("theora" ,libtheora)
664 ("turbojpeg" ,libjpeg-turbo)
665 ("v4l" ,v4l-utils)
666 ("vpx" ,libvpx)
667 ("x11" ,libx11)
668 ("xv" ,libxv)
669 ("zrtp" ,bzrtp)))
670 (synopsis "Belledonne Communications Streaming Engine")
671 (description "Mediastreamer2 is a powerful and lightweight streaming engine
672 for telephony applications. This media processing and streaming toolkit is
673 responsible for receiving and sending all multimedia streams in Linphone,
674 including media capture, encoding and decoding, and rendering.")
675 (home-page "https://linphone.org/technical-corner/mediastreamer2")
676 (license license:gpl3+)))
677
678 (define-public lime
679 (package
680 (name "lime")
681 (version "4.4.34")
682 (source
683 (origin
684 (method git-fetch)
685 (uri (git-reference
686 (url "https://gitlab.linphone.org/BC/public/lime.git")
687 (commit version)))
688 (file-name (git-file-name name version))
689 (sha256
690 (base32 "14jg1zisjbzflw3scfqdbwy48wq3cp93l867vigb8l40lkc6n26z"))))
691 (build-system cmake-build-system)
692 (outputs '("out" "doc"))
693 (arguments
694 `(#:configure-flags (list "-DENABLE_STATIC=NO"
695 "-DENABLE_C_INTERFACE=YES")
696 #:phases
697 (modify-phases %standard-phases
698 (add-after 'unpack 'patch-source
699 (lambda _
700 ;; Disable tests that require networking.
701 (substitute* "tester/CMakeLists.txt"
702 (("add_test\\(?.*\"Hello World\"\\)") "")
703 (("add_test\\(?.*\"lime\"\\)") "")
704 (("add_test\\(?.*\"FFI\"\\)") ""))))
705 (add-after 'build 'build-doc
706 (lambda _
707 (invoke "make" "doc")))
708 (add-after 'install 'install-doc
709 (lambda* (#:key outputs #:allow-other-keys)
710 (let* ((doc (assoc-ref outputs "doc"))
711 (dir (string-append doc "/share/doc"))
712 (dest (string-append dir "/" ,name "-" ,version)))
713 (mkdir-p dest)
714 (copy-recursively "doc" dest)))))))
715 (native-inputs
716 `(("dot" ,graphviz)
717 ("doxygen" ,doxygen)))
718 (inputs
719 (list bctoolbox belle-sip soci))
720 (synopsis "Belledonne Communications Encryption Library")
721 (description "LIME is an encryption library for one-to-one and group
722 instant messaging, allowing users to exchange messages privately and
723 asynchronously. It supports multiple devices per user and multiple users per
724 device.")
725 (home-page "https://linphone.org/technical-corner/lime")
726 (license license:gpl3+)))
727
728 (define-public liblinphone
729 (package
730 (name "liblinphone")
731 (version "4.4.34")
732 (source
733 (origin
734 (method git-fetch)
735 (uri (git-reference
736 (url "https://gitlab.linphone.org/BC/public/liblinphone.git")
737 (commit version)))
738 (file-name (git-file-name name version))
739 (sha256
740 (base32 "1lwabr93jw24y04pdqnw9dgg8jb3lzfplyx19f83jgp9dj8kmfq9"))))
741 (outputs '("out" "tester"))
742 (build-system cmake-build-system)
743 (arguments
744 `(#:tests? #f ; Tests require networking
745 #:configure-flags (list "-DENABLE_STATIC=NO"
746 "-DENABLE_DOC=NO" ;requires unpackaged javasphinx
747 "-DENABLE_LDAP=YES")
748 #:phases
749 (modify-phases %standard-phases
750 (add-after 'install 'separate-outputs
751 (lambda* (#:key outputs #:allow-other-keys)
752 (let* ((out (assoc-ref outputs "out"))
753 (tester (assoc-ref outputs "tester"))
754 (tester-name (string-append ,name "_tester")))
755 (for-each mkdir-p
756 (list (string-append tester "/bin")
757 (string-append tester "/share")))
758 (rename-file (string-append out "/bin/" tester-name)
759 (string-append tester "/bin/" tester-name))
760 (rename-file (string-append out "/bin/groupchat_benchmark")
761 (string-append tester "/bin/groupchat_benchmark"))
762 (rename-file (string-append out "/share/" tester-name)
763 (string-append tester "/share/" tester-name))))))))
764 (native-inputs
765 (list graphviz
766 doxygen
767 gettext-minimal
768 perl
769 python-wrapper
770 python-pystache
771 python-six
772 eudev))
773 (inputs
774 (list bctoolbox
775 belcard
776 belle-sip
777 belr
778 bzrtp
779 openldap
780 xsd
781 lime
782 mediastreamer2
783 libnotify
784 ortp
785 soci
786 sqlite
787 libxml2
788 zlib))
789 (synopsis "Belledonne Communications Softphone Library")
790 (description "Liblinphone is a high-level SIP library integrating
791 all calling and instant messaging features into an unified
792 easy-to-use API. It is the cross-platform VoIP library on which the
793 Linphone application is based on, and that anyone can use to add audio
794 and video calls or instant messaging capabilities to an application.")
795 (home-page "https://linphone.org/technical-corner/liblinphone")
796 (license license:gpl3+)))
797
798 (define-public linphone-desktop
799 (package
800 (name "linphone-desktop")
801 (version "4.2.5")
802 (source
803 (origin
804 (method git-fetch)
805 (uri (git-reference
806 (url "https://gitlab.linphone.org/BC/public/linphone-desktop")
807 (commit version)))
808 (file-name (git-file-name name version))
809 (sha256
810 (base32 "1gq4l9p21rbrcksa7fbkzn9fzbbynqmn6ni6lhnvzk359sb1xvbz"))
811 (patches (search-patches "linphone-desktop-without-sdk.patch"))))
812 (build-system qt-build-system)
813 (outputs '("out" "debug"))
814 (arguments
815 `(#:tests? #f ; No test target
816 #:configure-flags (list "-DENABLE_UPDATE_CHECK=NO"
817 "-DENABLE_DAEMON=YES"
818 "-DENABLE_CONSOLE_UI=YES")
819 #:phases
820 (modify-phases %standard-phases
821 (add-after 'unpack 'pre-configure
822 (lambda _
823 (make-file-writable "linphone-app/linphoneqt_version.cmake")
824 (substitute* "linphone-app/linphoneqt_version.cmake"
825 (("\\$\\{GUIX-SET-VERSION\\}") ,version))))
826 (add-after 'install 'post-install
827 (lambda* (#:key inputs outputs #:allow-other-keys)
828 (let* ((out (assoc-ref outputs "out"))
829 (liblinphone (assoc-ref inputs "liblinphone"))
830 (grammar-dest (string-append out "/share/belr/grammars")))
831 ;; Remove unnecessary Qt configuration file.
832 (delete-file (string-append out "/bin/qt.conf"))
833 ;; Not using the FHS exposes an issue where the client
834 ;; refers to its own directories, which lacks files
835 ;; installed by the dependencies.
836 (symlink (string-append liblinphone "/lib")
837 (string-append out "/lib"))
838 (symlink (string-append liblinphone "/share/sounds")
839 (string-append out "/share/sounds"))
840 (symlink (string-append liblinphone "/share/linphone/rootca.pem")
841 (string-append out "/share/linphone/rootca.pem"))
842 (mkdir-p (dirname grammar-dest))
843 (symlink (string-append liblinphone "/share/belr/grammars")
844 grammar-dest)))))))
845 (native-inputs
846 (list pkg-config qttools-5))
847 (inputs
848 (list bctoolbox
849 belcard
850 belr
851 liblinphone
852 mediastreamer2
853 ortp
854 qtbase-5
855 qtdeclarative-5
856 qtgraphicaleffects
857 qtquickcontrols-5
858 qtquickcontrols2-5
859 qtsvg-5))
860 (synopsis "Desktop client for the Linphone SIP softphone")
861 (description "Linphone is a SIP softphone for voice and video over IP calling
862 (VoIP) and instant messaging. Amongst its features are:
863 @itemize
864 @item High Definition (HD) audio and video calls
865 @item Multiple call management (pause and resume)
866 @item Call transfer
867 @item Audio conferencing (merge calls into a conference call)
868 @item Call recording and replay (audio only)
869 @item Instant Messaging with message delivery status (IMDN)
870 @item Picture and file sharing
871 @item Echo cancellation
872 @item Secure user authentication using TLS client certificates
873 @item SRTP, zRTP and SRTP-DTLS voice and video encryption
874 @item Telephone tone (DTMF) support using SIP INFO or RFC 4733
875 @item Audio codecs: opus, speex, g711, g729, gsm, iLBC, g722, SILK, etc.
876 @item Video codecs: VP8, H.264 and H.265 with resolutions up to 1080P, MPEG4
877 @end itemize")
878 (home-page "https://linphone.org/technical-corner/linphone")
879 (license license:gpl3+)))
880
881 (define-public linphoneqt
882 (deprecated-package "linphoneqt" linphone-desktop))
883
884 (define-public msopenh264
885 (let ((commit "88697cc95140017760d6da408cb0efdc5e86e40a")
886 (revision "0"))
887 (package
888 (name "msopenh264")
889 (version (git-version "1.2.1" revision commit))
890 (source
891 (origin
892 (method git-fetch)
893 (uri (git-reference
894 (url "https://gitlab.linphone.org/BC/public/msopenh264.git")
895 (commit commit)))
896 (file-name (git-file-name name version))
897 (sha256
898 (base32 "10y3b6s934f2wbsf60b3p0g6hffizjqrj5in8l4sida2fjdxlwwy"))))
899 (build-system cmake-build-system)
900 (arguments
901 `(#:tests? #f ; No test target
902 #:configure-flags
903 (list "-DENABLE_STATIC=NO"))) ; Not required
904 (inputs
905 (list bctoolbox mediastreamer2 openh264 ortp))
906 (synopsis "Media Streamer H.264 Codec")
907 (description "MsOpenH264 is an H.264 encoder/decoder plugin for
908 mediastreamer2 based on the openh264 library.")
909 (home-page "https://gitlab.linphone.org/BC/public/msopenh264")
910 (license license:gpl2+))))
911
912 (define-public mssilk
913 (let ((commit "dd0f31ee795faa7ea89e601b072dae4cd1df7e3f")
914 (revision "0"))
915 (package
916 (name "mssilk")
917 (version (git-version "1.1.1" revision commit))
918 (source
919 (origin
920 (method git-fetch)
921 (uri (git-reference
922 (url "https://gitlab.linphone.org/BC/public/mssilk.git")
923 (commit commit)))
924 (file-name (git-file-name name version))
925 (sha256
926 (base32 "1dann5fnzqp6wjlwc6bl2k9b6rvn6bznqb3qsi1kgv9dnq44cbr0"))))
927 (build-system cmake-build-system)
928 (arguments
929 `(#:tests? #f ; No test target
930 #:configure-flags
931 (list "-DENABLE_STATIC=NO"))) ; Not required
932 (inputs
933 (list bctoolbox mediastreamer2 ortp))
934 (synopsis "Media Streamer SILK Codec")
935 (description "MSSILK is a plugin of MediaStreamer, adding support for AMR
936 codec. It is based on the Skype's SILK implementation.")
937 (home-page "https://gitlab.linphone.org/BC/public/mssilk")
938 (license license:gpl2+))))
939
940 (define-public mswebrtc
941 (let ((commit "946ca706733f36a6b4923f04e569531125462d1d")
942 (revision "0"))
943 (package
944 (name "mswebrtc")
945 (version (git-version "1.1.1" revision commit))
946 (source
947 (origin
948 (method git-fetch)
949 (uri (git-reference
950 (url "https://gitlab.linphone.org/BC/public/mswebrtc")
951 (commit commit)))
952 (file-name (git-file-name name version))
953 (sha256
954 (base32 "1pfg9m6bpbv0f53nx72rdxhlyriax9pg4yj0gpwq8ha6lqnpwg1x"))))
955 (build-system cmake-build-system)
956 (arguments
957 `(#:tests? #f ; No test target
958 #:configure-flags
959 (list
960 "-DENABLE_STATIC=NO")
961 #:phases
962 (modify-phases %standard-phases
963 (add-after 'unpack 'copy-inputs
964 (lambda* (#:key inputs outputs #:allow-other-keys)
965 (let* ((webrtc-from (assoc-ref inputs "webrtc"))
966 (webrtc-to (string-append (getcwd) "/webrtc")))
967 (copy-recursively webrtc-from webrtc-to))
968 #t)))))
969 (native-inputs
970 `(("webrtc"
971 ,(origin
972 (method git-fetch)
973 (uri
974 (git-reference
975 (url "https://gitlab.linphone.org/BC/public/external/webrtc")
976 (commit "583acd27665cfadef8ab03eb85a768d308bd29dd")))
977 (file-name
978 (git-file-name "webrtc-for-mswebrtc" version))
979 (sha256
980 (base32
981 "1maqychrgwy0z4zypa03qp726l2finw64z6cymdzhd58ql3p1lvm"))))
982 ("python" ,python-wrapper)))
983 (inputs
984 (list bctoolbox mediastreamer2 ortp))
985 (synopsis "Media Streamer WebRTC Codec")
986 (description "MSWebRTC is a plugin of MediaStreamer, adding support for
987 WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.")
988 (home-page "https://gitlab.linphone.org/BC/public/mswebrtc")
989 (license license:gpl2+))))
990
991 (define-public msamr
992 (let ((commit "5ab5c098299107048dfcbfc741f7392faef167bd")
993 (revision "0"))
994 (package
995 (name "msamr")
996 (version (git-version "1.1.3" revision commit))
997 (source
998 (origin
999 (method git-fetch)
1000 (uri (git-reference
1001 (url "https://gitlab.linphone.org/BC/public/msamr")
1002 (commit commit)))
1003 (file-name (git-file-name name version))
1004 (sha256
1005 (base32 "1g79lw1qi1mlw3v1b0cixmqiwjql81gz9naakb15n8pvaag9aaqm"))))
1006 (build-system cmake-build-system)
1007 (arguments
1008 `(#:tests? #f ; No test target
1009 #:configure-flags
1010 (list "-DENABLE_STATIC=NO" ; Not required
1011 "-DENABLE_WIDEBAND=YES")))
1012 (inputs
1013 `(("bctoolbox" ,bctoolbox)
1014 ("mediastreamer2" ,mediastreamer2)
1015 ("opencoreamr" ,opencore-amr)
1016 ("ortp" ,ortp)
1017 ("voamrwbenc" ,vo-amrwbenc)))
1018 (synopsis "Media Streamer AMR Codec")
1019 (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
1020 codec. It is based on the opencore-amr implementation.")
1021 (home-page "https://gitlab.linphone.org/BC/public/msamr")
1022 (license license:gpl3+))))