-
-
Notifications
You must be signed in to change notification settings - Fork 0
Building from Source
This guide covers building the RustyNES project across its various platforms.
- Rust Toolchain: RustyNES targets Rust 1.96 (Edition 2024). Install Rust via rustup.
-
System Dependencies (Linux):
If you're building the desktop frontend on Linux, you need wgpu/winit/cpal dependencies:
# Debian/Ubuntu: sudo apt-get install -y libxkbcommon-dev libwayland-dev libxkbcommon-x11-dev libasound2-dev libudev-dev # Arch/CachyOS: sudo pacman -S --needed libxkbcommon wayland alsa-lib systemd-libs
To build and run the default desktop application (rustynes-frontend):
# Build the workspace
cargo build --release --workspace
# Run the emulator
cargo run --release -p rustynes-frontend -- path/to/rom.nesRustyNES maintains a strict 100% AccuracyCoin testing bar. Ensure your changes pass all tests before submitting PRs.
# Run unit and integration tests
cargo test --workspace
# Run with test ROM suites (AccuracyCoin/blargg)
cargo test --workspace --features test-roms
# Formatting and linting (CI Gates)
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warningsTo build the RetroArch core (rustynes-libretro):
cd crates/rustynes-libretro
makeThe output will be the appropriate shared library for your platform (rustynes_libretro.so, .dylib, or .dll).
To build the web frontend, you'll need the wasm32-unknown-unknown target and trunk:
rustup target add wasm32-unknown-unknown
cargo install trunkRun the dev server:
cd crates/rustynes-frontend/web
trunk serveOr build for production (creates output in dist/):
cd crates/rustynes-frontend/web
trunk build --releaseThe full feature aggregates every optional native feature (retroachievements, scripting, script-ipc, hd-pack, debug-hooks, av-record) that is off by default in standard builds.
# Build with all optional features enabled
cargo build --release -p rustynes-frontend --features fullFor mobile, you'll need Android Studio (for the JNI host in crates/rustynes-android / android/ directory) and/or Xcode (for crates/rustynes-ios / ios/ directory). The core is bridged via rustynes-mobile using UniFFI.
# Example: Adding required targets for Android
rustup target add aarch64-linux-android x86_64-linux-android
cargo install cargo-ndkRustyNES is a cycle-accurate Nintendo Entertainment System emulator written in pure Rust. Licensed under MIT OR Apache-2.0. | GitHub Repository | Web Demo