Building from Source Dependencies
Relevant source files
The following files were used as context for generating this wiki page:
The Kaleidux project is a high-performance wallpaper daemon written in Rust, utilizing modern graphics APIs and multimedia frameworks. Building from source requires a specific set of toolchains, system libraries, and development headers to ensure full functionality for hardware acceleration and video playback.
The build process is managed primarily through Cargo, the Rust package manager, which handles the compilation of the daemon (kaleidux-daemon), the CLI controller (kldctl), and shared library components.
Sources: CONTRIBUTING.md:46-52, README.md:104-106
Core Development Toolchain
The primary requirement for building Kaleidux is a stable Rust environment. The project specifies a minimum version and prohibits the use of nightly features to maintain stability.
| Dependency | Requirement | Purpose |
|---|---|---|
| Rust | 1.89+ Stable | Core language and compiler |
| Cargo | Included with Rust | Package management and build automation |
| Git | Latest | Version control and repository management |
Sources: CONTRIBUTING.md:46-52, README.md:104-106
Toolchain Verification
Before initiating a build, developers should verify their toolchain version to avoid compilation errors related to edition 2021 features or specific dependency requirements.
rustc --version # Ensure version >= 1.89 stable
cargo --version
Sources: CONTRIBUTING.md:46-52, Cargo.toml:13
System Dependencies and Libraries
Kaleidux relies on several low-level system libraries for rendering, window management, and video decoding. These must be present on the host system before Cargo can successfully link the binaries.
Rendering and Graphics
The project uses WGPU for hardware-accelerated transitions. This necessitates Vulkan or GPU-specific drivers and development headers.
- Vulkan/GPU Drivers: Required for WGPU hardware acceleration.
- libX11-devel: Required for X11 backend support.
- Vulkan-devel: Necessary for shader compilation and device discovery.
Multimedia Support
Video wallpaper support is implemented via GStreamer. Version 1.20 or higher is required along with development plugins.
- GStreamer Core:
gstreamer-1.0 - Plugins:
gst-plugins-base,gst-plugins-good,gst-plugins-bad,gst-libav.
Windowing Systems
Kaleidux supports both Wayland and X11.
- Wayland: Requires
wayland-clientandwayland-scanner(for protocol bindings). - X11: Requires
libx11andxcb.
Sources: CONTRIBUTING.md:58-64, README.md:112-117, kaleidux-daemon/Cargo.toml:34-39
Build Pipeline and Data Flow
The build process involves resolving workspace members and linking against system-level shared objects. The following diagram illustrates the relationship between the source modules and their external requirements.
This diagram shows how the build command triggers the compilation of both binaries while linking the daemon to essential system media and graphics libraries.
Sources: Cargo.toml:2-6, CONTRIBUTING.md:89-105
Workspace Dependencies
The project is structured as a Cargo workspace with three primary members. These members share certain dependencies defined in the root Cargo.toml.
| Member | Binary Name | Responsibility |
|---|---|---|
kaleidux-daemon | kaleidux-daemon | Background service, WGPU rendering, IPC loop |
kldctl | kldctl | CLI utility for IPC communication |
kaleidux-common | N/A (Library) | Shared types and IPC protocol definitions |
Sources: Cargo.toml:2-6, CONTRIBUTING.md:89-105
Critical Crate Dependencies
- WGPU (v23.0): Used for the rendering pipeline and GLSL shader support.
- GStreamer (v0.23): Handles video playback and app-sinks.
- Tokio (v1.40): Provides the asynchronous runtime for the IPC socket and daemon loop.
- Rhai (v1.19): Integrated for automation scripting.
- Redb (v2.1): Used for file caching and persistent storage.
Sources: Cargo.toml:17-50, kaleidux-daemon/Cargo.toml:9-30
Building the Project
The build process can be performed in debug or release mode. Release mode is recommended for performance due to the intensive nature of real-time GPU rendering.
Standard Build Sequence
Sources: README.md:119-122, CONTRIBUTING.md:75-81
Build Commands
- Debug Build:
cargo build(Faster compilation, no optimizations). - Release Build:
cargo build --release(Highly optimized, required for smooth transitions). - Package Specific:
cargo build -p kaleidux-daemon(Builds only the daemon).
Sources: CONTRIBUTING.md:75-87
Conclusion
Building Kaleidux from source requires a combination of the Rust stable toolchain and a suite of Linux development headers for graphics and media. By leveraging a Cargo workspace, the project maintains a clear separation between the rendering engine, the control utility, and the communication protocol while sharing a centralized dependency configuration.
Sources: Cargo.toml:2-6, PROJECT_STANDARDS.md:23-28