Hyperspeedcube requires the latest version of the Rust compiler.
- Download/install Cargo.
- On Linux, install build-time dependencies:
sudo apt install cmake libglib2.0-dev libatk1.0-dev libgtk-3-dev libxkbcommon-x11-dev
- Clone this project and build/run:
git clone https://github.com/HactarCE/Hyperspeedcube
cd Hyperspeedcube
cargo run --release
The first build may take ~10 minutes or more. Remove --release
to disable optimizations, which makes building faster but Hyperspeedcube may run slower.
- Download/install Rustup.
- Download this project and extract it somewhere.
- Open a terminal in the folder where you extracted Hyperspeedcube (it should have
Cargo.toml
in it) and build it usingcargo build --release
or run it usingcargo run --release
.
The first build may take ~10 minutes or more. Remove --release
to disable optimizations, which makes building faster but Hyperspeedcube may run slower.
- Follow instructions above to run the native version first.
- Install wasm32 target with
rustup target add wasm32-unknown-unknown
- Install Trunk with
cargo install --locked trunk
- Run
trunk serve
to build and serve on http://127.0.0.1:8080. Trunk will rebuild automatically if you edit the project. Open http://127.0.0.1:8080/index.html#dev in a browser.
If you get an error on trunk serve
about failing to downloat wasm-bindgen, try installing wasm-bindgen-cli with cargo install --locked wasm-bindgen-cli --version 0.2.83
. In case I haven't updated this guide, check Cargo.toml
(or hyperspeedcube/Cargo.toml
) for the version in use.
Note that assets/sw.js
script will try to cache the app, and loads the cached version when it cannot connect to server allowing the app to work offline (like PWA). appending #dev
to index.html
will skip this caching, allowing to load the latest builds during development.
Due to cargo#8662 / cargo#8716, switching between WASM and native may cause a rebuild of the full program. To work around this, set the CARGO_TARGET_DIR
environment variable to point to a different directory when running trunk serve
. serve-web.ps1
accomplishes this on Windows.