- Install the required dependencies:
- Debian/Ubuntu:
sudo apt install build-essential libssl-dev libfontconfig1-dev libsqlite3-dev libgtk-4-dev libwebkitgtk-6.0-dev libsoup-3.0-dev libjavascriptcoregtk-6.0-dev - openSUSE:
sudo zypper install libopenssl-3-devel sqlite3-devel fontconfig-devel gtk4-devel webkit2gtk4-devel - macOS: Xcode Command Line Tools (
xcode-select --install) for the C toolchain. Add the target once withrustup target add aarch64-apple-darwin(orx86_64-apple-darwinon Intel). OpenSSL: either the system/Homebrew package (brew install openssl@3) or build with--features snxcore/vendored-opensslto avoid the Homebrew dependency, as the release pipeline does (seepackage/macos/build.sh). - Other distros: C compiler, OpenSSL, SQLite3, fontconfig, optionally GTK4 and WebKit6 development package
- Debian/Ubuntu:
- Install a recent Rust compiler
- Run
cargo buildto build the debug version, orcargo build --releaseto build the release version. - To build a version with the mobile-access feature and embedded WebKit portal login, pass the
--features=mobile-accessparameter. On Linux this needs the GTK4/WebKit6 packages listed above; macOS and Windows use the system WebView and need no extra packages.
NOTE: the minimal supported Rust version is 1.88.
The snx-rs command line application can be built and linked statically to use in containers or embedded environments. System requirements: same as the normal build + docker or podman.
Static build instructions:
- Install
cross-rswithcargo install cross - Add
x86_64-unknown-linux-musltarget to the Rust compiler:rustup target add x86_64-unknown-linux-musl - Build a static snx-rs executable with
cross build --target=x86_64-unknown-linux-musl --features snxcore/vendored-openssl,snxcore/vendored-sqlite -p snx-rs --profile lto