;;; GNU Guix --- Functional package management for GNU ;;; ;;; Copyright © 2020, 2021 Raghav Gururajan ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2023 Ricardo Wurmus ;;; Copyright © 2023 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see
aboutsummaryrefslogtreecommitdiff
blob: 70d5ba2d3093774357ebfcbcc063e76462f32aa5 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2016, 2017, 2019, 2023 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-containers)
  #:use-module (guix utils)
  #:use-module (guix build syscalls)
  #:use-module (gnu build linux-container)
  #:use-module ((gnu system linux-container)
                #:select (eval/container))
  #:use-module (gnu system file-systems)
  #:use-module (guix store)
  #:use-module (guix monads)
  #:use-module (guix gexp)
  #:use-module (guix derivations)
  #:use-module (guix tests)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64)
  #:use-module (ice-9 match)
  #:use-module ((ice-9 ftw) #:select (scandir)))

(define (assert-exit x)
  (primitive-exit (if x 0 1)))

(test-begin "containers")

;; Skip these tests unless user namespaces are available and the setgroups
;; file (introduced in Linux 3.19 to address a security issue) exists.
(define (skip-if-unsupported)
  (unless (and (user-namespace-supported?)
               (unprivileged-user-namespace-supported?)
               (setgroups-supported?))
    (test-skip 1)))

(skip-if-unsupported)
(test-assert "call-with-container, exit with 0 when there is no error"
  (zero?
   (call-with-container '() (const #t) #:namespaces '(user))))

