-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathCargo.toml
More file actions
368 lines (319 loc) · 15 KB
/
Copy pathCargo.toml
File metadata and controls
368 lines (319 loc) · 15 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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
[package]
name = "robrix"
authors = ["Kevin Boos <kevinaboos@gmail.com>", "Robius Project Maintainers"]
description = "A powerful multi-platform Matrix chat client written in Rust using Makepad + Robius app dev framework."
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 = "1.0.0-beta.1"
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" }
robius-directories = { git = "https://github.com/project-robius/robius" }
robius-file-picker = { git = "https://github.com/project-robius/robius" }
robius-location = { git = "https://github.com/project-robius/robius" }
robius-open = { git = "https://github.com/project-robius/robius" }
robius-share = { git = "https://github.com/project-robius/robius" }
robius-use-makepad = "0.1.1" ## auto-configures all `robius-*` crates to work with Makepad.
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
futures = "0.3"
imbl = { version = "6.1.0", features = ["serde"] } # same as matrix-sdk-ui
futures-util = "0.3"
hashbrown = { version = "0.16", features = ["raw-entry"] }
htmlize = { version = "1.0.5", features = ["unescape"] }
indexmap = "2.6.0"
libc = "0.2"
mime = "0.3"
mime_guess = "2.0"
linkify = "0.10.0"
matrix-sdk-base = { git = "https://github.com/matrix-org/matrix-rust-sdk" }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", default-features = false, features = [
"e2e-encryption",
"automatic-room-key-forwarding",
"markdown",
"sqlite",
"bundled-sqlite",
"sso-login",
] }
matrix-sdk-ui = { git = "https://github.com/matrix-org/matrix-rust-sdk", default-features = false }
## 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.
## * "unstable-compat-lax-syncv5-deser" feature to tolerate deserialization failures, which we added.
## * Note: we need a feature like "compat-unset-display-name" to unset display names, but that doesn't exist yet.
##
## Note: we actually patch this below to use our `tsp` branch instead.
ruma = { git = "https://github.com/ruma/ruma", rev = "8beb557b466a43b057c9c155277c77fe8766fadf", features = [
"compat-optional",
"compat-unset-avatar",
"unstable-compat-lax-syncv5-deser",
] }
num_cpus = "1.17.0"
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 = { version = "0.3.17", features = ["env-filter"] }
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 feature,
## 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 0.12 features were taken from the tsp_sdk's `Cargo.toml` file.
## This is only needed for the optional TSP feature; the matrix-sdk uses reqwest 0.13 internally,
## which is re-exported as `matrix_sdk::reqwest` and used by regular (non-TSP) Robrix code.
reqwest = { version = "0.12", default-features = false, optional = true, features = [
"rustls-tls-native-roots",
"json",
"stream",
"charset",
"http2",
"macos-system-configuration",
] }
## For OAuth/SSO login on iOS, via `ASWebAuthenticationSession`. Ugh....
[target.'cfg(target_os = "ios")'.dependencies]
robius-web-auth-session = { git = "https://github.com/project-robius/robius" }
## On Android, the matrix-sdk no longer sets up TLS roots for rustls by default,
## so we have to do it manually.
[target.'cfg(target_os = "android")'.dependencies]
webpki-root-certs = "1"
[features]
default = []
## Enables experimental support for using TSP wallets.
tsp = ["dep:tsp_sdk", "dep:quinn", "dep:aws-lc-rs", "dep:percent-encoding", "dep:reqwest"]
## Hides the command prompt console/log window on Windows.
## This is enabled automatically for packaged builds via cargo-packager
## (see `build.rs`), but you can also enable it manually if desired.
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.
##
## Note: matrix-sdk currently uses a git dependency for ruma,
## so we patch the git source, not crates-io.
[patch."https://github.com/ruma/ruma"]
ruma = { git = "https://github.com/project-robius/ruma.git", branch = "tsp" }
## See our PR: <https://github.com/matrix-org/matrix-rust-sdk/pull/6976>
## Remove this once that PR is merged in.
[patch."https://github.com/matrix-org/matrix-rust-sdk"]
matrix-sdk-store-encryption = { git = "https://github.com/project-robius/matrix-rust-sdk.git", branch = "store-cipher-serde-bytes" }
[build-dependencies]
toml = "1"
## On Windows, use the `winresource` crate to embed the app's icon and metadata into the executable.
[target.'cfg(windows)'.build-dependencies]
winresource = "0.1"
[package.metadata.docs.rs]
all-features = true
[profile.release]
debug = false
strip = "symbols"
## 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 makepad (`cargo makepad android build-aab`).
## The `[package.metadata.packager]` section below already sets the package ID
## and product name, so we just need a version code for Google Play Store builds.
[package.metadata.makepad.android]
## Specifying "auto" will set it to a format like 'YYYYMMDDHH'.
version_code = "auto"
## Configuration for `cargo packager`
[package.metadata.packager]
product_name = "Robrix"
identifier = "rs.robius.robrix"
category = "SocialNetworking"
authors = [
"Project Robius <contact@robius.rs>",
"Kevin Boos <kevinaboos@gmail.com>",
]
publisher = "GOSIM Foundation"
license_file = "LICENSE-MIT"
copyright = "Copyright 2023-2026, Project Robius"
homepage = "https://github.com/project-robius/robrix"
### Note: there is an 80-character max for the one-line summary.
description = "A powerful multi-platform Matrix chat client written from scratch in Rust"
### Note: there is an 80-character max for each line of the `long_description`.
long_description = """
Robrix is a powerful open-source 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 = [
"./resources/icon_32.png",
"./resources/icon_48.png",
"./resources/icon_64.png",
"./resources/icon_128.png",
"./resources/icon_256.png",
"./resources/icon_512.png",
"./resources/icon.ico",
]
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).
## Note: `geoclue-2.0` has to be declared by hand. It's a D-Bus service that `robius-location`
## talks to over a socket, so there's no linked library or dlopen'd soname for the tool to find.
before-each-package-command = """
robius-packaging-commands before-each-package \
--force-makepad \
--binary-name robrix \
--path-to-binary ./target/release/robrix \
--add-deb-dep geoclue-2.0
"""
## This is not yet implemented, so remove it.
# 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"
## These metainfo and licensing files are needed for package manager compliance.
[package.metadata.packager.deb.files]
"./packaging/rs.robius.robrix.metainfo.xml" = "/usr/share/metainfo/rs.robius.robrix.metainfo.xml"
"./packaging/debian-copyright" = "/usr/share/doc/robrix/copyright"
"./licenses/THIRD-PARTY-NOTICES.html" = "/usr/share/doc/robrix/THIRD-PARTY-NOTICES.html"
[package.metadata.packager.appimage.files]
"./packaging/rs.robius.robrix.metainfo.xml" = "/usr/share/metainfo/rs.robius.robrix.metainfo.xml"
"./packaging/debian-copyright" = "/usr/share/doc/robrix/copyright"
"./licenses/THIRD-PARTY-NOTICES.html" = "/usr/share/doc/robrix/THIRD-PARTY-NOTICES.html"
[package.metadata.packager.pacman.files]
"./packaging/rs.robius.robrix.metainfo.xml" = "/usr/share/metainfo/rs.robius.robrix.metainfo.xml"
"./packaging/debian-copyright" = "/usr/share/licenses/robrix/copyright"
"./licenses/THIRD-PARTY-NOTICES.html" = "/usr/share/licenses/robrix/THIRD-PARTY-NOTICES.html"
[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: GOSIM FOUNDATION LTD. (HMX6XGJZ3R)"
## 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]
installer_icon = "./resources/icon.ico"
## 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"
needless_late_init = "allow"
too_many_arguments = "allow"
uninlined_format_args = "allow"
used_underscore_binding = "allow"