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