outfly/build
2024-12-10 17:04:19 +01:00
..
docker updated version from tag "v0.10.2" 2024-09-15 00:54:05 +02:00
flatpak Add metainfo file, preparation for flathub release 2024-12-10 17:04:19 +01:00
linux add branding directory 2024-05-21 19:05:49 +02:00
nix add useful nix commands in build/nix/README.md 2024-09-04 21:33:18 +02:00
windows Revert "brighter logo" 2024-05-17 17:17:18 +02:00
generate_starchart.py move src/build to build 2024-05-12 23:16:37 +02:00
pack.sh build/pack.sh: fix shebang (the script requires bash) 2024-09-15 00:18:00 +02:00
README.md update repository URL 2024-05-20 21:56:25 +02:00

This directory contains scripts and data files for building outfly for various operating systems.

Dev Features

For development, it's recommended to use --features dev:

cargo [run|build] --features dev

This enables the following, but ONLY if you run it with cargo run:

  • Mutes music by default (you can still unmute it)
  • Enables "dev mode", which changes the game slightly:
    • Enables additional cheats (see source code)
    • Speeds up dialogs
    • Adds additional debugging features
  • Enables dynamic linking for faster compile times. Note that this makes it harder to run the game directly with ./outfly, please use cargo run instead.
  • Enables bevy's "file watcher" feature that auto-reloads changed assets while the game is running. This obviously works only if the assets are not embedded directly into the binary with the embed_assets feature. Since embed_assets is enabled by default, you must customize your compile features in order to use the file watcher feature, e.g. like: --no-default-features --features "dev x11"

pack.sh

The pack.sh script is used by the developer team to compile and pack release binaries into official packages.

It could serve as a starting point for package maintainers or tinkerers.

Building OutFly

If there is no package for the version or operating system that you need, or if you wish to tinker on the game, you can also build outfly yourself.

On Linux

Install the build dependencies. On ArchLinux, it's the following, though you can replace rust with rustup:

pacman -S rust libx11 pkgconf alsa-lib

Then run the following commands, replacing [URL] with the clone URL of the git repository:

git clone [URL]
cd outfly
cargo run --release

Building for Windows on Linux

rustup target add x86_64-pc-windows-gnu
pacman -S mingw-w64-toolchain  # on ArchLinux. other distros have their equivalent package
cargo build --target=x86_64-pc-windows-gnu --release

More information here: https://bevy-cheatbook.github.io/setup/cross/linux-windows.html

Building on Mac OS

Install homebrew, and then get the following dependencies:

brew install pkg-config molten-vk rustup
rustup-init

Download, compile and run the game:

git clone [URL]
cd outfly
cargo run --release

Building for WASM/Browser

This is a work in progress, for now these are just some general hints:

git clone [URL]
cd outfly
rustup target install wasm32-unknown-unknown
pacman -S wasm-bindgen binaryen
mkdir outfly_wasm
cargo build --release --target wasm32-unknown-unknown
wasm-bindgen --out-name outfly --out-dir outfly_wasm --target web target/wasm32-unknown-unknown/release/outfly.wasm
wasm-opt -Oz --output wasm/outfly_bg.wasm wasm/outfly_bg.wasm
echo '<script type="module">import init from "./outfly.js"; init()</script>' > wasm/index.html
python -m http.server -d wasm

Building release versions optimized for packaging

To build release versions optimized for final deployment, build with the following features: (see also pack.sh)

cargo build --release --no-default-features --features release_[linux|windows] [--target=$YOUR_TARGET]