linphone.scm 43 KB

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