Robrix is a Matrix chat client written in Rust to demonstrate the functionality of Project Robius, a framework for multi-platform application development in Rust. Robrix is written using the Makepad UI toolkit.
Note
Check out our most recent talks and presentations for more info:
The following table shows which host systems can currently be used to build Robrix for which target platforms.
| Host OS | Target Platform | Builds? | Runs? |
|---|---|---|---|
| macOS | macOS | ✅ | ✅ |
| macOS | Android | ✅ | ✅ |
| macOS | iOS | ✅ | ✅ |
| Linux | Linux | ✅ | ✅ |
| Linux | Android | ✅ | ✅ |
| Windows | Windows | ✅ | ✅ |
| Windows | Android | ✅ | ✅ |
First, install Rust.
If you're building on Linux or WSL on Windows, install the required dependencies. Otherwise, proceed to step 3.
openssl, clang/libclang, binfmt, Xcursor/X11, asound/pulse.On a Debian-like Linux distro (e.g., Ubuntu), run the following:
sudo apt-get update
sudo apt-get install libssl-dev libsqlite3-dev pkg-config binfmt-support libxcursor-dev libx11-dev libasound2-dev libpulse-devThen, build and run Robrix (you can optionally add --release):
cargo runIf you want to provide a username and password for fast auto-login, you can do that on the command line like so. Note that you only have to specify this once; after one successful login, Robrix will automatically re-login the most recent user without having to specify the user's ID or password.
cargo run -- 'USERNAME' 'PASSWORD' ['HOMESERVER_URL']HOMESERVER_URL argument is optional and uses the "https://matrix-client.matrix.org/" URL by default.Install the cargo-makepad build tool:
cargo install --force --git https://github.com/makepad/makepad.git --branch rik cargo-makepadUse cargo-makepad to install the Android toolchain, with the full NDK:
cargo makepad android install-toolchain --full-ndkBuild and run Robrix using cargo-makepad:
cargo makepad android run -p robrix --releaseThese are generally sorted in order of priority. If you're interested in helping out with anything here, please reach out via a GitHub issue or on our Robius matrix channel.
Tip
We already have pre-built releases of Robrix available for download.
cargo-packager:rustup update stable ## Rust version 1.79 or higher is required
cargo +stable install --force --locked cargo-packagerFor posterity, these instructions have been tested on cargo-packager version 0.10.1, which requires Rust v1.79.
robius-packaging-commands crate with the makepad feature enabled:cargo install --locked --git https://github.com/project-robius/robius-packaging-commands.gitcargo packager --release ## --verbose is optionalNote that due to platform restrictions, you can currently only build:
There are some additional considerations when packaging Robrix for macOS:
Important
You will see a .dmg window pop up — please leave it alone, it will auto-close once the packaging procedure has completed.
Tip
If you receive the following error:
ERROR cargo_packager::cli: Error running create-dmg script: File exists (os error 17)
then open Finder and unmount any Robrix-related disk images, then try the above cargo packager command again.
Tip
If you receive an error like so:
Creating disk image...
hdiutil: create failed - Operation not permitted
could not access /Volumes/Robrix/Robrix.app - Operation not permitted
then you need to grant "App Management" permissions to the app in which you ran the cargo packager command, e.g., Terminal, Visual Studio Code, etc.
To do this, open System Preferences → Privacy & Security → App Management,
and then click the toggle switch next to the relevant app to enable that permission.
Then, try the above cargo packager command again.
After the command completes, you should see both the Robrix.app and the .dmg in the dist/ directory.
You can immediately double-click the Robrix.app bundle to run it, or you can double-click the .dmg file to
Note that the
.dmgis what should be distributed for installation on other machines, not the.app.
If you'd like to modify the .dmg background, here is the Google Drawings file used to generate the MacOS .dmg background image.