gnu: Add lime.
[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)
e7859da1 28 #:use-module (gnu packages compression)
bdd0d5bf 29 #:use-module (gnu packages crypto)
093c5da7 30 #:use-module (gnu packages databases)
13f401d3 31 #:use-module (gnu packages documentation)
9732910d 32 #:use-module (gnu packages gettext)
b6b3a6a6 33 #:use-module (gnu packages gl)
02b32cdd 34 #:use-module (gnu packages glib)
b6b3a6a6 35 #:use-module (gnu packages gnome)
02b32cdd 36 #:use-module (gnu packages gnome-xyz)
13f401d3 37 #:use-module (gnu packages graphviz)
02b32cdd 38 #:use-module (gnu packages gtk)
b6b3a6a6
RG
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages linux)
c2a9b05f
RG
41 #:use-module (gnu packages ncurses)
42 #:use-module (gnu packages perl)
b6b3a6a6
RG
43 #:use-module (gnu packages pulseaudio)
44 #:use-module (gnu packages python)
9732910d 45 #:use-module (gnu packages python-xyz)
c0cce205 46 #:use-module (gnu packages qt)
e7859da1 47 #:use-module (gnu packages java)
f3697439 48 #:use-module (gnu packages sqlite)
b6b3a6a6 49 #:use-module (gnu packages telephony)
bfaabfeb 50 #:use-module (gnu packages tls)
b6b3a6a6
RG
51 #:use-module (gnu packages video)
52 #:use-module (gnu packages xiph)
f3697439 53 #:use-module (gnu packages xml)
b6b3a6a6 54 #:use-module (gnu packages xorg)
d5a8e391
RG
55 #:use-module ((guix licenses) #:prefix license:)
56 #:use-module (guix packages)
57 #:use-module (guix download)
f5c89853 58 #:use-module (guix git-download)
d5a8e391 59 #:use-module (guix build-system cmake)
c0cce205 60 #:use-module (guix build-system qt)
41169f21 61 #:use-module (guix build-system glib-or-gtk)
d5a8e391
RG
62 #:use-module (guix build-system gnu))
63
64(define-public bcunit
c2a9b05f
RG
65 (let ((commit "74021cc7cb20a4e177748dd2948173e1f9c270ae")
66 (revision "0"))
67 (package
68 (name "bcunit")
69 (version (git-version "3.0.2" revision commit))
70 (source
71 (origin
72 (method git-fetch)
73 (uri (git-reference
74 (url "git://git.linphone.org/bcunit")
75 (commit commit)))
76 (file-name (git-file-name name version))
77 (sha256
78 (base32 "0npdwvanjkfg9vrqs5yi8vh6wliv50ycdli8pzavir84nb31nq1b"))))
79 (build-system cmake-build-system)
80 (outputs '("out" "doc"))
81 (arguments
82 `(#:configure-flags (list "-DENABLE_STATIC=NO"
83 "-DENABLE_CURSES=ON"
84 "-DENABLE_DOC=ON"
85 "-DENABLE_EXAMPLES=ON"
86 "-DENABLE_TEST=ON"
87 "-DENABLE_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 "target_link_libraries(bcunit_test bcunit)")))))
104 (replace 'check
105 (lambda _
106 (with-directory-excursion "BCUnit/Sources/Test"
107 (invoke "./test_bcunit"))))
108 (add-after 'install 'move-doc
109 (lambda* (#:key outputs #:allow-other-keys)
110 (let ((out (assoc-ref outputs "out"))
111 (doc (assoc-ref outputs "doc")))
112 (for-each mkdir-p
113 `(,(string-append doc "/share/doc")
114 ,(string-append doc "/share/BCUnit")))
115 (rename-file
116 (string-append out "/share/doc/BCUnit")
117 (string-append doc "/share/doc/BCUnit"))
118 (rename-file
119 (string-append out "/share/BCUnit/Examples")
120 (string-append doc "/share/BCUnit/Examples"))))))))
121 (inputs
122 `(("ncurses" ,ncurses)))
123 (synopsis "Belledonne Communications Unit Testing Framework")
124 (description "BCUnit is a fork of the defunct project CUnit, with
125several fixes and patches applied. It is a unit testing framework for
126writing, administering, and running unit tests in C.")
127 (home-page "https://gitlab.linphone.org/BC/public/bcunit")
128 (license license:lgpl2.0+))))
bfaabfeb
RG
129
130(define-public bctoolbox
131 (package
132 (name "bctoolbox")
bdd0d5bf 133 (version "4.4.34")
bfaabfeb
RG
134 (source
135 (origin
bdd0d5bf
RG
136 (method git-fetch)
137 (uri (git-reference
138 (url "https://gitlab.linphone.org/BC/public/bctoolbox.git")
139 (commit version)))
140 (file-name (git-file-name name version))
bfaabfeb 141 (sha256
bdd0d5bf 142 (base32 "0bfswwvvdshaahg4jd2j10f0sci8809s4khajd0m6b059zwc7y25"))))
bfaabfeb 143 (build-system cmake-build-system)
bdd0d5bf 144 (outputs '("out" "debug"))
bfaabfeb 145 (arguments
bdd0d5bf
RG
146 `(#:configure-flags '("-DENABLE_STATIC=OFF")
147 #:phases
148 (modify-phases %standard-phases
149 (add-after 'unpack 'patch-cmake
150 (lambda* (#:key inputs #:allow-other-keys)
151 ;; Fix decaf dependency (see:
152 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/3).
153 (let* ((decaf (assoc-ref inputs "decaf")))
154 (substitute* (find-files "." "CMakeLists.txt")
155 (("find_package\\(Decaf CONFIG\\)")
156 "set(DECAF_FOUND 1)")
157 (("\\$\\{DECAF_INCLUDE_DIRS\\}")
158 (string-append decaf "/include/decaf"))
159 (("\\$\\{DECAF_TARGETNAME\\}")
160 "decaf")))))
161 (add-after 'unpack 'skip-problematic-tests
162 (lambda _
163 ;; The following test relies on networking; disable it.
164 (substitute* "tester/port.c"
165 (("[ \t]*TEST_NO_TAG.*bctbx_addrinfo_sort_test\\)")
166 ""))))
167 (add-after 'unpack 'fix-installed-resource-directory-detection
168 (lambda _
169 ;; There's some broken logic in tester.c that checks if CWD, or
170 ;; if its parent exist, and if so, sets the prefix where the test
171 ;; resources are looked up to; disable it (see:
172 ;; https://gitlab.linphone.org/BC/public/bctoolbox/-/issues/4).
173 (substitute* "src/tester.c"
174 (("if \\(file_exists\\(\".\"\\)\\)")
175 "if (NULL)")
176 (("if \\(file_exists\\(\"..\"\\)\\)")
177 "if (NULL)"))))
178 (replace 'check
179 (lambda _
180 (with-directory-excursion "tester"
181 (invoke "./bctoolbox_tester")))))))
bfaabfeb
RG
182 (inputs
183 `(("bcunit" ,bcunit)
bdd0d5bf 184 ("decaf" ,libdecaf)
bfaabfeb
RG
185 ("mbedtls" ,mbedtls-apache)))
186 (synopsis "Belledonne Communications Tool Box")
187 (description "BcToolBox is an utilities library used by Belledonne
1d0feeb0 188Communications software like belle-sip, mediastreamer2 and linphone.")
bfaabfeb 189 (home-page "https://gitlab.linphone.org/BC/public/bctoolbox")
bdd0d5bf 190 (license license:gpl3+)))
63c73bca
RG
191
192(define-public belr
193 (package
194 (name "belr")
c52d0f9c 195 (version "4.4.34")
63c73bca
RG
196 (source
197 (origin
c52d0f9c
RG
198 (method git-fetch)
199 (uri (git-reference
200 (url "https://gitlab.linphone.org/BC/public/belr.git")
201 (commit version)))
202 (file-name (git-file-name name version))
63c73bca 203 (sha256
c52d0f9c 204 (base32 "0w2canwwm0qb99whnangvaybvjzq8xg6vksqxykgr8fbx7clw03h"))))
63c73bca 205 (build-system cmake-build-system)
c52d0f9c 206 (outputs '("out" "debug" "tester"))
63c73bca 207 (arguments
c52d0f9c
RG
208 `(#:configure-flags '("-DENABLE_STATIC=OFF")
209 #:phases
210 (modify-phases %standard-phases
211 (delete 'check) ;moved after the install phase
212 (add-after 'install 'check
213 (lambda* (#:key outputs #:allow-other-keys)
214 (let* ((tester (assoc-ref outputs "tester"))
215 (belr_tester (string-append tester "/bin/belr_tester"))
216 (tester-share (string-append tester "/share/belr_tester")))
217 (invoke belr_tester))))
218 (add-after 'install 'move-tester
219 (lambda* (#:key outputs #:allow-other-keys)
220 (let* ((out (assoc-ref outputs "out"))
221 (tester (assoc-ref outputs "tester")))
222 (for-each mkdir-p
223 (list (string-append tester "/bin")
224 (string-append tester "/share")))
225 (rename-file
226 (string-append out "/bin/belr_tester")
227 (string-append tester "/bin/belr_tester"))
228 (rename-file
229 (string-append out "/share/belr-tester")
230 ;; The detect_res_prefix procedure in bctoolbox's tester.c
231 ;; resolves the resource path based on the executable path and
232 ;; name, so have it match.
233 (string-append tester "/share/belr_tester"))))))))
63c73bca
RG
234 (inputs
235 `(("bctoolbox" ,bctoolbox)))
236 (synopsis "Belledonne Communications Language Recognition Library")
1988ef21
RG
237 (description "Belr is Belledonne Communications' language recognition
238library, written in C++11. It parses text inputs formatted according to a
239language defined by an ABNF grammar, such as the protocols standardized at
240IETF.")
63c73bca
RG
241 (home-page "https://gitlab.linphone.org/BC/public/belr")
242 (license license:gpl3+)))
c8f69ec2
RG
243
244(define-public belcard
245 (package
246 (name "belcard")
7a8e1734 247 (version "4.4.34")
c8f69ec2
RG
248 (source
249 (origin
7a8e1734
RG
250 (method git-fetch)
251 (uri (git-reference
252 (url "https://gitlab.linphone.org/BC/public/belcard.git")
253 (commit version)))
254 (file-name (git-file-name name version))
c8f69ec2 255 (sha256
7a8e1734 256 (base32 "16x2xp8d0a115132zhy1kpxkyj86ia7vrsnpjdg78fnbvmvysc8m"))))
c8f69ec2 257 (build-system cmake-build-system)
7a8e1734 258 (outputs '("out" "debug" "tester"))
c8f69ec2 259 (arguments
7a8e1734
RG
260 `(#:tests? #t
261 #:configure-flags '("-DENABLE_STATIC=OFF")
262 #:phases
263 (modify-phases %standard-phases
264 (add-after 'unpack 'patch-vcard-grammar-location
265 (lambda* (#:key outputs #:allow-other-keys)
266 (let* ((out (assoc-ref outputs "out"))
267 (vcard-grammar
268 (string-append out "/share/belr/grammars/vcard_grammar")))
269 (substitute* "include/belcard/vcard_grammar.hpp"
270 (("define VCARD_GRAMMAR \"vcard_grammar\"")
271 (format #f "define VCARD_GRAMMAR ~s" vcard-grammar))))))
272 (add-after 'install 'install-tester
273 (lambda* (#:key inputs outputs #:allow-other-keys)
274 (let ((out (assoc-ref outputs "out"))
275 (tester (assoc-ref outputs "tester"))
276 (test-name (string-append ,name "_tester")))
277 (for-each mkdir-p
278 (list (string-append tester "/bin")
279 (string-append tester "/share")))
280 (rename-file (string-append out "/bin/" test-name)
281 (string-append tester "/bin/" test-name))
282 (rename-file (string-append out "/share/" test-name)
283 (string-append tester "/share/" test-name)))))
284 (delete 'check)
285 (add-after 'install-tester 'check
286 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
287 (when tests?
288 (let* ((tester (assoc-ref outputs "tester"))
289 (belcard_tester (string-append tester
290 "/bin/belcard_tester")))
291 (invoke belcard_tester))))))))
c8f69ec2
RG
292 (inputs
293 `(("bctoolbox" ,bctoolbox)
294 ("belr" ,belr)))
295 (synopsis "Belledonne Communications VCard Library")
1988ef21
RG
296 (description "Belcard is a C++ library to manipulate VCard standard
297format.")
c8f69ec2
RG
298 (home-page "https://gitlab.linphone.org/BC/public/belcard")
299 (license license:gpl3+)))
28f6f1e0
RG
300
301(define-public bcmatroska2
302 (package
303 (name "bcmatroska2")
304 (version "0.23")
305 (source
306 (origin
279908ef
RG
307 (method git-fetch)
308 (uri (git-reference
309 (url "https://gitlab.linphone.org/BC/public/bcmatroska2.git")
310 (commit version)))
311 (file-name (git-file-name name version))
28f6f1e0 312 (sha256
279908ef 313 (base32 "1avl9w18kh4dxm3g8j0bkw39bksd7bz3nfxvyibqqnz63ds8vfi2"))))
28f6f1e0
RG
314 (build-system cmake-build-system)
315 (arguments
279908ef
RG
316 `(#:tests? #f ; No test target
317 #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required
28f6f1e0 318 (synopsis "Belledonne Communications Media Container")
1988ef21
RG
319 (description "BcMatroska is a free and open standard multi-media container
320format. It can hold an unlimited number of video, audio, picture, or subtitle
279908ef
RG
321tracks in one file. This project provides a convenient distribution of the
322Matroska multimedia container format.")
28f6f1e0 323 (home-page "https://gitlab.linphone.org/BC/public/bcmatroska2")
279908ef
RG
324 (license (list license:gpl2+ ;for this package (build system files)
325 license:bsd-4 ;for Core C and LibEBML2
326 license:lgpl2.1+)))) ;for LibMatroska2
02d5d72c
RG
327
328(define-public bcg729
329 (package
330 (name "bcg729")
2674e1bf 331 (version "1.1.1")
02d5d72c
RG
332 (source
333 (origin
f5c89853
TGR
334 (method git-fetch)
335 (uri (git-reference
05e0bd07 336 (url "git://git.linphone.org/bcg729")
f5c89853
TGR
337 (commit version)))
338 (file-name (git-file-name name version))
02d5d72c 339 (sha256
2674e1bf 340 (base32 "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739"))))
02d5d72c
RG
341 (build-system cmake-build-system)
342 (arguments
05e0bd07
RG
343 `(#:configure-flags (list "-DENABLE_STATIC=NO"
344 "-DENABLE_TESTS=YES")
345 #:phases
346 (modify-phases %standard-phases
347 (add-before 'check 'copy-inputs
348 (lambda* (#:key inputs #:allow-other-keys)
349 (let ((test-patterns (assoc-ref inputs "test-patterns"))
350 (dest (string-append "test/bcg729-patterns.zip")))
351 (copy-recursively test-patterns dest))))
352 (replace 'check
353 (lambda _
354 (with-directory-excursion "test"
355 (invoke "unzip" "bcg729-patterns.zip")
356 (for-each
357 (lambda (test-name)
358 (invoke "./testCampaign" "-s" test-name))
359 (list "fixedCodebookSearch"
360 "postProcessing"
361 "adaptativeCodebookSearch"
362 "computeLP"
363 "computeAdaptativeCodebookGain"
364 "postFilter"
365 "decoder"
366 "LPSynthesisFilter"
367 "decodeLSP"
368 ;; "encoder"
369 ;; "LSPQuantization"
370 "preProcessing"
371 "decodeFixedCodeVector"
372 "CNGdecoder"
373 ;; "LP2LSPConversion"
374 "gainQuantization"
375 "findOpenLoopPitchDelay"
376 "decodeGains"
377 "computeWeightedSpeech"
378 "interpolateqLSPAndConvert2LP"
379 "decodeAdaptativeCodeVector"))))))))
380 (native-inputs
381 `(("perl" ,perl)
382 ("test-patterns"
383 ,(origin
384 (method url-fetch)
385 (uri (string-append "http://www.belledonne-communications.com/"
386 "bc-downloads/bcg729-patterns.zip"))
387 (sha256
388 (base32 "1kivarhh3izrl9sg0szs6x6pbq2ap0y6xsraw0gbgspi4gnfihrh"))))
389 ("unzip" ,unzip)))
02d5d72c
RG
390 (synopsis "Belledonne Communications G729 Codec")
391 (description "BcG729 is an implementation of both encoder and decoder of
392the ITU G729 speech codec. The library written in C 99 is fully portable and
393can be executed on many platforms including both ARM and x86 processors. It
394supports concurrent channels encoding and decoding for multi call application
395such as conferencing.")
05e0bd07
RG
396 (home-page "https://linphone.org/technical-corner/bcg729")
397 (license license:gpl3+)))
13f401d3
RG
398
399(define-public ortp
400 (package
401 (name "ortp")
2dda883d 402 (version "4.4.34")
13f401d3
RG
403 (source
404 (origin
2dda883d
RG
405 (method git-fetch)
406 (uri (git-reference
407 (url "https://gitlab.linphone.org/BC/public/ortp.git")
408 (commit version)))
409 (file-name (git-file-name name version))
13f401d3 410 (sha256
2dda883d 411 (base32 "1r1kvjzyfvkf66in4p51wi87balzg3sw3aq6r4xr609mz86spi5m"))))
13f401d3 412 (build-system cmake-build-system)
2dda883d
RG
413 (outputs '("out""tester"
414 "doc")) ;1.5 MiB of HTML doc
13f401d3 415 (arguments
2dda883d
RG
416 `(#:tests? #f ;requires networking
417 #:configure-flags (list "-DENABLE_STATIC=NO"
418 "-DENABLE_TESTS=YES")
419 #:phases
420 (modify-phases %standard-phases
421 (add-after 'unpack 'fix-version-strings
146a9403 422 ;; See: https://gitlab.linphone.org/BC/public/ortp/-/issues/5.
2dda883d
RG
423 (lambda _
424 (substitute* "CMakeLists.txt"
146a9403 425 (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+")
2dda883d
RG
426 (string-append "VERSION " ,version))
427 (("\\$\\{ORTP_DOC_VERSION\\}")
428 ,version))))
429 (add-after 'install 'separate-outputs
430 (lambda* (#:key outputs #:allow-other-keys)
431 (let* ((out (assoc-ref outputs "out"))
432 (doc (assoc-ref outputs "doc"))
433 (doc-src (string-append out "/share/doc/ortp-" ,version))
434 (doc-dest (string-append doc "/share/doc/ortp-" ,version))
435 (tester (assoc-ref outputs "tester")))
436 (for-each mkdir-p (list (string-append doc "/share/doc")
437 (string-append tester "/bin")))
438 (rename-file doc-src doc-dest)
439 (rename-file (string-append out "/bin")
440 (string-append tester "/bin"))))))))
13f401d3
RG
441 (native-inputs
442 `(("dot" ,graphviz)
443 ("doxygen" ,doxygen)))
444 (inputs
445 `(("bctoolbox" ,bctoolbox)))
446 (synopsis "Belledonne Communications RTP Library")
447 (description "oRTP is a C library implementing the RTP protocol. It
448implements the RFC 3550 standard.")
2dda883d
RG
449 (home-page "https://linphone.org/technical-corner/ortp")
450 (license license:gpl3+)))
f3697439
RG
451
452(define-public bzrtp
453 (package
454 (name "bzrtp")
ebc75b6a 455 (version "4.4.34")
f3697439
RG
456 (source
457 (origin
ebc75b6a
RG
458 (method git-fetch)
459 (uri (git-reference
460 (url "https://gitlab.linphone.org/BC/public/bzrtp")
461 (commit version)))
462 (file-name (git-file-name name version))
f3697439 463 (sha256
ebc75b6a 464 (base32 "1yjmsbqmymzl4r7sba6w4a2yld8m6hzafr6jf7sj0syhwpnc3zv6"))))
f3697439
RG
465 (build-system cmake-build-system)
466 (arguments
ebc75b6a
RG
467 `(#:configure-flags
468 (list
469 "-DENABLE_STATIC=NO"
470 "-DENABLE_TESTS=YES")))
f3697439
RG
471 (inputs
472 `(("bctoolbox" ,bctoolbox)
473 ("sqlite3" ,sqlite)
474 ("xml2" ,libxml2)))
475 (synopsis "Belledonne Communications ZRTP Library")
1988ef21
RG
476 (description "BZRTP is an implementation of ZRTP keys exchange protocol,
477written in C. It is fully portable and can be executed on many platforms
478including both ARM and x86.")
f3697439 479 (home-page "https://gitlab.linphone.org/BC/public/bzrtp")
ebc75b6a 480 (license license:gpl3+)))
e7859da1
RG
481
482(define-public belle-sip
483 (package
484 (name "belle-sip")
23a96055 485 (version "4.4.34")
e7859da1
RG
486 (source
487 (origin
23a96055
RG
488 (method git-fetch)
489 (uri (git-reference
c2a86746 490 (url "https://gitlab.linphone.org/BC/public/belle-sip.git")
23a96055
RG
491 (commit version)))
492 (file-name (git-file-name name version))
e7859da1 493 (sha256
23a96055 494 (base32 "1kknnlczq7dpqaj1dwxvy092dzrqjy11ndkv90rqwmdryigkjk6z"))))
e7859da1 495 (build-system cmake-build-system)
c2a86746 496 (outputs '("out" "tester"))
e7859da1 497 (arguments
3c7ff0be
RG
498 `(#:configure-flags (list "-DENABLE_STATIC=NO"
499 "-DENABLE_MDNS=ON")
e7859da1
RG
500 #:phases
501 (modify-phases %standard-phases
502 (add-after 'unpack 'patch
3c7ff0be
RG
503 (lambda* (#:key inputs #:allow-other-keys)
504 ;; Fix mDNS dependency.
505 (let* ((avahi (assoc-ref inputs "avahi")))
506 (substitute* (find-files "." "CMakeLists.txt")
507 (("find_package\\(DNSSD REQUIRED\\)")
508 "set(DNSSD_FOUND 1)")
509 (("\\$\\{DNSSD_INCLUDE_DIRS\\}")
510 (string-append avahi "/include/avahi-compat-libdns_sd"))
511 (("\\$\\{DNSSD_LIBRARIES\\}")
512 "dns_sd")))
e7859da1 513 (substitute* "src/CMakeLists.txt"
1988ef21
RG
514 ;; ANTLR would use multithreaded DFA generation otherwise,
515 ;; which would not be reproducible.
c2a86746
RG
516 (("-Xmultithreaded ") ""))))
517 (delete 'check) ;move after install
518 (add-after 'install 'separate-outputs
519 (lambda* (#:key outputs #:allow-other-keys)
520 (let* ((out (assoc-ref outputs "out"))
521 (tester (assoc-ref outputs "tester"))
522 (tester-name "belle_sip_tester"))
523 (for-each mkdir-p (list (string-append tester "/bin")
524 (string-append tester "/share")))
525 (rename-file (string-append out "/bin")
526 (string-append tester "/bin"))
527 (rename-file (string-append out "/share/" tester-name)
528 (string-append tester "/share/" tester-name)))))
529 (add-after 'separate-outputs 'check
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let ((tester (string-append (assoc-ref outputs "tester")
532 "/bin/belle_sip_tester")))
533 (for-each (lambda (suite-name)
534 (invoke tester "--suite" suite-name))
535 (list "Object inheritance"
536 "SIP URI"
537 "FAST SIP URI"
538 "FAST SIP URI 2"
539 "Generic uri"
540 "Headers"
541 "Core"
542 "SDP"
543 ;;"Resolver"
544 "Message"
545 "Authentication helper"
546 ;;"Register"
547 ;;"Dialog"
548 "Refresher"
549 ;;"HTTP stack"
550 "Object"))))))))
e7859da1 551 (inputs
3c7ff0be
RG
552 `(("avahi" ,avahi)
553 ("bctoolbox" ,bctoolbox)
e7859da1
RG
554 ("zlib" ,zlib)))
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
721 `(("bctoolbox" ,bctoolbox)
722 ("belle-sip" ,belle-sip)
723 ("soci" ,soci)))
724 (synopsis "Belledonne Communications Encryption Library")
725 (description "LIME is an encryption library for one-to-one and group
726instant messaging, allowing users to exchange messages privately and
727asynchronously. It supports multiple devices per user and multiple users per
728device.")
729 (home-page "https://linphone.org/technical-corner/lime")
730 (license license:gpl3+)))
731
9732910d
RG
732(define-public liblinphone
733 (package
734 (name "liblinphone")
735 (version "3.12.0")
736 (source
737 (origin
738 (method url-fetch)
739 (uri
740 (string-append "https://www.linphone.org/releases/sources/linphone"
741 "/linphone-" version ".tar.gz"))
742 (sha256
743 (base32 "0phhkx55xdyg28d4wn8l8q4yvsmdgzmjiw584d4s190sq1azm91x"))))
9c63165d 744 (outputs '("out" "doc" "tester"))
9732910d
RG
745 (build-system cmake-build-system)
746 (arguments
747 `(#:tests? #f ; No test target
748 #:configure-flags
1988ef21
RG
749 (list (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
750 (string-append (assoc-ref %build-inputs "gtk2")
751 "/lib/gtk-2.0/include"))
752 (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
753 (string-append (assoc-ref %build-inputs "glib")
754 "/lib/glib-2.0/include"))
755 "-DENABLE_STATIC=NO" ; Not required
756 "-DENABLE_STRICT=NO"
757 "-DENABLE_GTK_UI=YES") ; for legacy UI
41169f21
RG
758 #:imported-modules (,@%cmake-build-system-modules
759 (guix build glib-or-gtk-build-system))
760 #:modules ((guix build cmake-build-system)
761 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
762 (guix build utils))
02b32cdd
DM
763 #:phases
764 (modify-phases %standard-phases
765 (add-after 'unpack 'patch
766 (lambda _
767 (substitute* "gtk/main.c"
768 (("#include \"liblinphone_gitversion.h\"")
769 ""))
9c63165d
MC
770 #t))
771 (add-after 'install 'separate-outputs
772 (lambda* (#:key outputs #:allow-other-keys)
773 (let* ((out (assoc-ref outputs "out"))
774 (doc (assoc-ref outputs "doc"))
775 (tester (assoc-ref outputs "tester"))
776 (tester-name (string-append ,name "_tester")))
777 ;; Copy the tester executable.
778 (mkdir-p (string-append tester "/bin"))
779 (rename-file (string-append out "/bin/" tester-name)
780 (string-append tester "/bin/" tester-name))
781 ;; Copy the tester data files.
782 (mkdir-p (string-append tester "/share/"))
783 (rename-file (string-append out "/share/" tester-name)
784 (string-append tester "/share/" tester-name))
785 ;; Copy the HTML and XML documentation.
786 (copy-recursively
787 (string-append out "/share/doc/linphone-" ,version)
788 (string-append doc "/share/doc/" ,name "-" ,version))
789 (delete-file-recursively
790 (string-append out "/share/doc/linphone-" ,version))
791 #t)))
0c7f478e
MR
792 (add-after 'install 'install-man-pages
793 (lambda* (#:key outputs #:allow-other-keys)
794 (let* ((out (assoc-ref outputs "out"))
795 (man (string-append out "/share/man/man1")))
796 (for-each (lambda (file)
797 (install-file file man))
798 (find-files ".." ".*.1$"))
799 #t)))
9c63165d
MC
800 (add-after 'separate-outputs 'glib-or-gtk-compile-schemas
801 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
802 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
803 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
9732910d 804 (native-inputs
1ae43257
MC
805 `(("gettext" ,gettext-minimal)
806 ("udev" ,eudev) ;for libudev.h
807 ;; For generating the C++ wrappers.
808 ("dot" ,graphviz)
9732910d 809 ("doxygen" ,doxygen)
9732910d 810 ("python" ,python)
1ae43257
MC
811 ("pystache" ,python-pystache)
812 ("six" ,python-six)))
9732910d
RG
813 (inputs
814 `(("bctoolbox" ,bctoolbox)
815 ("belcard" ,belcard)
816 ("bellesip" ,belle-sip)
1628d57b 817 ("bzrtp" ,bzrtp)
1ae43257 818 ("iconv" ,libiconv)
02b32cdd
DM
819 ("glib" ,glib)
820 ("gtk2" ,gtk+-2)
9732910d 821 ("mediastreamer2" ,mediastreamer2)
02b32cdd 822 ("notify" ,libnotify)
9732910d 823 ("ortp" ,ortp)
9732910d 824 ("sqlite" ,sqlite)
1ae43257
MC
825 ("xml2" ,libxml2)
826 ("zlib" ,zlib)))
9732910d
RG
827 (synopsis "Belledonne Communications Softphone Library")
828 (description "Liblinphone is a high-level SIP library integrating
829all calling and instant messaging features into an unified
830easy-to-use API. It is the cross-platform VoIP library on which the
831Linphone application is based on, and that anyone can use to add audio
832and video calls or instant messaging capabilities to an application.")
833 (home-page "https://gitlab.linphone.org/BC/public/liblinphone")
834 (license license:gpl2+)))
14e73f8f 835
c0cce205
RG
836(define-public linphoneqt
837 (package
838 (name "linphoneqt")
839 (version "4.1.1")
840 (source
841 (origin
842 (method url-fetch)
843 (uri
844 (string-append "https://www.linphone.org/releases/sources/" name
845 "/" name "-" version ".tar.gz"))
846 (sha256
45fd28f7
RG
847 (base32 "1g2zrr9li0g1hgs6vys06vr98h5dx36z22hx7a6ry231536c002a"))
848 (patches (search-patches "linphoneqt-tabbutton.patch"))))
c0cce205
RG
849 (build-system qt-build-system)
850 (arguments
851 `(#:tests? #f ; No test target
852 #:phases
c0cce205 853 (modify-phases %standard-phases
a4f1a7e2
MC
854 (add-after 'unpack 'fix-cmake-error
855 (lambda _
856 ;; This is fixed in commit efed2fd8 of the master branch.
857 (substitute* "CMakeLists.txt"
858 (("js)\\$\"")
859 "js$\""))
860 #t))
861 (add-after 'unpack 'set-version-string
c0cce205
RG
862 (lambda _
863 (substitute* "src/app/AppController.cpp"
864 (("LINPHONE_QT_GIT_VERSION")
a4f1a7e2 865 (format #f "~s" ,version)))
48acdefe
MC
866 #t))
867 (add-after 'install 'extend-shared-resources
868 ;; Not using the FHS exposes an issue where the client refers to
869 ;; its own "share" directory, which lacks sound files installed by
870 ;; liblinphone.
871 (lambda* (#:key inputs outputs #:allow-other-keys)
872 (let ((liblinphone (assoc-ref inputs "linphone"))
873 (out (assoc-ref outputs "out")))
874 (symlink (string-append liblinphone "/share/sounds")
875 (string-append out "/share/sounds"))
876 #t))))))
c0cce205
RG
877 (native-inputs
878 `(("qttools" ,qttools)))
879 (inputs
880 `(("bctoolbox" ,bctoolbox)
881 ("belcard" ,belcard)
882 ("bellesip" ,belle-sip)
883 ("linphone" ,liblinphone)
884 ("mediastreamer2" ,mediastreamer2)
885 ("qtbase" ,qtbase)
886 ("qtdeclarative" ,qtdeclarative)
887 ("qtgraphicaleffects" ,qtgraphicaleffects)
45fd28f7 888 ("qtquickcontrols" ,qtquickcontrols)
c0cce205
RG
889 ("qtquickcontrols2" ,qtquickcontrols2)
890 ("qtsvg" ,qtsvg)))
a4f1a7e2
MC
891 (synopsis "Desktop client for the Linphone SIP softphone")
892 (description "Linphone is a SIP softphone for voice and video over IP calling
893(VoIP) and instant messaging. Amongst its features are:
894@itemize
895@item High Definition (HD) audio and video calls
896@item Multiple call management (pause and resume)
897@item Call transfer
898@item Audio conferencing (merge calls into a conference call)
899@item Call recording and replay (audio only)
900@item Instant Messaging with message delivery status (IMDN)
901@item Picture and file sharing
902@item Echo cancellation
903@item Secure user authentication using TLS client certificates
904@item SRTP, zRTP and SRTP-DTLS voice and video encryption
905@item Telephone tone (DTMF) support using SIP INFO or RFC 4733
906@item Audio codecs: opus, speex, g711, g729, gsm, iLBC, g722, SILK, etc.
907@item Video codecs: VP8, H.264 and H.265 with resolutions up to 1080P, MPEG4
908@end itemize")
c0cce205
RG
909 (home-page "https://gitlab.linphone.org/BC/public/linphone-desktop")
910 (license license:gpl2+)))
911
14e73f8f
RG
912(define-public msopenh264
913 (package
914 (name "msopenh264")
915 (version "1.2.1")
916 (source
917 (origin
918 (method url-fetch)
919 (uri
920 (string-append "https://www.linphone.org/releases/sources/plugins/"
921 name "/" name "-" version ".tar.gz"))
922 (sha256
923 (base32 "0rdxgazm52560g52pp6mp3mwx6j1z3h2zyizzfycp8y8zi92fqm8"))
924 (patches
925 (list
926 ;; For support for OpenH264 version >= 2.
927 (origin
928 (method url-fetch)
929 (uri
1988ef21
RG
930 (string-append "https://gitlab.linphone.org/BC/public/msopenh264/"
931 "commit/493d147d28c9a0f788ba4e50b47a1ce7b18bf326"
932 ".diff"))
14e73f8f
RG
933 (file-name "msopenh264-openh264.patch")
934 (sha256
1988ef21
RG
935 (base32
936 "0mmd7nz5n9ian4rcwn200nldmy5j0dpdrna7r32rqnaw82bx3kdb")))))))
14e73f8f
RG
937 (build-system cmake-build-system)
938 (arguments
939 `(#:tests? #f ; No test target
940 #:configure-flags
1988ef21 941 (list "-DENABLE_STATIC=NO"))) ; Not required
14e73f8f
RG
942 (inputs
943 `(("mediastreamer2" ,mediastreamer2)
944 ("openh264" ,openh264)
945 ("ortp" ,ortp)))
946 (synopsis "Media Streamer H.264 Codec")
947 (description "MsOpenH264 is an H.264 encoder/decoder plugin for
948mediastreamer2 based on the openh264 library.")
949 (home-page "https://gitlab.linphone.org/BC/public/msopenh264")
950 (license license:gpl2+)))
f689d3d7
RG
951
952(define-public mssilk
953 (package
954 (name "mssilk")
955 (version "1.1.1")
956 (source
957 (origin
958 (method url-fetch)
959 (uri
960 (string-append "https://www.linphone.org/releases/sources/plugins/"
961 name "/" name "-" version ".tar.gz"))
962 (sha256
963 (base32 "07ip0vd29d1n98lnqs5wpimcsmpm65yl7g5vk4hbqghcbsjw94lj"))))
964 (build-system cmake-build-system)
965 (arguments
966 `(#:tests? #f ; No test target
967 #:configure-flags
1988ef21 968 (list "-DENABLE_STATIC=NO"))) ; Not required
f689d3d7
RG
969 (inputs
970 `(("mediastreamer2" ,mediastreamer2)
971 ("ortp" ,ortp)))
972 (synopsis "Media Streamer SILK Codec")
1988ef21
RG
973 (description "MSSILK is a plugin of MediaStreamer, adding support for AMR
974codec. It is based on the Skype's SILK implementation.")
f689d3d7
RG
975 (home-page "https://gitlab.linphone.org/BC/public/mssilk")
976 (license license:gpl2+)))
fe8f1c0b
RG
977
978(define-public mswebrtc
979 (package
980 (name "mswebrtc")
981 (version "1.1.1")
982 (source
983 (origin
984 (method url-fetch)
985 (uri
986 (string-append "https://www.linphone.org/releases/sources/plugins/"
987 name "/" name "-" version ".tar.gz"))
988 (sha256
989 (base32 "1wj28hl9myhshqmn64xg0jf07aw75gmnilb5rff6rcbdxim87mqr"))))
990 (build-system cmake-build-system)
991 (arguments
992 `(#:tests? #f ; No test target
993 #:configure-flags
994 (list
1988ef21 995 "-DENABLE_STATIC=NO"))) ; Not required
fe8f1c0b
RG
996 (inputs
997 `(("bctoolbox" ,bctoolbox)
998 ("mediastreamer2" ,mediastreamer2)
999 ("ortp" ,ortp)))
1000 (synopsis "Media Streamer WebRTC Codec")
1001 (description "MSWebRTC is a plugin of MediaStreamer, adding support for
1002WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.")
1003 (home-page "https://gitlab.linphone.org/BC/public/mswebrtc")
1004 (license license:gpl2+)))
b8920169
RG
1005
1006(define-public msamr
1007 (package
1008 (name "msamr")
1009 (version "1.1.3")
1010 (source
1011 (origin
1012 (method url-fetch)
1013 (uri
1014 (string-append "https://www.linphone.org/releases/sources/plugins/"
1015 name "/" name "-" version ".tar.gz"))
1016 (sha256
1017 (base32 "16c9f3z4wnj73k7y8gb0fgpr4axsm7b5zrbjvy8vsgz9gyg3agm5"))))
1018 (build-system cmake-build-system)
1019 (arguments
1020 `(#:tests? #f ; No test target
1021 #:configure-flags
1988ef21
RG
1022 (list "-DENABLE_STATIC=NO" ; Not required
1023 "-DENABLE_WIDEBAND=YES")))
b8920169
RG
1024 (inputs
1025 `(("mediastreamer2" ,mediastreamer2)
1026 ("opencoreamr" ,opencore-amr)
1027 ("ortp" ,ortp)
1028 ("voamrwbenc" ,vo-amrwbenc)))
1029 (synopsis "Media Streamer AMR Codec")
1988ef21
RG
1030 (description "MSAMR is a plugin of MediaStreamer, adding support for AMR
1031codec. It is based on the opencore-amr implementation.")
b8920169
RG
1032 (home-page "https://gitlab.linphone.org/BC/public/msamr")
1033 (license license:gpl3+)))