forked from project-robius/robrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
273 lines (234 loc) · 11.1 KB
/
Cargo.toml
File metadata and controls
273 lines (234 loc) · 11.1 KB
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
[package]
name = "robrix"
authors = [
"Kevin Boos <kevinaboos@gmail.com>",
"Robius Project Maintainers",
]
description = "A Matrix chat client written using Makepad + Robius app dev framework in Rust."
documentation = "https://docs.rs/robrix"
edition = "2024" ## mostly just to allow let-chains
homepage = "https://robius.rs/"
keywords = ["matrix", "chat", "client", "robius", "makepad"]
license = "MIT"
readme = "README.md"
categories = [ "gui" ]
repository = "https://github.com/project-robius/robrix"
version = "0.0.1-pre-alpha-4"
metadata.makepad-auto-version = "zqpv-Yj-K7WNVK2I8h5Okhho46Q="
[dependencies]
makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "dev", features = ["serde"] }
makepad-code-editor = { git = "https://github.com/makepad/makepad", branch = "dev" }
## Including this crate automatically configures all `robius-*` crates to work with Makepad.
robius-use-makepad = "0.1.1"
robius-open = { git = "https://github.com/project-robius/robius" }
robius-directories = { git = "https://github.com/project-robius/robius" }
robius-location = { git = "https://github.com/project-robius/robius" }
anyhow = "1.0"
bitflags = "2.6.0"
blurhash = { version = "0.2.3", default-features = false }
bytesize = "2.0"
chrono = "0.4"
clap = { version = "4.0.16", features = ["derive"] }
crossbeam-channel = "0.5.10"
crossbeam-queue = "0.3.8"
eyeball = { version = "0.8.8", features = ["tracing"] } # same as matrix-sdk-ui
eyeball-im = { version = "0.8.0", features = ["tracing"] } # same as matrix-sdk-ui
imbl = { version = "6.1.0", features = ["serde"] } # same as matrix-sdk-ui
futures-util = "0.3"
hashbrown = { version = "0.16", features = ["raw-entry"] }
htmlize = "1.0.5"
indexmap = "2.6.0"
imghdr = "0.7.0"
linkify = "0.10.0"
matrix-sdk-base = { git = "https://github.com/matrix-org/matrix-rust-sdk", branch = "main" }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", branch = "main", default-features = false, features = [ "e2e-encryption", "automatic-room-key-forwarding", "markdown", "sqlite", "rustls-tls", "bundled-sqlite", "sso-login" ] }
matrix-sdk-ui = { git = "https://github.com/matrix-org/matrix-rust-sdk", branch = "main", default-features = false, features = [ "rustls-tls" ] }
## Use the same ruma version as what's specified in matrix-sdk's Cargo.toml.
## Enable a few extra features:
## * "compat-optional" feature to allow missing body field in m.room.tombstone event.
## * "compat-unset-avatar" feature to allow deleting the user's avatar to work properly.
## * Note: we need a feature like "compat-unset-display-name" to unset display names, but that doesn't exist yet.
ruma = { version = "0.14.1", features = ["compat-optional", "compat-unset-avatar"] }
rand = "0.8.5"
rangemap = "1.5.0"
sanitize-filename = "0.6"
serde = "1.0"
serde_json = "1.0"
thiserror = "2.0.16"
tokio = { version = "1.43.1", features = ["macros", "rt-multi-thread"] }
tracing-subscriber = "0.3.17"
unicode-segmentation = "1.11.0"
url = "2.5.0"
## Dependencies for TSP support.
## Commit "f0bc4625dcd729e07e4a36257df2f1d94c81cef4" is the most recent one without the invalid change to pin serde to 1.0.219.
## See my issue here: <https://github.com/openwallet-foundation-labs/tsp/issues/237>.
## However, that commit doesn't build.... yikes. So we have to use a slightly older commit in the "rev" field below.
tsp_sdk = { git = "https://github.com/openwallet-foundation-labs/tsp.git", rev = "1cd0cc9442e144ad7c01ccd30daffbb3a52c0f20", optional = true, features = ["async", "resolve"] }
quinn = { version = "0.11", default-features = false, optional = true }
## We only include this such that we can specify the prebuilt-nasm features,
## which is required to build this on Windows x86_64 without having to install NASM separately.
aws-lc-rs = { version = "1.13", optional = true, features = ["prebuilt-nasm"] }
percent-encoding = { version = "2.3", optional = true }
## The following reqwest features were taken from the tsp_sdk's `Cargo.toml` file.
## I'm not sure if all of them are actually needed.
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls-native-roots",
"json",
"stream",
"charset",
"http2",
"macos-system-configuration",
] }
[features]
default = []
## Enables experimental support for using TSP wallets.
tsp = ["dep:tsp_sdk", "dep:quinn", "dep:aws-lc-rs", "dep:percent-encoding"]
## Hides the command prompt console on Windows.
hide_windows_console = []
## Logs all diffs received by the Matrix RoomListService.
log_room_list_diffs = []
## Logs all diffs to all room timelines.
log_timeline_diffs = []
## Logs all diffs received by the Matrix SpaceService.
log_space_service_diffs = []
[patch.crates-io]
## This is required to avoid a version conflict on the libsqlite3-sys crate,
## which is a native crate that can only exist once in the dependency graph.
## The `matrix-sdk` crate's dependencies require a specific version of `libsqlite3-sys`
## (via rustsqlite which requires libsqlite3-sys 0.35.0),
## whereas the `tsp_sdk` crate depends on `sqlx`, which requires a different version
## of `libsqlite3-sys` (via `aries-askar`, which depends on `askar-storage`,
## which requires libsqlite3-sys 0.30.0).
## So this patch is a custom version of sqlx 0.8.6 that updates the libsqlite3-sys
## dependency to version 0.35.0, which is compatible with the version required by
## the matrix-sdk crate.
## See <https://github.com/launchbadge/sqlx/pull/3928/files#diff-4f4849707ed063bc5de6d9f6d105f0e7baf62d1085b3c8aee4a547468b89248fR57>
sqlx = { git = "https://github.com/project-robius/sqlx.git", branch = "update_libsqlite3-sys_version" }
## The main branch of the `tsp_sdk` repo already includes this patch, so we copy it here.
## This is required for the askar repos to work with the above-patched `sqlx` crate.
## See <https://github.com/openwallet-foundation/askar/pull/386>
askar-storage = { git = "https://github.com/openwallet-foundation/askar.git" }
## This is a temporary patch to add the TSP signature field to the `RoomMessageEventContent` type.
##
## Technically this is only needed when the `tsp` feature is enabled,
## but Cargo does not support conditional patching based on features,
## and it doesn't hurt anything to always use this patched version of ruma-events.
##
## Once the matrix-sdk-ui crate (and the Timeline type) supports sending/receiving custom messages,
## we can create our own custom event type that includes the TSP signature,
## and then we won't need to patch ruma-events anymore.
## But that is a significant amount of work, so for now we just patch ruma-events.
##
ruma = { git = "https://github.com/project-robius/ruma.git", branch = "tsp"}
[package.metadata.docs.rs]
all-features = true
## An optimized profile for development, with full debug info and assertions.
[profile.debug-opt]
inherits = "dev"
opt-level = 3
## An optimized release profile with thin LTO.
[profile.release-lto]
inherits = "release"
lto = "thin"
## Enable full optimizations when building app bundles for distribution.
[profile.distribution]
inherits = "release"
codegen-units = 1
lto = "fat"
## For very fast compilation, not for creating an actual high-quality executable.
## This is primarily useful for CI builds.
[profile.fast]
inherits = "dev"
opt-level = 0
debug = false
lto = "off"
strip = true
debug-assertions = false
## Configuration for `cargo packager`
[package.metadata.packager]
product_name = "Robrix"
identifier = "org.robius.robrix"
category = "SocialNetworking"
authors = ["Project Robius <contact@robius.rs>", "Kevin Boos <kevinaboos@gmail.com>"]
publisher = "robius"
license_file = "LICENSE-MIT"
copyright = "Copyright 2023-202, Project Robius"
homepage = "https://github.com/project-robius"
### Note: there is an 80-character max for each line of the `long_description`.
long_description = """
Robrix is a multi-platform Matrix chat client written in pure Rust
using the Makepad UI framework (https://github.com/makepad/makepad)
and the Project Robius app dev framework and platform abstractions
(https://github.com/project-robius).
Robrix runs on all major desktop and mobile platforms:
macOS, Windows, Linux, Android, and iOS.
"""
icons = ["./packaging/robrix_logo_alpha.png"]
out_dir = "./dist"
## Here, we define the list of resource directories for both Makepad and Robrix.
## The `src` directory is based on `./dist/` as the `out_dir` (above), which is where the
## `robius-packaging-commands` tool outputs the resources that it discovers after each build.
## See the README from the `robius-packaging-commands` repo for more details.
resources = [
# Makepad resources
{ src = "./dist/resources/makepad_widgets", target = "makepad_widgets" },
{ src = "./dist/resources/makepad_fonts_chinese_bold", target = "makepad_fonts_chinese_bold" },
{ src = "./dist/resources/makepad_fonts_chinese_bold_2", target = "makepad_fonts_chinese_bold_2" },
{ src = "./dist/resources/makepad_fonts_chinese_regular", target = "makepad_fonts_chinese_regular" },
{ src = "./dist/resources/makepad_fonts_chinese_regular_2", target = "makepad_fonts_chinese_regular_2" },
{ src = "./dist/resources/makepad_fonts_emoji", target = "makepad_fonts_emoji" },
# Robrix resources
{ src = "./dist/resources/robrix", target = "robrix" },
]
## We use the `robius-packaging-commands` tool to build the entire Robrix app project,
## which properly configures the release build settings for each target platform
## (e.g., it sets the `MAKEPAD`/`MAKEPAD_PACKAGE_DIR` env vars to the appropriate value).
before-each-package-command = """
robius-packaging-commands before-each-package \
--force-makepad \
--binary-name robrix \
--path-to-binary ./target/release/robrix
"""
deep_link_protocols = [
{ schemes = ["robrix", "matrix"], role = "viewer" }, ## `name` is left as default
]
[package.metadata.packager.deb]
depends = "./dist/depends_deb.txt"
desktop_template = "./packaging/robrix.desktop"
section = "utils"
[package.metadata.packager.macos]
minimum_system_version = "11.0"
frameworks = [ ]
info_plist_path = "./packaging/Info.plist"
entitlements = "./packaging/Entitlements.plist"
signing_identity = "Developer ID Application: AppChef Inc. (SFVQ5V48GD)"
## Configuration for `cargo packager`'s generation of a macOS `.dmg`.
[package.metadata.packager.dmg]
background = "./packaging/Robrix macOS dmg background.png"
window_size = { width = 960, height = 540 }
app_position = { x = 200, y = 250 }
application_folder_position = { x = 760, y = 250 }
## Configuration for `cargo packager`'s generation of a Windows `.exe` setup installer.
[package.metadata.packager.nsis]
## See this: <https://nsis.sourceforge.io/Docs/Chapter4.html#varconstant>
appdata_paths = [
"$APPDATA/$PUBLISHER/$PRODUCTNAME",
"$LOCALAPPDATA/$PRODUCTNAME",
]
[lints.rust]
keyword_idents_2024 = "forbid"
non_ascii_idents = "forbid"
non_local_definitions = "forbid"
unsafe_op_in_unsafe_fn = "forbid"
unnameable_types = "warn"
unused_import_braces = "warn"
## Configuration for clippy lints.
[lints.clippy]
blocks_in_conditions = "allow"
collapsible_if = "allow"
collapsible_else_if = "allow"
doc_overindented_list_items = "allow"
module_name_repetitions = "allow"
too_many_arguments = "allow"
uninlined_format_args = "allow"
used_underscore_binding = "allow"