projects/guix·blob javascript-team · refs

363 lines · 14.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Pierre Neidhardt <[email protected]>
3;;; Copyright © 2020 Vincent Legoll <[email protected]>
4;;; Copyright © 2019, 2020 Jan Wielkiewicz <[email protected]>
5;;; Copyright © 2020-2026 Maxim Cournoyer <[email protected]>
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 jami)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (gnu packages aidc)
25 #:use-module (gnu packages audio)
26 #:use-module (gnu packages autotools)
27 #:use-module (gnu packages backup)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages c)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages crypto)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages freedesktop)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages graphviz)
38 #:use-module (gnu packages gtk)
39 #:use-module (gnu packages guile)
40 #:use-module (gnu packages hunspell)
41 #:use-module (gnu packages libcanberra)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages markup)
44 #:use-module (gnu packages networking)
45 #:use-module (gnu packages perl)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages pretty-print)
48 #:use-module (gnu packages pulseaudio)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages qt)
51 #:use-module (gnu packages serialization)
52 #:use-module (gnu packages sphinx)
53 #:use-module (gnu packages sqlite)
54 #:use-module (gnu packages telephony)
55 #:use-module (gnu packages texinfo)
56 #:use-module (gnu packages tls)
57 #:use-module (gnu packages upnp)
58 #:use-module (gnu packages version-control)
59 #:use-module (gnu packages video)
60 #:use-module (gnu packages vulkan)
61 #:use-module (gnu packages web)
62 #:use-module (gnu packages webkit)
63 #:use-module (gnu packages xdisorg)
64 #:use-module (gnu packages xiph)
65 #:use-module (gnu packages xorg)
66 #:use-module (gnu packages)
67 #:use-module (guix build-system copy)
68 #:use-module (guix build-system meson)
69 #:use-module (guix build-system qt)
70 #:use-module (guix download)
71 #:use-module (guix gexp)
72 #:use-module (guix git-download)
73 #:use-module (guix packages)
74 #:use-module (guix utils))
75
76;;; We use nightlies as stable versions are a bit far in-between, and often
77;;; have bugs anyway. When the nightly version change, do not forget to
78;;; retrieve the associated daemon submodule commit and update it in
79;;; %jami-daemon-commit variable below.
80
81;;; When updating Jami, make sure that the patches used for ffmpeg-jami are up
82;;; to date with those listed in
83;;; <https://git.jami.net/savoirfairelinux/jami-daemon/-/blob/master/contrib/src/ffmpeg/rules.mak>.
84(define %jami-nightly-version "20260220.0")
85(define %jami-daemon-commit "67a68a69f958ca72142ed3cc20b3181ae32f3661")
86
87(define-public libjami
88 (package
89 (name "libjami")
90 (version %jami-nightly-version)
91 (source (origin
92 (method git-fetch)
93 (uri (git-reference
94 (url "https://review.jami.net/jami-daemon")
95 (commit %jami-daemon-commit)))
96 (file-name (git-file-name name version))
97 (sha256
98 (base32
99 "1hjx9vzskjkg8aa6699l28wpx1f69agynfyr56xsb2d8nyifs5ds"))))
100 ;; Reduce the output by about 2 MiB by splitting the seldom used 'jamid'
101 ;; daemon binary to the "bin" output.
102 (outputs '("out" "bin" "debug"))
103 (build-system meson-build-system)
104 (arguments
105 (list
106 #:configure-flags
107 #~(list "-Dinterfaces=library,dbus"
108 ;; The test suite currently fails to build (see:
109 ;; <https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/1168>).
110 "-Dtests=false")
111 #:tests? #f
112 #:phases
113 #~(modify-phases %standard-phases
114 (add-after 'unpack 'change-directory/maybe
115 (lambda _
116 ;; Allow building from the tarball or a git checkout.
117 (false-if-exception (chdir "daemon"))))
118 (add-after 'install 'move-jamid
119 (lambda* (#:key outputs #:allow-other-keys)
120 (let ((libexec (string-append #$output:bin "/libexec"))
121 (share (string-append #$output:bin "/share")))
122 (mkdir-p libexec)
123 (rename-file (search-input-file outputs "libexec/jamid")
124 (string-append libexec "/jamid"))
125 (mkdir-p share)
126 (rename-file (search-input-directory outputs "share/dbus-1")
127 (string-append share "/dbus-1")))))
128 (add-after 'install 'sanitize-jami.pc
129 (lambda* (#:key outputs #:allow-other-keys)
130 ;; The Meson-generated pkg-config file adds most inputs to
131 ;; Requires.private, which is unnecessary for our shared library
132 ;; use and would require propagating them.
133 (substitute* (search-input-file outputs "lib/pkgconfig/jami.pc")
134 (("^Requires.private:.*") "")))))))
135 (native-inputs
136 (list cppunit
137 perl ;to generate manpages with pod2man
138 pkg-config
139 which))
140 (inputs
141 (list alsa-lib
142 asio
143 dhtnet
144 eudev
145 ffmpeg-jami
146 jack-1
147 jsoncpp
148 libarchive
149 libgit2
150 libnatpmp
151 libsecp256k1
152 libupnp
153 opendht
154 openssl
155 pjproject-jami
156 pulseaudio
157 sdbus-c++
158 speex
159 speexdsp
160 simdutf
161 webrtc-audio-processing-0.3
162 yaml-cpp))
163 (synopsis "Jami core library and daemon")
164 (description "This package provides a library and daemon implementing the
165Jami core functionality. Jami is a secure and distributed voice, video and
166chat communication platform that requires no centralized server and leaves the
167power of privacy in the hands of the user. It supports the SIP and IAX
168protocols, as well as decentralized calling using P2P-DHT. The @samp{\"bin\"}
169output contains the D-Bus daemon (@command{jamid}) as well as the Jami D-Bus
170service definitions.")
171 (home-page "https://jami.net/")
172 (license license:gpl3+)))
173
174;;; Private package; this is used in source form: the project build system has
175;;; no install target.
176(define sortfilterproxymodel
177 ;; Use the latest commit available from the master branch.
178 (let ((commit "67670eee2c3c5bd758345afa9ba1177dbed32ed2")
179 (revision "1"))
180 (package
181 (name "sortfilterproxymodel")
182 ;; There are no recent release tag; the module version defined in the
183 ;; source is used (see:
184 ;; https://github.com/oKcerG/SortFilterProxyModel/blob/
185 ;; 5a930885b7ea99f7f41c25fce08bf8006ee54e3f/
186 ;; qqmlsortfilterproxymodel.cpp#L574C15-L574C15).
187 (version (git-version "0.2" revision commit))
188 (source (origin
189 (method git-fetch)
190 (uri (git-reference
191 ;; The upstream is
192 ;; https://github.com/oKcerG/SortFilterProxyModel, but
193 ;; it lacks Qt 6 support, so use this fork, which is the
194 ;; one used by Jami.
195 (url "https://github.com/atraczyk/SortFilterProxyModel")
196 (commit commit)))
197 (file-name (git-file-name name version))
198 (sha256
199 (base32
200 "1n54jkimr3a818i3w7w3lnbqn47x72nnr5xi9vk0mdnbwri3viwy"))))
201 (build-system qt-build-system)
202 (arguments
203 (list #:qtbase qtbase ;use Qt 6
204 #:tests? #f ;no test suite
205 #:configure-flags #~(list "BUILD_SFPM_PIC=ON")))
206 (inputs (list qtdeclarative))
207 (home-page "https://github.com/oKcerG/SortFilterProxyModel")
208 (synopsis "Improved QSortFilterProxyModel implementation for QML")
209 (description "SortFilterProxyModel is an implementation of
210QSortFilterProxyModel conveniently exposed for QML.")
211 (license license:expat))))
212
213(define-public jami
214 (package
215 (name "jami")
216 (version %jami-nightly-version)
217 (source (origin
218 (method git-fetch)
219 (uri (git-reference
220 (url "https://review.jami.net/jami-client-qt")
221 (commit (string-append "nightly/" %jami-nightly-version))))
222 (file-name (git-file-name name version))
223 (sha256
224 (base32
225 "0g6hdh9kdnvfika2x4ymcmm00i13ml2rp91flzawqhlb3nm6jdy6"))
226 (patches (search-patches
227 "jami-libjami-cmake.patch"
228 "jami-avutil-link.patch"))))
229 (build-system qt-build-system)
230 (outputs '("out" "debug"))
231 (arguments
232 (list
233 #:qtbase qtbase
234 #:configure-flags
235 #~(list "-DWITH_DAEMON_SUBMODULE=OFF"
236 (string-append "-DBUILD_VERSION=" #$version)
237 ;; We ship 'libjami' as a separate package.
238 "-DJAMICORE_AS_SUBDIR=OFF"
239 ;; Disable the webengine since it grows the closure size by
240 ;; about 450 MiB and requires more resources.
241 "-DWITH_WEBENGINE=OFF"
242 ;; Ensure FetchContent contribs are looked from the system.
243 "-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS")
244 #:phases
245 #~(modify-phases %standard-phases
246 (add-after 'unpack 'copy-3rdparty-source-dependencies
247 (lambda _
248 (copy-recursively #$(package-source sortfilterproxymodel)
249 "3rdparty/SortFilterProxyModel")))
250 (add-before 'configure 'fake-x11-environment
251 (lambda _
252 ;; This works around the lack of configuration for the X11
253 ;; push-to-talk feature, which is auto-detected via the
254 ;; XDG_SESSION_TYPE environment variable (see:
255 ;; <https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/1504>).
256 (setenv "XDG_SESSION_TYPE" "x11")))
257 (replace 'check
258 (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
259 (when tests?
260 (setenv "QT_QPA_PLATFORM" "offscreen")
261 (setenv "QT_QUICK_BACKEND" "software")
262 ;; The tests require a writable HOME.
263 (setenv "HOME" "/tmp")
264
265 (let ((ctest-args
266 (list "-V" "--output-on-failure"
267 "-j" (if parallel-tests?
268 (number->string (parallel-job-count))
269 "1"))))
270
271 (display "Running unit tests...\n")
272 (apply invoke "ctest" "-R" "Unit_Tests" ctest-args)
273
274 ;; The QML test suite is currently disabled as it segfaults
275 ;; (see:
276 ;; <https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/1631>).
277 ;;(display "Running functional tests...\n")
278 ;;(apply invoke "ctest" "-R" "Qml_Tests" ctest-args)
279 )))))))
280 (native-inputs
281 (list git-minimal/pinned
282 googletest
283 pkg-config
284 python-minimal
285 qthttpserver
286 qttools
287 qtwebsockets
288 vulkan-headers))
289 (inputs
290 (list ffmpeg-jami
291 glib ;for integration with GNOME
292 hunspell
293 libjami
294 libnotify
295 libxcb
296 libxkbcommon
297 md4c
298 network-manager
299 qt5compat
300 qtdeclarative
301 qtmultimedia
302 qtnetworkauth
303 qtpositioning
304 qtsvg
305 qtwayland
306 qwindowkit
307 tidy-html ;used by src/app/htmlparser.h
308 vulkan-loader
309 zxing-cpp))
310 (home-page "https://jami.net")
311 (synopsis "Qt Jami client")
312 (description "This package provides the Jami Qt client. Jami is a secure
313and distributed voice, video and chat communication platform that requires no
314centralized server and leaves the power of privacy in the hands of the user.
315It supports the SIP and IAX protocols, as well as decentralized calling using
316P2P-DHT.")
317 (license license:gpl3+)))
318
319(define-public jami-docs
320 ;; There aren't any tags, so use the latest commit.
321 (let ((revision "5")
322 (commit "f95825cdda2570d0c30d0fdf076186fe72da71b1"))
323 (package
324 (name "jami-docs")
325 (version (git-version "0.0.0" revision commit))
326 (source (origin
327 (method git-fetch)
328 (uri (git-reference
329 (url "https://git.jami.net/savoirfairelinux/jami-docs")
330 (commit commit)))
331 (file-name (git-file-name name version))
332 (sha256
333 (base32
334 "1f92l4ym14w8j70x9b4nybvpb967sv6359vjdxnqd71b6pal8pjr"))))
335 (build-system copy-build-system)
336 (arguments
337 (list
338 #:phases
339 #~(modify-phases %standard-phases
340 (add-after 'unpack 'build
341 (lambda _
342 (invoke "make" "info" "man" "LANGS="
343 "-j" (number->string
344 (parallel-job-count))))))
345 #:install-plan
346 ;; TODO: Install localized info manuals and HTML.
347 ''(("_build/out/texinfo/jami.info" "share/info/")
348 ("_build/out/man/jami.1" "share/man/man1/"))))
349 (native-inputs
350 (list python-minimal
351 python-myst-parser
352 python-sphinx
353 python-sphinxcontrib-mermaid
354 python-sphinx-rtd-theme
355 texinfo))
356 (home-page "https://git.jami.net/")
357 (synopsis "Documentation for Jami")
358 (description "This package contains the documentation of Jami. Jami is
359a secure and distributed voice, video and chat communication platform that
360requires no centralized server and leaves the power of privacy in the hands of
361the user. It supports the SIP and IAX protocols, as well as decentralized
362calling using P2P-DHT.")
363 (license license:fdl1.3+))))