projects/guix·blob java-team · refs

588 lines · 21.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Alex ter Weele <[email protected]>
3;;; Copyright © 2020 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2020, 2021, 2022 Michael Rohleder <[email protected]>
5;;; Copyright © 2020 Giacomo Leidi <[email protected]>
6;;; Copyright © 2022 Aleksandr Vityazev <[email protected]>
7;;; Copyright © 2022 Morgan Smith <[email protected]>
8;;; Copyright © 2023 Miguel Ángel Moreno <[email protected]>
9;;; Copyright © 2023 conses <[email protected]>
10;;; Copyright © 2025 Ricardo Wurmus <[email protected]>
11;;; Copyright © 2025 Arjan Adriaanse <[email protected]>
12;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
13;;; Copyright © 2026 Zheng Junjie <[email protected]>
14;;; Copyright © 2026 orahcio <[email protected]>
15;;; Copyright © 2025 Isidor Zeuner <[email protected]>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages matrix)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages crypto)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages freedesktop)
39 #:use-module (gnu packages glib)
40 #:use-module (gnu packages golang)
41 #:use-module (gnu packages golang-build)
42 #:use-module (gnu packages golang-crypto)
43 #:use-module (gnu packages golang-web)
44 #:use-module (gnu packages golang-xyz)
45 #:use-module (gnu packages monitoring)
46 #:use-module (gnu packages python-build)
47 #:use-module (gnu packages python-check)
48 #:use-module (gnu packages python-crypto)
49 #:use-module (gnu packages python-web)
50 #:use-module (gnu packages python-xyz)
51 #:use-module (gnu packages rust)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages xml)
54 #:use-module (guix build-system cargo)
55 #:use-module (guix build-system go)
56 #:use-module (guix build-system pyproject)
57 #:use-module (guix download)
58 #:use-module (guix gexp)
59 #:use-module (guix git-download)
60 #:use-module (guix packages))
61
62(define-public matrix-commander
63 (package
64 (name "matrix-commander")
65 (version "8.0.5")
66 (source
67 (origin
68 (method git-fetch)
69 (uri (git-reference
70 (url "https://github.com/8go/matrix-commander")
71 (commit (string-append "v" version))))
72 (file-name (git-file-name name version))
73 (sha256
74 (base32 "0150l6qzy55qlm7639p82vdhsapq6x48ixhgr2yrm2yg9a62gn3q"))))
75 (build-system pyproject-build-system)
76 (arguments
77 (list
78 #:phases
79 #~(modify-phases %standard-phases
80 (add-after 'unpack 'relax-requirements
81 ;; XXX: Provided by Python standard library, report upstream.
82 (lambda _
83 (substitute* "setup.cfg"
84 (("argparse") "")
85 (("async-timeout") "")
86 (("asyncio") "")
87 (("datetime") "")
88 (("uuid") ""))))
89 (replace 'check
90 (lambda* (#:key tests? #:allow-other-keys)
91 (when tests?
92 ;; The other tests expect a Matrix server to connect
93 ;; to, see <.github/workflows/run-tests.yml>.
94 (invoke "./tests/test-version.sh")))))))
95 (native-inputs
96 (list python-pytest
97 python-setuptools))
98 (inputs
99 (list python-aiofiles
100 python-aiohttp
101 python-emoji
102 python-magic
103 python-markdown
104 python-matrix-nio
105 python-notify2
106 python-pillow
107 python-pyxdg))
108 (home-page "https://github.com/8go/matrix-commander")
109 (synopsis "Simple command-line Matrix client")
110 (description
111 "This package provides a simple but convenient @acronym{Command Line
112Interface, CLI}-based Matrix client app for sending and receiving.")
113 (license license:gpl3)))
114
115(define-public mautrix-whatsapp
116 (package
117 (name "mautrix-whatsapp")
118 (version "0.2608.0")
119 (source
120 (origin
121 (method git-fetch)
122 (uri (git-reference
123 (url "https://github.com/mautrix/whatsapp")
124 (commit (string-append "v" version))))
125 (file-name (git-file-name name version))
126 (sha256
127 (base32 "027pnxxgb93n9dml7gl1b47xmn3jw194m9y275q6zm8v5whrf7w0"))))
128 (build-system go-build-system)
129 (arguments
130 (list
131 #:install-source? #f
132 #:tests? #f ; no tests provided
133 #:import-path "go.mau.fi/mautrix-whatsapp/cmd/mautrix-whatsapp"
134 #:unpack-path "go.mau.fi/mautrix-whatsapp"
135 #:build-flags
136 #~(list (string-append "-ldflags=-X main.Tag=" #$version))
137 #:embed-files
138 #~(list
139 ;; go.mau.fi/whatsmeow/proto/<...> pattern <...>.pb.raw: cannot embed
140 ;; irregular file <...>.pb.raw
141 ".*\\.pb\\.raw$"
142 ;; maunium.net/go/mautrix/bridgev2/database/upgrades/upgrades.go
143 ;; maunium.net/go/mautrix/crypto/sql_store_upgrade/upgrade.go
144 ;; maunium.net/go/mautrix/sqlstatestore/statestore.go
145 ;;
146 ;; pattern *.sql: cannot embed irregular file <...>.sql
147 ".*\\.sql"
148 ;; golang.org/x/net/publicsuffix/table.go:63:12: pattern
149 ;; data/children: cannot embed irregular file data/children
150 "children"
151 ;; golang.org/x/net/publicsuffix/table.go:48:12: pattern data/nodes:
152 ;; cannot embed irregular file data/nodes
153 "nodes"
154 ;; golang.org/x/net/publicsuffix/table.go:33:12: pattern data/text:
155 ;; cannot embed irregular file data/text
156 "text"
157 ;; maunium.net/go/mautrix/bridgev2/matrix/mxmain/config.go:17:12:
158 ;; pattern example-config.yaml: cannot embed irregular file
159 ;; example-config.yaml
160 "example-config\\.yaml"
161 ;; go.mau.fi/webp/webp.go:14:12: pattern internal: cannot embed
162 ;; directory internal: contains no embeddable files
163 ".*\\.c"
164 ".*\\.h"
165 ;; go.mau.fi/whatsmeow/argo/argo.go:16:13:
166 ;; pattern argo-wire-type-store.argo: cannot embed
167 ".*\\.argo"
168 ;; go.mau.fi/whatsmeow/argo/argo.go:19:13:
169 ;; pattern name-to-queryids.json: cannot embed
170 ".*\\.json")))
171 (native-inputs
172 (list olm
173 go-github-com-gorilla-mux
174 go-github-com-gorilla-websocket
175 go-github-com-lib-pq
176 go-github-com-rs-zerolog
177 go-go-mau-fi-util
178 go-go-mau-fi-webp
179 go-go-mau-fi-whatsmeow
180 go-golang-org-x-exp
181 go-golang-org-x-image
182 go-golang-org-x-net
183 go-golang-org-x-sync
184 go-google-golang-org-protobuf
185 go-gopkg-in-yaml-v3
186 go-maunium-net-go-mautrix))
187 (home-page "https://go.mau.fi/mautrix-whatsapp")
188 (synopsis "Matrix <-> WhatsApp puppeting bridge")
189 (description
190 "This package provides a @code{Matrix<->WhatsApp} puppeting bridge based
191on @url{https://github.com/tulir/whatsmeow, whatsmeow}.")
192 (license license:agpl3+)))
193
194(define-public pantalaimon
195 (package
196 (name "pantalaimon")
197 (version "0.10.6")
198 (source
199 (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/matrix-org/pantalaimon")
203 (commit version)))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32 "07cf5k0b1i5pfplmx2p5l3ba76jjfzzcky9ylj7593k7nrm5drl3"))))
207 (build-system pyproject-build-system)
208 (arguments
209 (list
210 #:test-flags
211 #~(list "tests"
212 ;; These tests hang.
213 "--ignore=tests/proxy_test.py"
214 "-k" "not test_start_loop")
215 #:phases
216 #~(modify-phases %standard-phases
217 (add-after 'unpack 'create-pytest-ini
218 (lambda _
219 (call-with-output-file "pytest.ini"
220 (lambda (port)
221 (format port "[pytest]
222asyncio_mode = auto")))))
223 (add-after 'unpack 'relax-requirements
224 (lambda _
225 (substitute* "setup.py"
226 ;; Newer version is packaged.
227 (("\"matrix-nio\\[e2e\\] >= 0\\.24, < 0\\.25\\.2\"")
228 "\"matrix-nio[e2e] >= 0.24, <= 0.25.2\""))))
229 (add-after 'install 'install-doc
230 (lambda _
231 (with-directory-excursion "docs/man"
232 (let ((man (string-append #$output "/share/man")))
233 (install-file "panctl.1" (string-append man "/man1"))
234 (install-file "pantalaimon.5" (string-append man "/man5"))
235 (install-file "pantalaimon.8"
236 (string-append man "/man8")))))))))
237 (native-inputs
238 (list python-aioresponses
239 python-faker
240 python-pytest
241 python-pytest-aiohttp
242 python-pytest-asyncio
243 python-setuptools))
244 (propagated-inputs
245 (list python-aiohttp
246 python-attrs
247 python-cachetools
248 python-click
249 python-dbus
250 python-janus
251 python-keyring
252 python-logbook
253 python-matrix-nio
254 python-notify2
255 python-peewee
256 python-platformdirs
257 python-prompt-toolkit
258 python-pydbus
259 python-pygobject))
260 (home-page "https://github.com/matrix-org/pantalaimon")
261 (synopsis "Matrix proxy daemon that adds E2E encryption capabilities")
262 (description
263 "Pantalaimon is an end-to-end encryption aware Matrix reverse proxy
264daemon. Pantalaimon acts as a good man in the middle that handles the
265encryption for you. Messages are transparently encrypted and decrypted for
266clients inside of pantalaimon.")
267 (license license:asl2.0)))
268
269(define-public python-matrix-client
270 (package
271 (name "python-matrix-client")
272 (version "0.3.2")
273 (source
274 (origin
275 (method git-fetch)
276 (uri (git-reference
277 (url "https://github.com/matrix-org/matrix-python-sdk")
278 (commit (string-append "v" version))))
279 (file-name (git-file-name name version))
280 (sha256
281 (base32 "01ppn2vxyd7c01ww9bicj7qlyycdyf89b2wbikdb9d2k1h03rfml"))))
282 (build-system pyproject-build-system)
283 (propagated-inputs (list python-requests))
284 (native-inputs (list python-pytest python-responses python-setuptools))
285 (home-page "https://github.com/matrix-org/matrix-python-sdk")
286 (synopsis "Client-Server SDK for Matrix")
287 (description "This package provides client-server SDK for Matrix.")
288 (license license:asl2.0)))
289
290(define-public python-matrix-common
291 (package
292 (name "python-matrix-common")
293 (version "1.3.0")
294 (source
295 (origin
296 (method git-fetch)
297 (uri (git-reference
298 (url "https://github.com/matrix-org/matrix-python-common")
299 (commit (string-append "v" version))))
300 (file-name (git-file-name name version))
301 (sha256
302 (base32 "1ryih7xladx9888gwi71q78d9f92zjr066jj3ksgcjkfp3djdxjk"))))
303 (build-system pyproject-build-system)
304 (arguments
305 (list #:test-backend #~'custom
306 #:test-flags #~(list "-m" "twisted.trial" "tests")))
307 (native-inputs
308 (list python-setuptools
309 python-twisted))
310 (propagated-inputs
311 (list python-attrs))
312 (home-page "https://github.com/matrix-org/matrix-python-common")
313 (synopsis "Common utilities for Synapse, Sydent and Sygnal")
314 (description
315 "This package contains code used by Synapse, Sydent, and Sygnal.")
316 (license license:asl2.0)))
317
318(define-public python-matrix-nio
319 (package
320 (name "python-matrix-nio")
321 (version "0.25.2")
322 (source
323 (origin
324 (method git-fetch)
325 (uri (git-reference
326 (url "https://github.com/poljar/matrix-nio.git")
327 (commit version)))
328 (file-name (git-file-name name version))
329 (sha256
330 (base32 "07prfdnkr13d0pvzhnicwnpn562fwq9zx05d6wza230s7vj0mmk4"))))
331 (build-system pyproject-build-system)
332 (arguments
333 (list
334 #:test-flags
335 #~(list "tests"
336 "-k" (string-join
337 ;; This test requires an Internet connection
338 (list "not test_connect_wrapper"
339 ;; XXX: fixture 'event_loop' not found
340 "test_sync_forever"
341 "test_stop_sync_forever")
342 " and not "))
343 #:phases
344 #~(modify-phases %standard-phases
345 (add-after 'unpack 'relax-requirements
346 (lambda _
347 (substitute* "pyproject.toml"
348 (("\"cachetools~=.*\"")
349 "\"cachetools\""))))
350 (add-after 'unpack 'fix-tests
351 (lambda _
352 (substitute* "tests/helpers.py"
353 (("from nio.crypto import OlmAccount, OlmDevice")
354 "from nio.crypto.device import OlmDevice
355from nio.crypto.sessions import OlmAccount")))))))
356 (native-inputs
357 (list python-aioresponses
358 python-faker
359 python-hpack
360 python-hyperframe
361 python-hypothesis
362 python-pytest
363 python-pytest-aiohttp
364 python-pytest-asyncio
365 python-pytest-benchmark
366 python-setuptools))
367 (propagated-inputs
368 (list python-aiofiles
369 python-aiohttp
370 python-aiohttp-socks
371 python-atomicwrites
372 python-cachetools
373 python-h11
374 python-h2
375 python-jsonschema
376 python-olm
377 python-peewee
378 python-pycryptodome
379 python-unpaddedbase64))
380 (home-page "https://github.com/poljar/matrix-nio")
381 (synopsis
382 "Python Matrix client library, designed according to sans I/O principles")
383 (description
384 "Matrix nio is a multilayered Matrix client library. The underlying base
385layer doesn't do any network IO on its own, but on top of that is a full
386fledged batteries-included asyncio layer using aiohttp.")
387 (license license:isc)))
388
389(define-public python-matrix-synapse-ldap3
390 (package
391 (name "python-matrix-synapse-ldap3")
392 (version "0.1.4")
393 (source
394 (origin
395 (method git-fetch)
396 (uri (git-reference
397 (url "https://github.com/matrix-org/matrix-synapse-ldap3")
398 (commit (string-append "v" version))))
399 (file-name (git-file-name name version))
400 (sha256
401 (base32 "1p49h4k216iwap3axws7ffz94zn25j85f7kkv3wky1fvsb8i1r4h"))))
402 (build-system pyproject-build-system)
403 (arguments
404 (list
405 #:tests? #f ; tests require synapse, creating a circular dependency.
406 #:phases
407 #~(modify-phases %standard-phases
408 ;; Also, auth_provider.py attempts to import synapse.
409 (delete 'sanity-check))))
410 (native-inputs (list python-setuptools))
411 (propagated-inputs
412 (list python-twisted python-ldap3 python-service-identity))
413 (home-page "https://github.com/matrix-org/matrix-synapse-ldap3")
414 (synopsis "LDAP3 auth provider for Synapse")
415 (description
416 "This package allows Synapse to use LDAP as a password provider.
417This lets users log in to Synapse with their username and password from
418an LDAP server.")
419 (license license:asl2.0)))
420
421(define-public python-synapse-s3-storage-provider
422 (package
423 (name "python-synapse-s3-storage-provider")
424 (version "1.6.0")
425 (source
426 (origin
427 (method git-fetch)
428 (uri (git-reference
429 (url "https://github.com/matrix-org/synapse-s3-storage-provider")
430 (commit (string-append "v" version))))
431 (file-name (git-file-name name version))
432 (sha256
433 (base32 "03y72439z718wjapdgqcw1qajpc917djsf4jhp2qrgv9l71rrrk9"))))
434 (build-system pyproject-build-system)
435 (arguments
436 (list
437 #:test-backend #~'custom
438 #:test-flags #~(list "-m" "twisted.trial" "test_s3")))
439 (native-inputs
440 (list python-setuptools
441 python-mock synapse))
442 (propagated-inputs
443 (list python-boto3
444 python-botocore
445 python-humanize
446 python-psycopg2
447 python-pyyaml
448 python-tqdm
449 python-twisted))
450 (home-page "https://github.com/matrix-org/synapse-s3-storage-provider")
451 (synopsis "Synapse storage provider to fetch and store media in Amazon S3")
452 (description
453 "This package implements a storage provider for Synapse, enabling it to
454fetch and store media in Amazon S3.")
455 (license license:asl2.0)))
456
457(define-public synapse
458 (package
459 (name "synapse")
460 (version "1.140.0")
461 (source
462 (origin
463 (method git-fetch)
464 (uri (git-reference
465 (url "https://github.com/element-hq/synapse")
466 (commit (string-append "v" version))))
467 (file-name (git-file-name name version))
468 (sha256
469 (base32 "0iidr727jw178596ijls670k8i7v7kjbn8w0jhkihf2hy8wnfkcy"))))
470 (build-system pyproject-build-system)
471 (arguments
472 (list
473 #:modules
474 '(((guix build cargo-build-system) #:prefix cargo:)
475 (guix build pyproject-build-system)
476 (guix build utils))
477 #:imported-modules
478 `(,@%cargo-build-system-modules
479 ,@%pyproject-build-system-modules)
480 #:test-backend #~'custom
481 ;; XXX: The complete test suite takes about 2h+ to finish and require
482 ;; running database, run just unittests.
483 ;; See: <.github/workflows/tests.yml>.
484 ;;
485 ;; tests: skips=169, successes=4245
486 #:test-flags
487 #~(list "-m" "twisted.trial"
488 "--temp-directory=/tmp/_trial_temp"
489 (string-append "--jobs="
490 (number->string (min 4 (parallel-job-count))))
491 "tests")
492 #:phases
493 #~(modify-phases %standard-phases
494 (add-after 'unpack 'prepare-cargo-build-system
495 (lambda args
496 (for-each
497 (lambda (phase)
498 (format #t "Running cargo phase: ~a~%" phase)
499 (apply (assoc-ref cargo:%standard-phases phase)
500 #:cargo-target #$(cargo-triplet)
501 args))
502 '(prepare-rust-crates
503 unpack-rust-crates
504 configure
505 check-for-pregenerated-files
506 patch-cargo-checksums))))
507 (add-after 'unpack 'disable-failing-tests
508 (lambda _
509 (substitute* "tests/handlers/test_user_directory.py"
510 (("def test_search_punctuation")
511 "def __off_test_search_punctuation"))
512 (substitute* "tests/storage/test_room_search.py"
513 ;; twisted.trial.unittest.FailTest: 0 != 1 : expected 'quick
514 ;; brown' to match 'the quick brown fox jumps over the lazy
515 ;; dog'
516 (("def test_sqlite_search")
517 "def __off_test_sqlite_search")
518 ;; twisted.trial.unittest.FailTest: 0 != 1
519 (("def test_null_byte")
520 "def __off_test_null_byte"))))
521 (add-after 'build 'install-rust-library
522 (lambda _
523 (copy-file "target/release/libsynapse.so"
524 "synapse/synapse_rust.so"))))))
525 (inputs (cargo-inputs 'synapse))
526 (propagated-inputs
527 (list python-attrs
528 python-bcrypt
529 python-bleach
530 python-canonicaljson
531 python-cryptography
532 python-ijson
533 python-immutabledict
534 python-jinja2
535 python-jsonschema
536 python-matrix-common
537 python-msgpack
538 python-multipart
539 python-netaddr
540 python-packaging
541 python-phonenumbers
542 python-pillow
543 python-prometheus-client
544 python-pyasn1
545 python-pyasn1-modules
546 python-pydantic
547 python-pymacaroons
548 python-pyopenssl
549 python-pyyaml
550 python-service-identity
551 python-signedjson
552 python-sortedcontainers
553 python-treq
554 python-twisted
555 python-typing-extensions
556 python-unpaddedbase64
557 ;; [all]
558 python-authlib
559 python-hiredis
560 python-idna
561 python-lxml
562 python-matrix-synapse-ldap3
563 python-parameterized
564 python-psycopg2
565 python-psycopg2cffi
566 python-pympler
567 python-pysaml2
568 python-txredisapi))
569 (native-inputs
570 (list (libc-utf8-locales-for-target) ;for tests
571 openssl
572 postgresql
573 python-poetry-core
574 python-pyperf
575 python-setuptools-rust
576 rust
577 (list rust "cargo")
578 tzdata-for-tests
579 xmlsec))
580 (home-page "https://github.com/element-hq/synapse")
581 (synopsis "Matrix reference homeserver")
582 (description
583 "Synapse is a reference \"homeserver\" implementation of Matrix from the
584core development team at matrix.org, written in Python/Twisted. It is
585intended to showcase the concept of Matrix and let folks see the spec in the
586context of a codebase and let you run your own homeserver and generally help
587bootstrap the ecosystem.")
588 (license license:asl2.0)))