1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
3 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
4 ;;; Copyright © 2019, 2020 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages jami)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (gnu packages aidc)
24 #:use-module (gnu packages audio)
25 #:use-module (gnu packages autotools)
26 #:use-module (gnu packages base)
27 #:use-module (gnu packages boost)
28 #:use-module (gnu packages check)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages crypto)
31 #:use-module (gnu packages documentation)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gnome)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages hurd)
37 #:use-module (gnu packages libcanberra)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages multiprecision)
40 #:use-module (gnu packages networking)
41 #:use-module (gnu packages pcre)
42 #:use-module (gnu packages perl)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages pulseaudio)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages qt)
47 #:use-module (gnu packages serialization)
48 #:use-module (gnu packages sqlite)
49 #:use-module (gnu packages telephony)
50 #:use-module (gnu packages tls)
51 #:use-module (gnu packages upnp)
52 #:use-module (gnu packages video)
53 #:use-module (gnu packages webkit)
54 #:use-module (gnu packages xiph)
55 #:use-module (gnu packages xorg)
56 #:use-module (gnu packages)
57 #:use-module (guix build-system cmake)
58 #:use-module (guix build-system gnu)
59 #:use-module (guix download)
60 #:use-module (guix git-download)
61 #:use-module (guix packages)
62 #:use-module (guix utils))
64 (define %jami-version "20200401.1.6f090de")
66 (define* (jami-source #:key without-daemon)
69 (uri (string-append "https://dl.jami.net/release/tarballs/jami_"
72 (modules '((guix build utils)))
76 (delete-file-recursively "daemon/contrib"))
80 "0lryx9n1jn0jsw7s10pbwivqv0d5m3jdzhdhdyg5n02v72mjvkmh"))))
82 ;; Savoir-Faire Linux modifies many libraries to add features
83 ;; to Jami. This procedure makes applying patches to a given
85 (define jami-apply-dependency-patches
86 '(lambda* (#:key inputs dep-name patches)
87 (let ((patches-directory "sfl-patches"))
88 (mkdir-p patches-directory)
89 (invoke "tar" "-xvf" (assoc-ref inputs "sfl-patches")
90 "-C" patches-directory
91 "--strip-components=5"
92 (string-append "ring-project/daemon/contrib/src/"
96 (invoke "patch" "--force" "-p1" "-i"
97 (string-append patches-directory "/"
101 (define-public pjproject-jami
104 (name "pjproject-jami")
106 `(("sfl-patches" ,(jami-source))
107 ,@(package-native-inputs pjproject)))
110 ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
112 (list "--disable-oss"
115 ;; The following flag is Linux specific.
116 ,@(if (hurd-triplet? (or (%current-system)
117 (%current-target-system)))
121 "--disable-speex-aec"
122 "--disable-g711-codec"
123 "--disable-l16-codec"
124 "--disable-gsm-codec"
125 "--disable-g722-codec"
126 "--disable-g7221-codec"
127 "--disable-speex-codec"
128 "--disable-ilbc-codec"
129 "--disable-opencore-amr"
136 "--disable-libwebrtc"
138 "--with-external-srtp"
139 ;; We need -fPIC or else we get the following error when linking
140 ;; against pjproject-jami:
141 ;; relocation R_X86_64_32S against `.rodata' can not be used when
142 ;; making a shared object;
146 (modify-phases %standard-phases
147 (add-after 'unpack 'make-git-checkout-writable
149 (for-each make-file-writable (find-files "."))
151 (add-after 'unpack 'apply-patches
152 (lambda* (#:key inputs #:allow-other-keys)
153 (let ((jami-apply-dependency-patches ,jami-apply-dependency-patches))
155 ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
156 ;; WARNING: These amount for huge changes in pjproject.
157 (jami-apply-dependency-patches
159 #:dep-name "pjproject"
163 "0003-add-tcp-keep-alive"
164 "0004-multiple_listeners"
165 "0005-fix_ebusy_turn"
166 "0006-ignore_ipv6_on_transport_check"
168 "0008-fix_ioqueue_ipv6_sendto"
169 "0009-add-config-site"))
171 ;; TODO: We could use substitute-keyword-arguments instead of
172 ;; repeating the phases from pjproject, but somehow it does
174 (add-before 'build 'build-dep
175 (lambda _ (invoke "make" "dep")))
176 (add-before 'patch-source-shebangs 'autoconf
178 (invoke "autoconf" "-v" "-f" "-i" "-o"
179 "aconfigure" "aconfigure.ac")))
180 (add-before 'autoconf 'disable-some-tests
181 ;; Three of the six test programs fail due to missing network
184 (substitute* "Makefile"
185 (("selftest: pjlib-test pjlib-util-test pjnath-test pjmedia-test pjsip-test pjsua-test")
186 "selftest: pjlib-test pjlib-util-test pjmedia-test"))
189 (define-public libring
192 (version %jami-version)
193 (source (jami-source #:without-daemon #t))
194 (build-system gnu-build-system)
196 `(("alsa-lib" ,alsa-lib)
198 ("dbus-c++" ,dbus-c++)
206 ("libnatpmp" ,libnatpmp)
212 ("pulseaudio" ,pulseaudio)
213 ("libsamplerate" ,libsamplerate)
214 ("libsndfile" ,libsndfile)
216 ("speexdsp" ,speexdsp)
218 ("libvorbis" ,libvorbis)
220 ("libvdpau" ,libvdpau)
221 ("yaml-cpp" ,yaml-cpp)
224 ("libsecp256k1" ,libsecp256k1)
226 ("python-wrapper" ,python-wrapper)
227 ("restinio" ,restinio)
230 ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
231 ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
232 ("pjproject" ,pjproject-jami)))
234 `(("autoconf" ,autoconf)
235 ("automake" ,automake)
237 ("pkg-config" ,pkg-config)
240 ("perl" ,perl))) ; Needed for documentation.
242 `(#:tests? #f ; The tests fail to compile due to missing headers.
244 (modify-phases %standard-phases
245 (add-after 'unpack 'change-directory
249 (add-before 'build 'add-lib-dir
253 (synopsis "Distributed multimedia communications platform")
254 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
255 video and chat communication platform that requires no centralized server and
256 leaves the power of privacy in the hands of the user. It supports the SIP and
257 IAX protocols, as well as decentralized calling using P2P-DHT.
259 This package provides a library and daemon implementing the Jami core
261 (home-page "https://jami.net/")
262 (license license:gpl3+)))
264 (define-public libringclient
267 (name "libringclient")
268 (build-system cmake-build-system)
270 `(("libring" ,libring) ; For 'dring'.
271 ("qtbase" ,qtbase) ; Qt is included in several installed headers.
272 ("qttools" ,qttools)))
274 `(#:tests? #f ; There is no testsuite.
276 (list (string-append "-DRING_BUILD_DIR="
277 (assoc-ref %build-inputs "libring") "/include"))
279 (modify-phases %standard-phases
280 (add-after 'unpack 'change-directory
284 (add-before 'configure 'fix-dbus-interfaces-path
285 (lambda* (#:key inputs #:allow-other-keys)
286 (substitute* "CMakeLists.txt"
287 (("\\$\\{CMAKE_INSTALL_PREFIX\\}(/share/dbus-1/interfaces)" _ dbus-interfaces-path-suffix)
288 (string-append (assoc-ref inputs "libring")
289 dbus-interfaces-path-suffix))))))))
290 (synopsis "Distributed multimedia communications platform")
291 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
292 video and chat communication platform that requires no centralized server and
293 leaves the power of privacy in the hands of the user. It supports the SIP and
294 IAX protocols, as well as decentralized calling using P2P-DHT.
296 This package provides a library common to all Jami clients.")
297 (home-page "https://jami.net")
298 (license license:gpl3+)))
304 (build-system cmake-build-system)
306 `(("libringclient" ,libringclient)
308 ("qrencode" ,qrencode)
309 ("libnotify" ,libnotify)
311 ("clutter-gtk" ,clutter-gtk)
312 ("libcanberra" ,libcanberra)
313 ("webkitgtk" ,webkitgtk)
314 ;; TODO: We must wrap ring-client-gnome to force using the
315 ;; `sqlite-with-column-metadata' package instead of `sqlite' or else it
318 ;; /gnu/store/...-qtbase-5.11.2/lib/qt5/plugins/sqldrivers/libqsqlite.so:
319 ;; undefined symbol: sqlite3_column_table_name16
321 ;; qtbase is built against sqlite-with-column-metadata but somehow
322 ;; jami-client-gnome ends up with both `sqlite' and
323 ;; `sqlite-with-column-metadata' as inputs and it seems that
324 ;; libqsqlite.so gets confused.
325 ("sqlite" ,sqlite-with-column-metadata)))
327 `(("pkg-config" ,pkg-config)
328 ("gettext" ,gettext-minimal)
329 ("glib:bin" ,glib "bin")
330 ("doxygen" ,doxygen)))
332 `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
333 ("adwaita-icon-theme" ,adwaita-icon-theme)
334 ("evolution-data-server" ,evolution-data-server)))
336 `(#:tests? #f ; There is no testsuite.
338 (modify-phases %standard-phases
339 (add-after 'unpack 'change-directory
341 (chdir "client-gnome")
343 (add-after 'install 'wrap
344 (lambda* (#:key inputs outputs #:allow-other-keys)
345 (let* ((out (assoc-ref outputs "out"))
346 (path (string-append (assoc-ref inputs "sqlite") "/lib")))
347 (wrap-program (string-append out "/bin/jami-gnome")
348 `("LD_LIBRARY_PATH" ":" prefix (,path))))
350 (synopsis "Distributed, privacy-respecting communication program")
351 (description "Jami (formerly GNU Ring) is a secure and distributed voice,
352 video and chat communication platform that requires no centralized server and
353 leaves the power of privacy in the hands of the user. It supports the SIP and
354 IAX protocols, as well as decentralized calling using P2P-DHT.
356 This package provides the Jami client for the GNOME desktop.")
357 (home-page "https://jami.net")
358 (license license:gpl3+)))
360 (define-public jami-client-gnome
361 (deprecated-package "jami-client-gnome" jami))