2023-08-18 12:17:12 -04:00
# Building Astra
2024-03-23 09:55:16 -04:00
There are two methods to build Astra, either via [Flatpak ](https://flatpak.org/ ) or manually using your system libraries. It's highly recommended to prefer the Flatpak, especially if you don't have experience with CMake, C++ and such.
2023-08-18 12:17:12 -04:00
2024-03-23 09:56:42 -04:00
## Flatpak
2023-08-18 12:17:12 -04:00
2024-03-23 09:55:16 -04:00
Building the Flatpak version is easy, and there's a helper script to speed up the process. You must run it from the repository root:
2023-08-18 12:17:12 -04:00
2024-03-23 09:55:16 -04:00
```
$ cd astra
$ ./scripts/build-flatpak.sh
```
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
The process should only take a few minutes on a moderately powerful machine. It does require an Internet connection and the relevant permissions to install the required Flatpak runtimes and extensions.
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
When it's complete, a file called `astra.flatpak` will appear in the repository root and that can be installed with the `flatpak` CLI tool or your preferred application store.
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
## Manual
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
The process to build Astra manually is a little bit more involved, but not difficult. It's easiest to do on rolling release Linux distributions.
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
### Dependencies
2023-09-29 16:49:05 -04:00
2024-03-23 09:55:16 -04:00
#### Required
2023-08-18 12:17:12 -04:00
2024-03-23 09:55:16 -04:00
* [Linux ](https://kernel.org/ )
* Windows, macOS and other systems may work but are currently unsupported. Patches are accepted to fix any problems with those OSes though.
* [CMake ](https://cmake.org ) 3.25 or later
* [Qt ](https://www.qt.io/ ) 6.6 or later
* Base, Declarative, WebView, Concurrent
* [KDE Frameworks ](https://develop.kde.org/products/frameworks/ ) 6
* Extra CMake Modules, Kirigami, I18n, Config, CoreAddons and Archive.
* [Rust ](https://www.rust-lang.org/ )
* [Corrosion ](https://github.com/corrosion-rs/corrosion )
* [unshield ](https://github.com/twogood/unshield )
* [QtKeychain ](https://github.com/frankosterfeld/qtkeychain )
* [QCoro ](https://qcoro.dvratil.cz/ )
#### Optional
2023-08-18 12:17:12 -04:00
2024-03-23 09:55:16 -04:00
These are optional dependencies, that will be used if found on your system.
2023-08-18 12:17:12 -04:00
2024-03-23 09:55:16 -04:00
* Steamworks SDK
* You must specify `STEAMWORKS_INCLUDE_DIRS` and `STEAMWORKS_LIBRARIES` yourself.
* Gamemode
* Turn on `ENABLE_GAMEMODE` to enable integration.
2023-08-18 12:17:12 -04:00
2024-04-22 16:39:25 -04:00
### Getting source code
Astra has git submodules that must be cloned alongside the repository, so make sure to pass the `--recursive` flag:
```bash
$ git clone --recursive https://github.com/redstrate/Astra.git
```
If you missed it, it's possible to initialize the submodules afterward:
```bash
$ git submodule update --init --recursive
```
2024-03-23 09:55:16 -04:00
### Configuring
2023-08-18 12:17:12 -04:00
To configure, run `cmake` in the source directory:
```bash
2024-04-22 16:39:25 -04:00
$ cd Astra
2023-08-18 12:17:12 -04:00
$ cmake -S . -B build
```
2023-10-08 13:16:34 -04:00
This command will create a new build directory and configure the source directory (`.` ). If you want to enable more options, pass them now:
2023-08-18 12:17:12 -04:00
```bash
2023-12-20 19:36:59 -05:00
$ cmake -S . -B build -DENABLE_GAMEMODE=ON
2023-08-18 12:17:12 -04:00
```
## Building
Now begin building the project:
```bash
$ cmake --build build
```
2023-09-29 16:49:05 -04:00
If the build was successful, an `astra` binary will be found in `./build/bin/astra` .