(skip-if-unsupported)
(test-assert "call-with-container, user namespace"
  (zero?
   (call-with-container '()
     (lambda ()
       ;; The user is root within the new user namespace.
       (assert-exit (and (zero? (getuid)) (zero? (getgid)))))
     #:namespaces '(user))))

(skip-if-unsupported)
(test-assert "call-with-container, user namespace, guest UID/GID"
  (zero?
   (call-with-container '()
     (lambda ()
       (assert-exit (and (= 42 (getuid)) (= 77 (getgid)))))
     #:guest-uid 42
     #:guest-gid 77
     #:namespaces '(user))))

(skip-if-unsupported)
(test-assert "call-with-container, uts namespace"
  (zero?
   (call-with-container '()
     (lambda ()
       ;; The user is root within the container and should be able to change
       ;; the hostname of that container.
       (sethostname "test-container")
       (primitive-exit 0))
     #:namespaces '(user uts))))

(skip-if-unsupported)
(test-assert "call-with-container, pid namespace"
  (zero?
   (call-with-container '()
     (lambda ()
       (match (primitive-fork)
         (0
          ;; The first forked process in the new pid namespace is pid 2.
          (assert-exit (= 2 (getpid))))
         (pid
          (primitive-exit
           (match (waitpid pid)
             ((_ . status)
              (status:exit-val status)))))))
     #:namespaces '(user pid))))

(skip-if-unsupported)
(test-assert "call-with-container, mnt namespace"
  (zero?
   (call-with-container (list (file-system
                                (device "none")
                                (mount-point "/testing")
                                (type "tmpfs")
                                (check? #f)))
     (lambda ()
       (assert-exit (file-exists? "/testing")))
     #:namespaces '(user mnt))))

(skip-if-unsupported)
(test-equal "call-with-container, mnt namespace, wrong bind mount"
  `(system-error ,ENOENT)
  ;; An exception should be raised; see <http://bugs.gnu.org/23306>.
  (catch 'system-error
    (lambda ()
      (call-with-container (list (file-system
                                   (device "/does-not-exist")
                                   (mount-point "/foo")
                                   (type "none")
                                   (flags '(bind-mount))
                                   (check? #f)))
        (const #t)
        #:namespaces '(user mnt)))
    (lambda args
      (list 'system-error (system-error-errno args)))))

(skip-if-unsupported)
(test-assert "call-with-container, all namespaces"
  (zero?
   (call-with-container '()
     (lambda ()
       (primitive-exit 0)))))

(skip-if-unsupported)
(test-assert "call-with-container, mnt namespace, root permissions"
  (zero?
   (call-with-container '()
     (lambda ()
       (assert-exit (= #o755 (stat:perms (lstat "/")))))
     #:namespaces '(user mnt))))

(skip-if-unsupported)
(test-assert "container-excursion"
  (call-with-temporary-directory
   (lambda (root)
     ;; Two pipes: One for the container to signal that the test can begin,
     ;; and one for the parent to signal to the container that the test is
     ;; over.
     (match (list (pipe) (pipe))
       (((start-in . start-out) (end-in . end-out))
        (define (container)
          (close end-out)
          (close start-in)
          ;; Signal for the test to start.
          (write 'ready start-out)
          (close start-out)
          ;; Wait for test completion.
          (read end-in)
          (close end-in))

        (define (namespaces pid)
          (let ((pid (number->string pid)))
            (map (lambda (ns)
                   (readlink (string-append "/proc/" pid "/ns/" ns)))
                 '("user" "ipc" "uts" "net" "pid" "mnt"))))

        (let* ((pid (run-container root '() %namespaces 1 container))
               (container-namespaces (namespaces pid))
               (result
                (begin
                  (close start-out)
                  ;; Wait for container to be ready.
                  (read start-in)
                  (close start-in)
                  (container-excursion pid
                    (lambda ()
                      ;; Check that all of the namespace identifiers are
                      ;; the same as the container process.
                      (assert-exit
                       (equal? container-namespaces
                               (namespaces (getpid)))))))))
          (close end-in)
          ;; Stop the container.
          (write 'done end-out)
          (close end-out)
          (waitpid pid)
          (zero? result)))))))

(skip-if-unsupported)
(test-equal "container-excursion, same namespaces"
  42
  ;; The parent and child are in the same namespaces.  'container-excursion'
  ;; should notice that and avoid calling 'setns' since that would fail.
  (status:exit-val
   (container-excursion (getpid)
     (lambda ()
       (primitive-exit 42)))))

(skip-if-unsupported)
(test-assert "container-excursion*"
  (call-with-temporary-directory
   (lambda (root)
     (define (namespaces pid)
       (let ((pid (number->string pid)))
         (map (lambda (ns)
                (readlink (string-append "/proc/" pid "/ns/" ns)))
              '("user" "ipc" "uts" "net" "pid" "mnt"))))

     (let* ((pid    (run-container root '()
                                   %namespaces 1
                                   (lambda ()
                                     (sleep 100))))
            (expected (namespaces pid))
            (result (container-excursion* pid
                      (lambda ()
                        (namespaces 1)))))
       (kill pid SIGKILL)
       (equal? result expected)))))

(skip-if-unsupported)
(test-equal "container-excursion*, same namespaces"
  42
  (container-excursion* (getpid)
    (lambda ()
      (* 6 7))))

(skip-if-unsupported)
(test-equal "container-excursion*, /proc"
  '("1" "2")
  (call-with-temporary-directory
   (lambda (root)
     (let* ((pid    (run-container root '()
                                   %namespaces 1
                                   (lambda ()
                                     (sleep 100))))
            (result (container-excursion* pid
                      (lambda ()
                        ;; We expect to see exactly two processes in this
                        ;; namespace.
                        (scandir "/proc"
                                 (lambda (file)
                                   (char-set-contains?
                                    char-set:digit
                                    (string-ref file 0))))))))
       (kill pid SIGKILL)
       result))))

(skip-if-unsupported)
(test-equal "eval/container, exit status"
  42
  (let* ((store  (open-connection-for-tests))
         (status (run-with-store store
                   (eval/container #~(exit 42)))))
    (close-connection store)
    (status:exit-val status)))

(skip-if-unsupported)
(test-assert "eval/container, writable user mapping"
  (call-with-temporary-directory
   (lambda (directory)
     (define store
       (open-connection-for-tests))
     (define result
       (string-append directory "/r"))
     (define requisites*
       (store-lift requisites))

     (call-with-output-file result (const #t))
     (run-with-store store
       (mlet %store-monad ((status (eval/container
                                    #~(begin
                                        (use-modules (ice-9 ftw))
                                        (call-with-output-file "/result"
                                          (lambda (port)
                                            (write (scandir #$(%store-prefix))
                                                   port))))
                                    #:mappings
                                    (list (file-system-mapping
                                           (source result)
                                           (target "/result")
                                           (writable? #t)))))
                           (reqs   (requisites*
                                    (list (derivation->output-path
                                           (%guile-for-build))))))
         (close-connection store)
         (return (and (zero? (pk 'status status))
                      (lset= string=? (cons* "." ".." (map basename reqs))
                             (pk (call-with-input-file result read))))))))))

(skip-if-unsupported)
(test-assert "eval/container, non-empty load path"
  (call-with-temporary-directory
   (lambda (directory)
     (define store
       (open-connection-for-tests))
     (define result
       (string-append directory "/r"))
     (define requisites*
       (store-lift requisites))

     (mkdir result)
     (run-with-store store
       (mlet %store-monad ((status (eval/container
                                    (with-imported-modules '((guix build utils))
                                      #~(begin
                                          (use-modules (guix build utils))
                                          (mkdir-p "/result/a/b/c")))
                                    #:mappings
                                    (list (file-system-mapping
                                           (source result)
                                           (target "/result")
                                           (writable? #t))))))
         (close-connection store)
         (return (and (zero? status)
                      (file-is-directory?
                       (string-append result "/a/b/c")))))))))

(test-end)
-DENABLE_STATIC=NO" "-DENABLE_PCAP=YES" ;; Do not fail on compile warnings. "-DENABLE_STRICT=NO" "-DENABLE_PORTAUDIO=YES" "-DENABLE_G729B_CNG=YES") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-version (lambda _ (substitute* "CMakeLists.txt" (("VERSION [0-9]+\\.[0-9]+\\.[0-9]+") (string-append "VERSION " #$version))))) (add-after 'unpack 'patch-source (lambda _ (substitute* "src/otherfilters/mspcapfileplayer.c" (("O_BINARY") "L_INCR")))) (add-before 'check 'pre-check (lambda _ ;; Tests require a running X server. (system "Xvfb :1 +extension GLX &") (setenv "DISPLAY" ":1") ;; Tests write to $HOME. (setenv "HOME" (getenv "TEMP")))) (delete 'check) ;move after install (add-after 'install 'separate-outputs (lambda _ (let ((tester-name (string-append #$name "_tester")) (doc-name (string-append #$name "-" #$version))) (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share") (string-append #$output:doc "/share/doc"))) ;; Move the tester executable. (rename-file (string-append #$output "/bin/" tester-name) (string-append #$output:tester "/bin/" tester-name)) ;; Move the tester data files. (rename-file (string-append #$output "/share/" tester-name) (string-append #$output:tester "/share/" tester-name)) ;; Move the HTML documentation. (rename-file (string-append #$output "/share/doc/" doc-name) (string-append #$output:doc "/share/doc/" doc-name))))) (add-after 'separate-outputs 'check (lambda _ (let ((tester (string-append #$output:tester "/bin/mediastreamer2_tester"))) (for-each (lambda (suite-name) (invoke tester "--suite" suite-name)) ;; Some tests fail, due to requiring access to the ;; sound card or the network. (list "Basic Audio" ;; "Sound Card" ;; "AdaptiveAlgorithm" ;; "AudioStream" ;; "VideoStream" "H26x Tools" "Framework" ;; "Player" "TextStream")))))))) (native-inputs (list graphviz doxygen python-wrapper xorg-server-for-tests)) (inputs (list alsa-lib bcg729 bcmatroska2 bctoolbox ffmpeg-4 glew glu mesa-utils gsm mesa opus ortp libpcap portaudio pulseaudio spandsp speex speexdsp libsrtp libtheora libjpeg-turbo v4l-utils libvpx libx11 libxv bzrtp)) (synopsis "Belledonne Communications Streaming Engine") (description "Mediastreamer2 is a powerful and lightweight streaming engine for telephony applications. This media processing and streaming toolkit is responsible for receiving and sending all multimedia streams in Linphone, including media capture, encoding and decoding, and rendering.") (home-page "https://linphone.org/technical-corner/mediastreamer2") (license license:gpl3+))) (define-public lime (package (name "lime") (version "5.2.49") (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/lime.git") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1mglnypxl3glwvwf2h5q4ikbm6wbcd9pb7kdws8zajjhk9q803jr")))) (build-system cmake-build-system) (outputs '("out" "doc")) (arguments `(#:configure-flags (list "-DENABLE_STATIC=NO" "-DENABLE_C_INTERFACE=YES" "-DENABLE_DOC=YES") #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-source (lambda _ ;; Disable tests that require networking. (substitute* "tester/CMakeLists.txt" (("add_test\\(?.*\"Hello World\"\\)") "") (("add_test\\(?.*\"lime\"\\)") "") (("add_test\\(?.*\"FFI\"\\)") "") (("add_test\\(?.*\"Multidomains\"\\)") "") (("add_test\\(?.*\"Lime server\"\\)") "")))) (add-after 'build 'build-doc (lambda _ (invoke "make" "doc"))) (add-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) (let* ((doc (assoc-ref outputs "doc")) (dir (string-append doc "/share/doc")) (dest (string-append dir "/" ,name "-" ,version))) (mkdir-p dest) (copy-recursively "doc" dest))))))) (native-inputs `(("dot" ,graphviz) ("doxygen" ,doxygen))) (inputs (list bctoolbox belle-sip soci)) (synopsis "Belledonne Communications Encryption Library") (description "LIME is an encryption library for one-to-one and group instant messaging, allowing users to exchange messages privately and asynchronously. It supports multiple devices per user and multiple users per device.") (home-page "https://linphone.org/technical-corner/lime") (license license:gpl3+))) (define-public liblinphone (package (name "liblinphone") (version "5.2.50") (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/liblinphone.git") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1lvbva234rmck57cxgswgqqvnq8r58i0ls4qgpymrxdfj74rinxj")))) (outputs '("out" "tester")) (build-system cmake-build-system) (arguments (list #:tests? #f ; Tests require networking #:configure-flags '(list "-DENABLE_FLEXIAPI=NO" ;requires jsoncpp, but it cannot be found "-DENABLE_STATIC=NO" "-DENABLE_DOC=NO" ;requires unpackaged javasphinx "-DENABLE_LDAP=YES" "-DENABLE_STRICT=NO") #:phases #~(modify-phases %standard-phases (add-after 'install 'separate-outputs (lambda* (#:key outputs #:allow-other-keys) (let ((tester-name (string-append #$name "_tester"))) (for-each mkdir-p (list (string-append #$output:tester "/bin") (string-append #$output:tester "/share"))) (rename-file (string-append #$output "/bin/" tester-name) (string-append #$output:tester "/bin/" tester-name)) (rename-file (string-append #$output "/bin/groupchat_benchmark") (string-append #$output:tester "/bin/groupchat_benchmark")) (rename-file (string-append #$output "/share/" tester-name) (string-append #$output:tester "/share/" tester-name)))))))) (native-inputs (list graphviz doxygen gettext-minimal perl python-wrapper python-pystache python-six eudev)) (inputs (list bctoolbox belcard belle-sip belr bzrtp lime libnotify libxml2 mediastreamer2 openldap-for-linphone ortp soci sqlite xsd zlib zxing-cpp)) (synopsis "Belledonne Communications Softphone Library") (description "Liblinphone is a high-level SIP library integrating all calling and instant messaging features into an unified easy-to-use API. It is the cross-platform VoIP library on which the Linphone application is based on, and that anyone can use to add audio and video calls or instant messaging capabilities to an application.") (home-page "https://linphone.org/technical-corner/liblinphone") (license license:gpl3+))) (define-public linphone-desktop (package (name "linphone-desktop") (version "5.0.14") (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/linphone-desktop") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0glrfsp087ni5hn6x6p4f6y63r4nyp061yyy0rfgddbxkzdqi2j1")) (patches (search-patches "linphone-desktop-without-sdk.patch")))) (build-system qt-build-system) (outputs '("out" "debug")) (arguments (list #:tests? #f ; No test target #:configure-flags #~(list (string-append "-DFULL_VERSION=" #$version) (string-append "-DCMAKE_INSTALL_PREFIX=" #$output) (string-append "-DCMAKE_INSTALL_BINDIR=" #$output "/bin") (string-append "-DCMAKE_INSTALL_DATAROOTDIR=" #$output "/share") (string-append "-DCMAKE_INSTALL_LIBDIR=" #$output "/lib") "-DENABLE_UPDATE_CHECK=NO" "-DENABLE_DAEMON=YES" "-DENABLE_CONSOLE_UI=YES") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'pre-configure (lambda _ (make-file-writable "linphone-app/linphoneqt_version.cmake") (substitute* "linphone-app/linphoneqt_version.cmake" (("\\$\\{GUIX-SET-VERSION\\}") #$version)))) (add-before 'install 'pre-install (lambda _ (mkdir-p (string-append #$output "/share/linphone")) (symlink (string-append #$(this-package-input "liblinphone") "/share/sounds") (string-append #$output "/share/sounds")))) (add-after 'install 'post-install (lambda _ (let* ((liblinphone #$(this-package-input "liblinphone")) (grammar-dest (string-append #$output "/share/belr/grammars"))) ;; Remove unnecessary Qt configuration file. (delete-file (string-append #$output "/bin/qt.conf")) ;; Not using the FHS exposes an issue where the client ;; refers to its own directories, which lacks files ;; installed by the dependencies. (for-each (lambda (file) (symlink file (string-append #$output "/lib/" (basename file)))) (find-files (string-append liblinphone "/lib"))) (symlink (string-append liblinphone "/share/linphone/rootca.pem") (string-append #$output "/share/linphone/rootca.pem")) (mkdir-p (dirname grammar-dest)) (symlink (string-append liblinphone "/share/belr/grammars") grammar-dest))))))) (native-inputs (list pkg-config qttools-5)) (inputs (list bctoolbox belcard belr liblinphone mediastreamer2 ortp qtbase-5 qtdeclarative-5 qtgraphicaleffects qtquickcontrols-5 qtquickcontrols2-5 qtsvg-5)) (synopsis "Desktop client for the Linphone SIP softphone") (description "Linphone is a SIP softphone for voice and video over IP calling (VoIP) and instant messaging. Amongst its features are: @itemize @item High Definition (HD) audio and video calls @item Multiple call management (pause and resume) @item Call transfer @item Audio conferencing (merge calls into a conference call) @item Call recording and replay (audio only) @item Instant Messaging with message delivery status (IMDN) @item Picture and file sharing @item Echo cancellation @item Secure user authentication using TLS client certificates @item SRTP, zRTP and SRTP-DTLS voice and video encryption @item Telephone tone (DTMF) support using SIP INFO or RFC 4733 @item Audio codecs: opus, speex, g711, g729, gsm, iLBC, g722, SILK, etc. @item Video codecs: VP8, H.264 and H.265 with resolutions up to 1080P, MPEG4 @end itemize") (home-page "https://linphone.org/technical-corner/linphone") (license license:gpl3+))) (define-public msopenh264 (let ((commit "88697cc95140017760d6da408cb0efdc5e86e40a") (revision "0")) (package (name "msopenh264") (version (git-version "1.2.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/msopenh264.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "10y3b6s934f2wbsf60b3p0g6hffizjqrj5in8l4sida2fjdxlwwy")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; No test target #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required (inputs (list bctoolbox mediastreamer2 openh264 ortp)) (synopsis "Media Streamer H.264 Codec") (description "MsOpenH264 is an H.264 encoder/decoder plugin for mediastreamer2 based on the openh264 library.") (home-page "https://gitlab.linphone.org/BC/public/msopenh264") (license license:gpl2+)))) (define-public mssilk (let ((commit "dd0f31ee795faa7ea89e601b072dae4cd1df7e3f") (revision "0")) (package (name "mssilk") (version (git-version "1.1.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/mssilk.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1dann5fnzqp6wjlwc6bl2k9b6rvn6bznqb3qsi1kgv9dnq44cbr0")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; No test target #:configure-flags (list "-DENABLE_STATIC=NO"))) ; Not required (inputs (list bctoolbox mediastreamer2 ortp)) (synopsis "Media Streamer SILK Codec") (description "MSSILK is a plugin of MediaStreamer, adding support for AMR codec. It is based on the Skype's SILK implementation.") (home-page "https://gitlab.linphone.org/BC/public/mssilk") (license license:gpl2+)))) (define-public mswebrtc (let ((commit "946ca706733f36a6b4923f04e569531125462d1d") (revision "0")) (package (name "mswebrtc") (version (git-version "1.1.1" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/mswebrtc") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1pfg9m6bpbv0f53nx72rdxhlyriax9pg4yj0gpwq8ha6lqnpwg1x")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; No test target #:configure-flags (list "-DENABLE_STATIC=NO") #:phases (modify-phases %standard-phases (add-after 'unpack 'copy-inputs (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((webrtc-from (assoc-ref inputs "webrtc")) (webrtc-to (string-append (getcwd) "/webrtc"))) (copy-recursively webrtc-from webrtc-to)) #t))))) (native-inputs `(("webrtc" ,(origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/external/webrtc") (commit "583acd27665cfadef8ab03eb85a768d308bd29dd"))) (file-name (git-file-name "webrtc-for-mswebrtc" version)) (sha256 (base32 "1maqychrgwy0z4zypa03qp726l2finw64z6cymdzhd58ql3p1lvm")))) ("python" ,python-wrapper))) (inputs (list bctoolbox mediastreamer2 ortp)) (synopsis "Media Streamer WebRTC Codec") (description "MSWebRTC is a plugin of MediaStreamer, adding support for WebRTC codec. It includes features from WebRTC, such as, iSAC and AECM.") (home-page "https://gitlab.linphone.org/BC/public/mswebrtc") (license license:gpl2+)))) (define-public msamr (let ((commit "5ab5c098299107048dfcbfc741f7392faef167bd") (revision "0")) (package (name "msamr") (version (git-version "1.1.3" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.linphone.org/BC/public/msamr") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1g79lw1qi1mlw3v1b0cixmqiwjql81gz9naakb15n8pvaag9aaqm")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; No test target #:configure-flags (list "-DENABLE_STATIC=NO" ; Not required "-DENABLE_WIDEBAND=YES"))) (inputs `(("bctoolbox" ,bctoolbox) ("mediastreamer2" ,mediastreamer2) ("opencoreamr" ,opencore-amr) ("ortp" ,ortp) ("voamrwbenc" ,vo-amrwbenc))) (synopsis "Media Streamer AMR Codec") (description "MSAMR is a plugin of MediaStreamer, adding support for AMR codec. It is based on the opencore-amr implementation.") (home-page "https://gitlab.linphone.org/BC/public/msamr") (license license:gpl3+))))