Skip to main content

Prerequisites

Before building the launcher, ensure you have the following dependencies installed on your system.

System Requirements

Required: Rust stable toolchain (edition 2021)Install via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Verify installation:
rustc --version
cargo --version
Required build dependencies:
  • gcc - C compiler
  • cmake - Build system generator
  • pkg-config - Dependency metadata tool
  • git - Version control
Debian/Ubuntu:
sudo apt install build-essential cmake pkg-config git
Fedora:
sudo dnf install gcc gcc-c++ cmake pkg-config git
Arch Linux:
sudo pacman -S base-devel cmake pkg-config git
Required GTK dependencies:
  • gtk4 (>= 4.16)
  • libadwaita (>= 1.5)
  • glib2
  • gdk-pixbuf2
  • gobject-introspection
Debian/Ubuntu:
sudo apt install libgtk-4-dev libadwaita-1-dev libglib2.0-dev \
                 libgdk-pixbuf2.0-dev gobject-introspection
Fedora:
sudo dnf install gtk4-devel libadwaita-devel glib2-devel \
                 gdk-pixbuf2-devel gobject-introspection-devel
Arch Linux:
sudo pacman -S gtk4 libadwaita glib2 gdk-pixbuf2 gobject-introspection
Optional but recommended:
  • unzip - Archive extraction
  • p7zip - 7z archive support
  • libwebp - WebP image support
  • protobuf - Protocol buffers
Install on most distributions:
# Debian/Ubuntu
sudo apt install unzip p7zip-full libwebp-dev protobuf-compiler

# Fedora
sudo dnf install unzip p7zip libwebp-devel protobuf-compiler

# Arch Linux
sudo pacman -S unzip p7zip libwebp protobuf

Building the Launcher

Standard Build

1

Clone the repository

git clone https://github.com/an-anime-team/an-anime-game-launcher.git
cd an-anime-game-launcher
2

Build with Cargo

Debug build (faster compilation, includes debug symbols):
cargo build
Release build (optimized for size and performance):
cargo build --release
Release builds are significantly smaller and faster due to:
  • Link-time optimization (LTO)
  • Symbol stripping
  • Size optimization (opt-level = "s")
3

Run the launcher

Debug build:
./target/debug/anime-game-launcher
Release build:
./target/release/anime-game-launcher

Development Build

For active development with faster iteration:
# Run without building binary
cargo run

# Run with debug output
cargo run -- --debug

# Run with specific session
cargo run -- --session "session-name"

# Check code without building
cargo check

# Run tests
cargo test

Build with Nix

If you use NixOS or Nix package manager, a flake is provided:
1

Enter development shell

The flake provides a complete development environment:
nix develop
This automatically provides:
  • Rust toolchain with rust-src extension
  • All GTK4 and libadwaita dependencies
  • Build tools (gcc, cmake, pkg-config)
  • Development utilities (git, unzip, p7zip, libwebp)
2

Build the package

Build using Nix flake:
nix build
The built binary will be in ./result/bin/
3

Run directly

Run without installing:
nix run
The Nix flake uses binary caches from:
  • cache.nixos.org - Official NixOS cache
  • nix-community.cachix.org - Community packages
  • an-anime-team.cachix.org - Project-specific cache

Command Line Arguments

The launcher supports several CLI arguments:
# Enable debug output
./anime-game-launcher --debug

# Run the game directly (if ready to launch)
./anime-game-launcher --run-game

# Force run game even if updates available
./anime-game-launcher --just-run-game

# Disable verbose tracing in stdout
./anime-game-launcher --no-verbose-tracing

# Switch to specific session
./anime-game-launcher --session "session-name"

Build Artifacts

After building, you’ll find:
target/
├── debug/
│   ├── anime-game-launcher      # Debug binary
│   └── build/                    # Build artifacts
└── release/
    ├── anime-game-launcher      # Optimized binary
    └── build/                    # Build artifacts

Binary Size Comparison

Build TypeTypical SizeOptimization
Debug~50-100 MBNone, includes symbols
Release~15-25 MBLTO + strip + size opt

Development with anime-launcher-sdk

The launcher depends on anime-launcher-sdk. For SDK development:
1

Clone the SDK

git clone https://github.com/an-anime-team/anime-launcher-sdk.git
cd ../anime-launcher-sdk
2

Modify Cargo.toml

In the launcher’s Cargo.toml, uncomment the path dependency:
[dependencies.anime-launcher-sdk]
# git = "https://github.com/an-anime-team/anime-launcher-sdk"
# tag = "1.32.0"
path = "../anime-launcher-sdk"  # Uncomment this line
features = ["all", "genshin"]
3

Build with local SDK

cd ../an-anime-game-launcher
cargo build
Remember to revert to the git dependency before committing changes.

Resource Compilation

GTK resources are automatically compiled during build via build.rs:
// build.rs compiles UI resources
glib_build_tools::compile_resources(
    &["assets"],
    "assets/resources.xml",
    "resources.gresource",
);
Resources include:
  • UI definition files
  • Icons and images
  • Localization files (assets/locales/)
  • Application metadata

Troubleshooting

Ensure you have GTK4 >= 4.16 and libadwaita >= 1.5:
pkg-config --modversion gtk4
pkg-config --modversion libadwaita-1
If versions are too old, you may need to use a newer distribution version or build from source.
If you see errors about glib-build-tools:
cargo clean
cargo build
The build dependency should be automatically fetched.
If you encounter linker errors about missing symbols:
  1. Verify all GTK development packages are installed
  2. Check pkg-config can find them:
    pkg-config --libs gtk4 libadwaita-1
    
  3. Try a clean rebuild:
    cargo clean && cargo build
    
If glib-compile-resources fails:
  1. Ensure glib2 development tools are installed
  2. Check assets/resources.xml is valid
  3. Verify all referenced files exist in assets/

Next Steps

Once you have successfully built the launcher:

Architecture

Understand the codebase structure and design patterns

Contributing

Learn how to contribute to the project

Build docs developers (and LLMs) love