projects/guix·blob python-team · refs

1085 lines · 45.2 KiB

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