Building from source
Desktop
You need a stable Rust toolchain (install it with rustup). On Linux you also need the development headers for ALSA (sound) and for X11/Wayland windowing. On Debian or Ubuntu:
sudo apt-get install libasound2-dev libxkbcommon-dev libwayland-dev \
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
Windows and macOS need nothing beyond Rust (and the Xcode command-line tools on macOS).
git clone https://github.com/ZahakJ/abax
cd abax
cargo run --release -p abax
The release profile uses link-time optimisation, strips symbols and aborts on panic.
The release gate: ./verify
./verify
runs, in order, and stops at the first failure:
cargo fmt --all -- --check: formatting.cargo clippy --workspace --all-targets -- -D warnings: lints, with every warning an error.cargo test --workspace: all unit tests.cargo build --release -p abax: the desktop binary.
CI runs the same script on every push.
Android, without Gradle
Abax on Android is a pure native app: the manifest says hasCode="false"
and the activity is Android’s built-in NativeActivity, which loads
libabax.so and calls its android_main. android/build-apk.sh builds the
APK with the SDK’s command-line tools.
What you need
- The Android SDK with
build-tools;35.0.0andplatforms;android-35. - The NDK (CI uses 27.2.12479018).
- A JDK, for
apksignerandkeytool. cargo-ndkand the Rust Android targets:
cargo install cargo-ndk
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
export ANDROID_HOME=/path/to/android-sdk
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.2.12479018
export JAVA_HOME=/path/to/jdk
Build
android/build-apk.sh --abis arm64-v8a --out dist/abax.apk
android/build-apk.sh --abis "arm64-v8a armeabi-v7a x86_64" --out dist/abax-universal.apk
Add --debug for an unoptimised build.
What the script does, step by step
- Native library.
cargo ndk -t <abi> … --platform 24 build -p abax --releasecompiles theabaxcrate aslibabax.sofor each ABI, against API level 24 (Android 7.0)..cargo/config.tomladds-z max-page-size=16384to the link, which Android 15 devices with 16 KB memory pages require. - Resources.
aapt2 compileturnsandroid/res/(icon, label, theme) into compiled resources;aapt2 linkcombines them withandroid/AndroidManifest.xmland the platform’sandroid.jarinto an unsigned APK. The version name comes from the workspaceCargo.tomland the version code is major × 10000 + minor × 100 + patch (0.3.0 is 300). - Libraries in. A few lines of Python add
lib/<abi>/libabax.soto the APK uncompressed, so Android can map them straight from the APK instead of extracting them. - Align.
zipalign -P 16 -f 4aligns the uncompressed libraries to 16 KB pages and everything else to 4 bytes. - Sign.
apksigner signsigns with APK signature schemes v2 and v3, thenapksigner verifyandaapt dump badgingprint what was built: the package,minSdkVersion 24,targetSdkVersion 35, the launchableandroid.app.NativeActivityand the native ABIs.
Pinned SDK components
The script uses fixed versions, not the newest in your SDK:
| Variable | Default | Selects |
|---|---|---|
ABAX_BUILD_TOOLS | 35.0.0 | $ANDROID_HOME/build-tools/<version> |
ABAX_PLATFORM | 35 | $ANDROID_HOME/platforms/android-<version>/android.jar |
It stops if either is missing.
Signing
Without ABAX_KEYSTORE the script signs with a throwaway debug key under
target/android/. Android refuses to update an app signed with a different
key, so a release needs a stable one:
| Variable | Meaning |
|---|---|
ABAX_KEYSTORE | path to the keystore |
ABAX_KEYSTORE_PASSWORD | its password (also used as the key password) |
ABAX_KEY_ALIAS | the key’s alias |
In the release workflow the keystore arrives base64-encoded in the
ABAX_KEYSTORE_B64 secret; the job fails without the three secrets.
Releases
Pushing a tag vX.Y.Z runs .github/workflows/release.yml: it builds Linux
(tarball with an installer), Windows (zip), macOS for Apple silicon and Intel
(dmg, cross-compiled on one Apple silicon runner) and both Android APKs,
writes SHA256SUMS.txt, and publishes a GitHub release whose text is the
tag’s section of CHANGELOG.md.
The website
The landing page and this manual are built by docs/build.sh and published
to GitHub Pages by .github/workflows/pages.yml on every push to main that
touches docs/. To build them locally you need
mdBook 0.5.4:
cargo install mdbook --version 0.5.4 --locked
docs/build.sh site-out
python3 -m http.server -d site-out 8000 # landing page at /, manual at /manual/
All links are relative, so the site works under any path.