Subject: [PATCH 30/81] gnu: Add matrix-conduit.

From: Herman Rimm <[email-masked]>
Date: Mon, 20 May 2024 10:58:35 +0200

* gnu/packages/matrix.scm (matrix-conduit): Add variable.

Change-Id: Icae14162197c19fc3421147dd34cf9df8e5a56ff
---
 gnu/packages/matrix.scm | 84 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)

diff --git a/gnu/packages/matrix.scm b/gnu/packages/matrix.scm
index 7a29100d3f..3abbdd32e4 100644
--- a/gnu/packages/matrix.scm
+++ b/gnu/packages/matrix.scm
@@ -24,6 +24,7 @@
 (define-module (gnu packages matrix)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages crates-crypto)
   #:use-module (gnu packages crates-graphics)
@@ -31,7 +32,9 @@ (define-module (gnu packages matrix)
   #:use-module (gnu packages crates-web)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages monitoring)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
@@ -183,6 +186,87 @@ (define rust-ruma-0.9-1.5495b85
 matrix-conduit package.")
       (license license:expat))))
 
+(define-public matrix-conduit
+  (package
+    (name "matrix-conduit")
+    (version "0.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+              "https://gitlab.com/famedly/conduit/-/archive/v"
+              version "/conduit-v" version ".tar.gz"))
+       (sha256
+        (base32 "0cgqbfh3nf7y13hn2bdgi4slchiwmxiiz3bypj9raffh3blhmnwx"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin (substitute* "Cargo.toml"
+                  ;; Remove unused dependencies.
+                  (("^lazy_static.*") "")
+                  (("^tikv-jemalloc-ctl.*") "")
+                  (("\"tikv-jemalloc-ctl\", ") "")
+                  ;; Provide vendored ruma dependency.
+                  (("git =.*, rev =.*, features")
+                   "version = \"0.9.4-1.5495b85\", features"))))))
+    (build-system cargo-build-system)
+    (arguments
+     (list #:install-source? #f
+           #:cargo-inputs (list rust-async-trait-0.1
+                                rust-axum-0.6
+                                rust-axum-server-0.5
+                                rust-bytes-1
+                                rust-base64-0.21
+                                rust-clap-4
+                                rust-directories-4
+                                rust-futures-util-0.3
+                                rust-figment-0.10
+                                rust-hmac-0.12
+                                rust-http-0.2
+                                rust-hyper-0.14
+                                rust-image-0.24
+                                rust-jsonwebtoken-9
+                                rust-lru-cache-0.1
+                                rust-num-cpus-1
+                                rust-nix-0.28
+                                rust-opentelemetry-0.18
+                                rust-opentelemetry-jaeger-0.17
+                                rust-parking-lot-0.12
+                                rust-persy-1
+                                rust-rand-0.8
+                                rust-regex-1
+                                rust-reqwest-0.11
+                                rust-ring-0.17
+                                ;; Include workspace transitive closure.
+                                rust-ruma-0.9-1.5495b85
+                                rust-rust-argon2-1
+                                rust-rust-rocksdb-0.24
+                                rust-rusqlite-0.29
+                                rust-sd-notify-0.4
+                                rust-serde-1
+                                rust-serde-html-form-0.2
+                                rust-serde-json-1
+                                rust-serde-yaml-0.9
+                                rust-sha-1-0.10
+                                rust-thiserror-1
+                                rust-threadpool-1
+                                rust-thread-local-1
+                                rust-tikv-jemallocator-0.5
+                                rust-tokio-1
+                                rust-tower-0.4
+                                rust-tower-http-0.4
+                                rust-tracing-0.1
+                                rust-tracing-flame-0.2
+                                rust-tracing-opentelemetry-0.18
+                                rust-tracing-subscriber-0.3
+                                rust-trust-dns-resolver-0.22)))
+               ;; Include workspace members.
+    (inputs (list rust-ruma-0.9-1.5495b85 zlib (list zstd "lib")))
+    (native-inputs (list clang pkg-config))
+    (home-page "https://conduit.rs")
+    (synopsis "Matrix homeserver written in Rust")
+    (description "This package provides a Matrix homeserver written in Rust.")
+    (license license:asl2.0)))
+
 (define-public synapse
   (package
     (name "synapse")
-- 
2.41.0