Skip to content

Commit

Permalink
Remove native dependencies in favor of rustls and sqlite-bundled.
Browse files Browse the repository at this point in the history
This VASTLY simplifies building for Android and Windows targets.
  • Loading branch information
kevinaboos committed Mar 12, 2024
1 parent 616496a commit d940693
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 116 deletions.
120 changes: 11 additions & 109 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 16 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ eyeball-im = "0.4.2"
futures-util = "0.3"
imbl = { version = "2.0.0", features = ["serde"] } # same as matrix-sdk-ui
imghdr = "0.7.0"
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", features = [ "experimental-sliding-sync" ] }
matrix-sdk-ui = { git = "https://github.com/matrix-org/matrix-rust-sdk" }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk", default-features = false, features = [ "experimental-sliding-sync", "e2e-encryption", "automatic-room-key-forwarding", "sqlite", "rustls-tls", "bundled-sqlite" ] }
matrix-sdk-ui = { git = "https://github.com/matrix-org/matrix-rust-sdk", default-features = false, features = [ "e2e-encryption", "rustls-tls" ] }
rangemap = "1.5.0"
tokio = { version = "1.33.0", features = ["macros", "rt-multi-thread"] }
tracing-subscriber = "0.3.17"
unicode-segmentation = "1.10.1"
url = "2.2.2"


###################################################################################################
#### Note: we now enable the usage of `rustls-tls` and the `bundled-sqlite` features in the 2 ####
#### matrix crate dependencies, so the below android- and windows-specific dependencies ####
#### are no longer needed. However, if you wish to disable those features, you would ####
#### need to re-enable the below target-specific dependencies. ####
###################################################################################################

## On Android, we currently build OpenSSL and SQLite from
## the vendored source code, because on macOS hosts there aren't yet
## prebuilt versions readily available, nor easily-configured pkg-config sysroots
Expand All @@ -54,9 +61,10 @@ url = "2.2.2"
## but there's no way to specify that in Cargo.toml, so we just always include them.
## Plus, this makes builds more reproducible across host systems,
## and avoids the issue of needing to set up pkg-config sysroots on Linux.
[target.'cfg(target_os = "android")'.dependencies]
openssl = { version = "*", features = ["vendored"] }
rusqlite = { version = "*", features = ["bundled"] }
##
# [target.'cfg(target_os = "android")'.dependencies]
# openssl = { version = "*", features = ["vendored"] }
# rusqlite = { version = "*", features = ["bundled"] }

## On Windows, there are prebuilt versions of sqlite3 available,
## but building it from bundled source is just easier and works out of the box.
Expand All @@ -68,8 +76,9 @@ rusqlite = { version = "*", features = ["bundled"] }
## directly from the sqlite website: <https://www.sqlite.org/download.html>,
## where you'll want the 64-bit DLL (x64) under "Precompiled Binaries for Windows".
## You'll need to add the directory of that prebuilt sqlite DLL to your path env variable.
[target.'cfg(target_os = "windows")'.dependencies]
rusqlite = { version = "*", features = ["bundled"] }
##
# [target.'cfg(target_os = "windows")'.dependencies]
# rusqlite = { version = "*", features = ["bundled"] }


[package.metadata.docs.rs]
Expand Down

0 comments on commit d940693

Please sign in to comment.