gnu: mediastreamer2: Enable tests.
[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)
d5a8e391 26 #:use-module (gnu packages base)
e7859da1 27 #:use-module (gnu packages compression)
bdd0d5bf 28 #:use-module (gnu packages crypto)
13f401d3 29 #:use-module (gnu packages documentation)
9732910d 30 #:use-module (gnu packages gettext)
b6b3a6a6 31 #:use-module (gnu packages gl)
02b32cdd 32 #:use-module (gnu packages glib)
b6b3a6a6 33 #:use-module (gnu packages gnome)
02b32cdd 34 #:use-module (gnu packages gnome-xyz)
13f401d3 35 #:use-module (gnu packages graphviz)
02b32cdd 36 #:use-module (gnu packages gtk)
b6b3a6a6
RG
37 #:use-module (gnu packages image)
38 #:use-module (gnu packages linux)
c2a9b05f
RG
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages perl)
b6b3a6a6
RG
41 #:use-module (gnu packages pulseaudio)
42 #:use-module (gnu packages python)
9732910d 43 #:use-module (gnu packages python-xyz)
c0cce205 44 #:use-module (gnu packages qt)
e7859da1 45 #:use-module (gnu packages java)
f3697439 46 #:use-module (gnu packages sqlite)
b6b3a6a6 47 #:use-module (gnu packages telephony)
bfaabfeb 48 #:use-module (gnu packages tls)
b6b3a6a6
RG
49 #:use-module (gnu packages video)
50 #:use-module (gnu packages xiph)
f3697439 51 #:use-module (gnu packages xml)
b6b3a6a6 52 #:use-module (gnu packages xorg)
d5a8e391
RG
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix download)
f5c89853 56 #:use-module (guix git-download)
d5a8e391 57 #:use-module (guix build-system cmake)
c0cce205 58 #:use-module (guix build-system qt)
41169f21 59 #:use-module (guix build-system glib-or-gtk)
d5a8e391
RG
60 #:use-module (guix build-system gnu))
61
62(define-public bcunit
c2a9b05f
RG
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
123several fixes and patches applied. It is a unit testing framework for
124writing, administering, and running unit tests in C.")
125 (home-page "https://gitlab.linphone.org/BC/public/bcunit")
126 (license license:lgpl2.0+))))
bfaabfeb
RG
127
128(define-public bctoolbox
129 (package
130 (name "bctoolbox")
bdd0d5bf 131 (version "4.4.34")
bfaabfeb
RG
132 (source
133 (origin
bdd0d5bf
RG
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))
bfaabfeb 139 (sha256
bdd0d5bf 140 (base32 "0bfswwvvdshaahg4jd2j10f0sci8809s4khajd0m6b059zwc7y25"))))
bfaabfeb 141 (build-system cmake-build-system)
bdd0d5bf 142 (outputs '("out" "debug"))
bfaabfeb 143 (arguments
bdd0d5bf
RG
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")))))))
bfaabfeb
RG
180 (inputs
181 `(("bcunit" ,bcunit)
bdd0d5bf 182 ("decaf" ,libdecaf)
bfaabfeb
RG
183 ("mbedtls" ,mbedtls-apache)))
184 (synopsis "Belledonne Communications Tool Box")
185 (description "BcToolBox is an utilities library used by Belledonne
1d0feeb0 186Communications software like belle-sip, mediastreamer2 and linphone.")
bfaabfeb 187 (home-page "https://gitlab.linphone.org/BC/public/bctoolbox")
bdd0d5bf 188 (license license:gpl3+)))
63c73bca
RG
189
190(define-public belr
191 (package
192 (name "belr")
c52d0f9c 193 (version "4.4.34")
63c73bca
RG
194 (source
195 (origin
c52d0f9c
RG
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))
63c73bca 201 (sha256
c52d0f9c 202 (base32 "0w2canwwm0qb99whnangvaybvjzq8xg6vksqxykgr8fbx7clw03h"))))
63c73bca 203 (build-system cmake-build-system)
c52d0f9c 204 (outputs '("out" "debug" "tester"))
63c73bca 205 (arguments
c52d0f9c
RG
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"))))))))
63c73bca
RG
232 (inputs
233 `(("bctoolbox" ,bctoolbox)))
234 (synopsis "Belledonne Communications Language Recognition Library")
1988ef21
RG
235 (description "Belr is Belledonne Communications' language recognition
236library, written in C++11. It parses text inputs formatted according to a
237language defined by an ABNF grammar, such as the protocols standardized at
238IETF.")
63c73bca
RG
239 (home-page "https://gitlab.linphone.org/BC/public/belr")
240 (license license:gpl3+)))
c8f69ec2
RG
241
242(define-public belcard
243 (package
244 (name "belcard")
7a8e1734 245 (version "4.4.34")
c8f69ec2
RG
246 (source
247 (origin
7a8e1734
RG
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))
c8f69ec2 253 (sha256
7a8e1734 254 (base32 "16x2xp8d0a115132zhy1kpxkyj86ia7vrsnpjdg78fnbvmvysc8m"))))
c8f69ec2 255 (build-system cmake-build-system)
7a8e1734 256 (outputs '("out" "debug" "tester"))
c8f69ec2 257 (arguments
7a8e1734
RG
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))))))))
c8f69ec2
RG
290 (inputs
291 `(("bctoolbox" ,bctoolbox)
292 ("belr" ,belr)))
293 (synopsis "Belledonne Communications VCard Library")
1988ef21
RG
294 (description "Belcard is a C++ library to manipulate VCard standard
295format.")
c8f69ec2
RG
296 (home-page "https://gitlab.linphone.org/BC/public/belcard")
297 (license license:gpl3+)))
28f6f1e0
RG
298
299(define-public bcmatroska2
300 (package
301 (name "bcmatroska2")
302 (version "0.23")
303 (source
304 (origin
279908ef
RG
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))
28f6f1e0 310 (sha256
279908ef 311 (base32 "1avl9w18kh4dxm3g8j0bkw39bksd7bz3nfxvyibqqnz63ds8vfi2"))))
28f6f1e0
RG
312 (build-system cmake-build-system)
313 (arguments
279908ef
RG
314 `(#:tests? #f ; No test target
315 #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required
28f6f1e0 316 (synopsis "Belledonne Communications Media Container")
1988ef21
RG
317 (description "BcMatroska is a free and open standard multi-media container
318format. It can hold an unlimited number of video, audio, picture, or subtitle
279908ef
RG
319tracks in one file. This project provides a convenient distribution of the
320Matroska multimedia container format.")
28f6f1e0 321 (home-page "https://gitlab.linphone.org/BC/public/bcmatroska2")
279908ef
RG
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
02d5d72c
RG
325
326(define-public bcg729
327 (package
328 (name "bcg729")
2674e1bf 329 (version "1.1.1")
02d5d72c
RG
330 (source
331 (origin
f5c89853
TGR
332 (method git-fetch)
333 (uri (git-reference
05e0bd07 334 (url "git://git.linphone.org/bcg729")
f5c89853
TGR
335 (commit version)))
336 (file-name (git-file-name name version))
02d5d72c 337 (sha256
2674e1bf 338 (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739"))))
02d5d72c
RG
339 (build-system cmake-build-system)
340 (arguments
05e0bd07
RG
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)))
02d5d72c
RG
388 (synopsis "Belledonne Communications G729 Codec")
389 (description "BcG729 is an implementation of both encoder and decoder of
390the ITU G729 speech codec. The library written in C 99 is fully portable and
391can be executed on many platforms including both ARM and x86 processors. It
392supports concurrent channels encoding and decoding for multi call application
393such as conferencing.")
05e0bd07
RG
394 (home-page "https://linphone.org/technical-corner/bcg729")
395 (license license:gpl3+)))
13f401d3
RG
396
397(define-public ortp
398 (package
399 (name "ortp")
2dda883d 400 (version "4.4.34")
13f401d3
RG
401 (source
402 (origin
2dda883d
RG
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))
13f401d3 408 (sha256
2dda883d 409 (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
13f401d3 410 (build-system cmake-build-system)
2dda883d
RG
411 (outputs '("out""tester"
412 "doc")) ;1.5 MiB of HTML doc
13f401d3 413 (arguments
2dda883d
RG
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
146a9403 420 ;; See: https://gitlab.linphone.org/BC/public/ortp/-/issues/5.
2dda883d
RG
421 (lambda _
422 (substitute* "CMakeLists.txt"
146a9403 423 (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+")
2dda883d
RG
424 (string-append "VERSION " ,version))
425 (("\\$\\{ORTP_DOC_VERSION\\}")
426 ,version))))
427 (add-after 'install 'separate-outputs
428 (lambda* (#:key outputs #:allow-other-keys)
429 (let* ((out (assoc-ref outputs "out"))
430 (doc (assoc-ref outputs "doc"))
431 (doc-src (string-append out "/share/doc/ortp-" ,version))
432 (doc-dest (string-append doc "/share/doc/ortp-" ,version))
433 (tester (assoc-ref outputs "tester")))
434 (for-each mkdir-p (list (string-append doc "/share/doc")
435 (string-append tester "/bin")))
436 (rename-file doc-src doc-dest)
437 (rename-file (string-append out "/bin")
438 (string-append tester "/bin"))))))))
13f401d3
RG
439 (native-inputs
440 `(("dot" ,graphviz)
441 ("doxygen" ,doxygen)))
442 (inputs
443 `(("bctoolbox" ,bctoolbox)))
444 (synopsis "Belledonne Communications RTP Library")
445 (description "oRTP is a C library implementing the RTP protocol. It
446implements the RFC 3550 standard.")
2dda883d
RG
447 (home-page "https://linphone.org/technical-corner/ortp")
448 (license license:gpl3+)))
f3697439
RG
449
450(define-public bzrtp
451 (package
452 (name "bzrtp")
ebc75b6a 453 (version "4.4.34")
f3697439
RG
454 (source
455 (origin
ebc75b6a
RG
456 (method git-fetch)
457 (uri (git-reference
458 (url "https://gitlab.linphone.org/BC/public/bzrtp")
459 (commit version)))
460 (file-name (git-file-name name version))
f3697439 461 (sha256
ebc75b6a 462 (base32 "1yjmsbqmymzl4r7sba6w4a2yld8m6hzafr6jf7sj0syhwpnc3zv6"))))
f3697439
RG
463 (build-system cmake-build-system)
464 (arguments
ebc75b6a
RG
465 `(#:configure-flags
466 (list
467 "-DENABLE_STATIC=NO"
468 "-DENABLE_TESTS=YES")))
f3697439
RG
469 (inputs
470 `(("bctoolbox" ,bctoolbox)
471 ("sqlite3" ,sqlite)
472 ("xml2" ,libxml2)))
473 (synopsis "Belledonne Communications ZRTP Library")
1988ef21
RG
474 (description "BZRTP is an implementation of ZRTP keys exchange protocol,
475written in C. It is fully portable and can be executed on many platforms
476including both ARM and x86.")
f3697439 477 (home-page "https://gitlab.linphone.org/BC/public/bzrtp")
ebc75b6a 478 (license license:gpl3+)))
e7859da1
RG
479
480(define-public belle-sip
481 (package
482 (name "belle-sip")
483 (version "1.6.3")
484 (source
485 (origin
486 (method url-fetch)
487 (uri
488 (string-append "https://www.linphone.org/releases/sources/" name
489 "/" name "-" version ".tar.gz"))
490 (sha256
491 (base32 "0s55kggmgxap54dkw5856bgk4xg7yvbzialpxnjm0zhpic3hff1z"))))
492 (build-system cmake-build-system)
493 (arguments
494 `(#:tests? #f ; Requires network access
495 #:configure-flags
1988ef21 496 (list "-DENABLE_STATIC=NO") ; Not required
e7859da1
RG
497 #:phases
498 (modify-phases %standard-phases
499 (add-after 'unpack 'patch
500 (lambda _
501 (substitute* "src/CMakeLists.txt"
1988ef21
RG
502 ;; ANTLR would use multithreaded DFA generation otherwise,
503 ;; which would not be reproducible.
504 (("-Xmultithreaded ") ""))
e7859da1
RG
505 #t)))))
506 (inputs
507 `(("antlr3" ,antlr3-3.3)
508 ("antlr3c" ,libantlr3c)
509 ("bctoolbox" ,bctoolbox)
510 ("java" ,icedtea)
511 ("zlib" ,zlib)))
512 (synopsis "Belledonne Communications SIP Library")
513 (description "Belle-sip is a modern library implementing SIP transport,
514transaction and dialog layers. It is written in C, with an object-oriented
515API. It also comprises a simple HTTP/HTTPS client implementation.")
516 (home-page "https://gitlab.linphone.org/BC/public/belle-sip")
517 (license license:gpl2+)))
b6b3a6a6
RG
518
519(define-public mediastreamer2
520 (package
521 (name "mediastreamer2")
146a9403 522 (version "4.4.34")
b6b3a6a6
RG
523 (source
524 (origin
146a9403
RG
525 (method git-fetch)
526 (uri (git-reference
527 (url "https://gitlab.linphone.org/BC/public/mediastreamer2.git")
528 (commit version)))
529 (file-name (git-file-name name version))
b6b3a6a6 530 (sha256
146a9403 531 (base32 "0989h3d0h7qrx4kjx8gg09j8c5hvvi3h8qi1iq1dqbppwbaxbz8c"))))
fe6ccb85 532 (outputs '("out" "doc" "tester"))
b6b3a6a6
RG
533 (build-system cmake-build-system)
534 (arguments
0c6f7d83 535 `(#:configure-flags (list "-DENABLE_STATIC=NO")
fe6ccb85
MC
536 #:phases
537 (modify-phases %standard-phases
146a9403
RG
538 (add-after 'unpack 'fix-version
539 (lambda _
540 (substitute* "CMakeLists.txt"
541 (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+")
542 (string-append "VERSION " ,version)))))
0c6f7d83
RG
543 (add-before 'check 'pre-check
544 (lambda _
545 ;; Tests require a running X server.
546 (system "Xvfb :1 +extension GLX &")
547 (setenv "DISPLAY" ":1")
548 ;; Tests write to $HOME.
549 (setenv "HOME" (getenv "TEMP"))))
550 (delete 'check) ;move after install
fe6ccb85
MC
551 (add-after 'install 'separate-outputs
552 (lambda* (#:key outputs #:allow-other-keys)
553 (let* ((out (assoc-ref outputs "out"))
fe6ccb85 554 (tester (assoc-ref outputs "tester"))
146a9403
RG
555 (tester-name (string-append ,name "_tester"))
556 (doc (assoc-ref outputs "doc"))
557 (doc-name (string-append ,name "-" ,version)))
558 (for-each mkdir-p
559 (list (string-append tester "/bin")
560 (string-append tester "/share")
561 (string-append doc "/share/doc")))
0c6f7d83 562 ;; Move the tester executable.
fe6ccb85
MC
563 (rename-file (string-append out "/bin/" tester-name)
564 (string-append tester "/bin/" tester-name))
0c6f7d83 565 ;; Move the tester data files.
146a9403
RG
566 (rename-file (string-append out "/share/" tester-name)
567 (string-append tester "/share/" tester-name))
0c6f7d83 568 ;; Move the HTML documentation.
146a9403 569 (rename-file (string-append out "/share/doc/" doc-name)
0c6f7d83
RG
570 (string-append doc "/share/doc/" doc-name)))))
571 (add-after 'separate-outputs 'check
572 (lambda* (#:key outputs #:allow-other-keys)
573 (let ((tester (string-append (assoc-ref outputs "tester")
574 "/bin/mediastreamer2_tester")))
575 (for-each (lambda (suite-name)
576 (invoke tester "--suite" suite-name))
577 ;; Some tests fail, due to requiring access to the
578 ;; sound card or the network.
579 (list "Basic Audio"
580 ;; "Sound Card"
581 ;; "AdaptiveAlgorithm"
582 ;; "AudioStream"
583 ;; "VideoStream"
584 "H26x Tools"
585 "Framework"
586 ;; "Player"
587 "TextStream"))))))))
b6b3a6a6
RG
588 (native-inputs
589 `(("dot" ,graphviz)
590 ("doxygen" ,doxygen)
0c6f7d83
RG
591 ("python" ,python-wrapper)
592 ("xorg-server" ,xorg-server-for-tests)))
b6b3a6a6
RG
593 (inputs
594 `(("alsa" ,alsa-lib)
595 ("bcg729" ,bcg729)
596 ("bcmatroska2" ,bcmatroska2)
597 ("bctoolbox" ,bctoolbox)
598 ("ffmpeg" ,ffmpeg)
599 ("glew" ,glew)
600 ("glu" ,glu)
601 ("glx" ,mesa-utils)
602 ("gsm" ,gsm)
603 ("opengl" ,mesa)
604 ("opus" ,opus)
605 ("ortp" ,ortp)
606 ("pcap" ,libpcap)
607 ("portaudio" ,portaudio)
608 ("pulseaudio" ,pulseaudio)
609 ("spandsp" ,spandsp)
610 ("speex" ,speex)
611 ("speexdsp" ,speexdsp)
612 ("srtp" ,libsrtp)
613 ("theora" ,libtheora)
614 ("turbojpeg" ,libjpeg-turbo)
615 ("v4l" ,v4l-utils)
616 ("vpx" ,libvpx)
617 ("x11" ,libx11)
618 ("xv" ,libxv)
1988ef21 619 ("zrtp" ,bzrtp)))
b6b3a6a6 620 (synopsis "Belledonne Communications Streaming Engine")
1988ef21
RG
621 (description "Mediastreamer2 is a powerful and lightweight streaming engine
622for telephony applications. This media processing and streaming toolkit is
623responsible for receiving and sending all multimedia streams in Linphone,
624including media capture, encoding and decoding, and rendering.")
146a9403
RG
625 (home-page "https://linphone.org/technical-corner/mediastreamer2")
626 (license license:gpl3+)))
9732910d
RG
627
628(define-public liblinphone
629 (package
630 (name "liblinphone")
631 (version "3.12.0")
632 (source
633 (origin
634 (method url-fetch)
635 (uri
636 (string-append "https://www.linphone.org/releases/sources/linphone"
637 "/linphone-" version ".tar.gz"))
638 (sha256
639 (base32 "0phhkx55xdyg28d4wn8l8q4yvsmdgzmjiw584d4s190sq1azm91x"))))
9c63165d 640 (outputs '("out" "doc" "tester"))
9732910d
RG
641 (build-system cmake-build-system)
642 (arguments
643 `(#:tests? #f ; No test target
644 #:configure-flags
1988ef21
RG
645 (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
646 (string-append (assoc-ref %build-inputs "gtk2")
647 "/lib/gtk-2.0/include"))
648 (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
649 (string-append (assoc-ref %build-inputs "glib")
650 "/lib/glib-2.0/include"))
651 "-DENABLE_STATIC=NO" ; Not required
652 "-DENABLE_STRICT=NO"
653 "-DENABLE_GTK_UI=YES") ; for legacy UI
41169f21
RG
654 #:imported-modules (,@%cmake-build-system-modules
655 (guix build glib-or-gtk-build-system))
656 #:modules ((guix build cmake-build-system)
657 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
658 (guix build utils))
02b32cdd
DM
659 #:phases
660 (modify-phases %standard-phases
661 (add-after 'unpack 'patch
662 (lambda _
663 (substitute* "gtk/main.c"
664 (("#include \"liblinphone_gitversion.h\"")
665 ""))
9c63165d
MC
666 #t))
667 (add-after 'install 'separate-outputs
668 (lambda* (#:key outputs #:allow-other-keys)
669 (let* ((out (assoc-ref outputs "out"))
670 (doc (assoc-ref outputs "doc"))
671 (tester (assoc-ref outputs "tester"))
672 (tester-name (string-append ,name "_tester")))
673 ;; Copy the tester executable.
674 (mkdir-p (string-append tester "/bin"))
675 (rename-file (string-append out "/bin/" tester-name)
676 (string-append tester "/bin/" tester-name))
677 ;; Copy the tester data files.
678 (mkdir-p (string-append tester "/share/"))
679 (rename-file (string-append out "/share/" tester-name)
680 (string-append tester "/share/" tester-name))
681 ;; Copy the HTML and XML documentation.
682 (copy-recursively
683 (string-append out "/share/doc/linphone-" ,version)
684 (string-append doc "/share/doc/" ,name "-" ,version))
685 (delete-file-recursively
686 (string-append out "/share/doc/linphone-" ,version))
687 #t)))
0c7f478e
MR
688 (add-after 'install 'install-man-pages
689 (lambda* (#:key outputs #:allow-other-keys)
690 (let* ((out (assoc-ref outputs "out"))
691 (man (string-append out "/share/man/man1")))
692 (for-each (lambda (file)
693 (install-file file man))
694 (find-files ".." ".*.1$"))
695 #t)))
9c63165d
MC
696 (add-after 'separate-outputs 'glib-or-gtk-compile-schemas
697 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
698 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
699 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
9732910d 700 (native-inputs
1ae43257
MC
701 `(("gettext" ,gettext-minimal)
702 ("udev" ,eudev) ;for libudev.h
703 ;; For generating the C++ wrappers.
704 ("dot" ,graphviz)
9732910d 705 ("doxygen" ,doxygen)
9732910d 706 ("python" ,python)
1ae43257
MC
707 ("pystache" ,python-pystache)
708 ("six" ,python-six)))
9732910d
RG
709 (inputs
710 `(("bctoolbox" ,bctoolbox)
711 ("belcard" ,belcard)
712 ("bellesip" ,belle-sip)
1628d57b 713 ("bzrtp" ,bzrtp)
1ae43257 714 ("iconv" ,libiconv)
02b32cdd
DM
715 ("glib" ,glib)
716 ("gtk2" ,gtk+-2)
9732910d 717 ("mediastreamer2" ,mediastreamer2)
02b32cdd 718 ("notify" ,libnotify)
9732910d 719 ("ortp" ,ortp)
9732910d 720 ("sqlite" ,sqlite)
1ae43257
MC
721 ("xml2" ,libxml2)
722 ("zlib" ,zlib)))
9732910d
RG
723 (synopsis "Belledonne Communications Softphone Library")
724 (description "Liblinphone is a high-level SIP library integrating
725all calling and instant messaging features into an unified
726easy-to-use API. It is the cross-platform VoIP library on which the
727Linphone application is based on, and that anyone can use to add audio
728and video calls or instant messaging capabilities to an application.")
729 (home-page "https://gitlab.linphone.org/BC/public/liblinphone")
730 (license license:gpl2+)))
14e73f8f 731
c0cce205
RG
732(define-public linphoneqt
733 (package
734 (name "linphoneqt")
735 (version "4.1.1")
736 (source
737 (origin
738 (method url-fetch)
739 (uri
740 (string-append "https://www.linphone.org/releases/sources/" name
741 "/" name "-" version ".tar.gz"))
742 (sha256
45fd28f7
RG
743 (base32 "1g2zrr9li0g1hgs6vys06vr98h5dx36z22hx7a6ry231536c002a"))
744 (patches (search-patches "linphoneqt-tabbutton.patch"))))
c0cce205
RG
745 (build-system qt-build-system)
746 (arguments
747 `(#:tests? #f ; No test target
748 #:phases
c0cce205 749 (modify-phases %standard-phases
a4f1a7e2
MC
750 (add-after 'unpack 'fix-cmake-error
751 (lambda _
752 ;; This is fixed in commit efed2fd8 of the master branch.
753 (substitute* "CMakeLists.txt"
754 (("js)\\$\"")
755 "js$\""))
756 #t))
757 (add-after 'unpack 'set-version-string
c0cce205
RG
758 (lambda _
759 (substitute* "src/app/AppController.cpp"
760 (("LINPHONE_QT_GIT_VERSION")
a4f1a7e2 761 (format #f "~s" ,version)))
48acdefe
MC
762 #t))
763 (add-after 'install 'extend-shared-resources
764 ;; Not using the FHS exposes an issue where the client refers to
765 ;; its own "share" directory, which lacks sound files installed by
766 ;; liblinphone.
767 (lambda* (#:key inputs outputs #:allow-other-keys)
768 (let ((liblinphone (assoc-ref inputs "linphone"))
769 (out (assoc-ref outputs "out")))
770 (symlink (string-append liblinphone "/share/sounds")
771 (string-append out "/share/sounds"))
772 #t))))))
c0cce205
RG
773 (native-inputs
774 `(("qttools" ,qttools)))
775 (inputs
776 `(("bctoolbox" ,bctoolbox)
777 ("belcard" ,belcard)
778 ("bellesip" ,belle-sip)
779 ("linphone" ,liblinphone)
780 ("mediastreamer2" ,mediastreamer2)
781 ("qtbase" ,qtbase)
782 ("qtdeclarative" ,qtdeclarative)
783 ("qtgraphicaleffects" ,qtgraphicaleffects)
45fd28f7 784 ("qtquickcontrols" ,qtquickcontrols)
c0cce205
RG
785 ("qtquickcontrols2" ,qtquickcontrols2)
786 ("qtsvg" ,qtsvg)))
a4f1a7e2
MC
787 (synopsis "Desktop client for the Linphone SIP softphone")
788 (description "Linphone is a SIP softphone for voice and video over IP calling
789(VoIP) and instant messaging. Amongst its features are:
790@itemize
791@item High Definition (HD) audio and video calls
792@item Multiple call management (pause and resume)
793@item Call transfer
794@item Audio conferencing (merge calls into a conference call)
795@item Call recording and replay (audio only)
796@item Instant Messaging with message delivery status (IMDN)
797@item Picture and file sharing
798@item Echo cancellation
799@item Secure user authentication using TLS client certificates
800@item SRTP, zRTP and SRTP-DTLS voice and video encryption
801@item Telephone tone (DTMF) support using SIP INFO or RFC 4733
802@item Audio codecs: opus, speex, g711, g729, gsm, iLBC, g722, SILK, etc.
803@item Video codecs: VP8, H.264 and H.265 with resolutions up to 1080P, MPEG4
804@end itemize")
c0cce205
RG
805 (home-page "https://gitlab.linphone.org/BC/public/linphone-desktop")
806 (license license:gpl2+)))
807
14e73f8f
RG
808(define-public msopenh264
809 (package
810 (name "msopenh264")
811 (version "1.2.1")
812 (source
813 (origin
814 (method url-fetch)
815 (uri
816 (string-append "https://www.linphone.org/releases/sources/plugins/"
817 name "/" name "-" version ".tar.gz"))
818 (sha256
819 (base32 "0rdxgazm52560g52pp6mp3mwx6j1z3h2zyizzfycp8y8zi92fqm8"))
820 (patches
821 (list
822 ;; For support for OpenH264 version >= 2.
823 (origin
824 (method url-fetch)
825 (uri
1988ef21
RG
826 (string-append "https://gitlab.linphone.org/BC/public/msopenh264/"
827 "commit/493d147d28c9a0f788ba4e50b47a1ce7b18bf326"
828 ".diff"))
14e73f8f
RG
829 (file-name "msopenh264-openh264.patch")
830 (sha256
1988ef21
RG
831 (base32
832 "0mmd7nz5n9ian4rcwn200nldmy5j0dpdrna7r32rqnaw82bx3kdb")))))))
14e73f8f
RG
833 (build-system cmake-build-system)
834 (arguments
835 `(#:tests? #f ; No test target
836 #:configure-flags
1988ef21 837 (list "-DENABLE_STATIC=NO"))) ; Not required
14e73f8f
RG
838 (inputs
839 `(("mediastreamer2" ,mediastreamer2)
840 ("openh264" ,openh264)
841 ("ortp" ,ortp)))
842 (synopsis "Media Streamer H.264 Codec")
843 (description "MsOpenH264 is an H.264 encoder/decoder plugin for
844mediastreamer2 based on the openh264 library.")
845 (home-page "https://gitlab.linphone.org/BC/public/msopenh264")
846 (license license:gpl2+)))
f689d3d7
RG
847
848(define-public mssilk
849 (package
850 (name "mssilk")
851 (version "1.1.1")
852 (source
853 (origin
854 (method url-fetch)
855 (uri
856 (string-append "https://www.linphone.org/releases/sources/plugins/"
857 name "/" name "-" version ".tar.gz"))
858 (sha256
859 (base32 "07ip0vd29d1n98lnqs5wpimcsmpm65yl7g5vk4hbqghcbsjw94lj"))))
860 (build-system cmake-build-system)
861 (arguments
862 `(#:tests? #f ; No test target
863 #:configure-flags
1988ef21 864 (list "-DENABLE_STATIC=NO"))) ; Not required
f689d3d7
RG
865 (inputs
866 `(("mediastreamer2" ,mediastreamer2)
867 ("ortp" ,ortp)))
868 (synopsis "Media Streamer SILK Codec")
1988ef21
RG
869 (description "MSSILK is a plugin of MediaStreamer, adding support for AMR
870codec. It is based on the Skype's SILK implementation.")
f689d3d7
RG
871 (home-page "https://gitlab.linphone.org/BC/public/mssilk")
872 (license license:gpl2+)))
fe8f1c0b
RG
873
874(define-public mswebrtc
875 (package
876 (name "mswebrtc")
877 (version "1.1.1")
878 (source
879 (origin
880 (method url-fetch)
881 (uri
882 (string-append "https://www.linphone.org/releases/sources/plugins/"
883 name "/" name "-" version ".tar.gz"))
884 (sha256
885 (base32 "1wj28hl9myhshqmn64xg0jf07aw75gmnilb5rff6rcbdxim87mqr"))))
886 (build-system cmake-build-system)
887 (arguments
888 `(#:tests? #f ; No test target
889 #:configure-flags
890 (list
1988ef21 891 "-DENABLE_STATIC=NO"))) ; Not required
fe8f1c0b
RG
892 (inputs
893 `(("bctoolbox" ,bctoolbox)
894 ("mediastreamer2" ,mediastreamer2)
895 ("ortp" ,ortp)))
896 (synopsis "Media Streamer WebRTC Codec")
897 (description "MSWebRTC is a plugin of MediaStreamer, adding support for
898WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.")
899 (home-page "https://gitlab.linphone.org/BC/public/mswebrtc")
900 (license license:gpl2+)))
b8920169
RG
901
902(define-public msamr
903 (package
904 (name "msamr")
905 (version "1.1.3")
906 (source
907 (origin
908 (method url-fetch)
909 (uri
910 (string-append "https://www.linphone.org/releases/sources/plugins/"
911 name "/" name "-" version ".tar.gz"))
912 (sha256
913 (base32 "16c9f3z4wnj73k7y8gb0fgpr4axsm7b5zrbjvy8vsgz9gyg3agm5"))))
914 (build-system cmake-build-system)
915 (arguments
916 `(#:tests? #f ; No test target
917 #:configure-flags
1988ef21
RG
918 (list "-DENABLE_STATIC=NO" ; Not required
919 "-DENABLE_WIDEBAND=YES")))
b8920169
RG
920 (inputs
921 `(("mediastreamer2" ,mediastreamer2)
922 ("opencoreamr" ,opencore-amr)
923 ("ortp" ,ortp)
924 ("voamrwbenc" ,vo-amrwbenc)))
925 (synopsis "Media Streamer AMR Codec")
1988ef21
RG
926 (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
927codec. It is based on the opencore-amr implementation.")
b8920169
RG
928 (home-page "https://gitlab.linphone.org/BC/public/msamr")
929 (license license:gpl3+)))