2020-08-13 07:59:03 +00:00
|
|
|
# Installing Linux dependencies
|
|
|
|
|
|
|
|
This page lists the required dependencies to build a Bevy project on your Linux machine.
|
|
|
|
|
|
|
|
If you don't see your distro present in the list, feel free to add the instructions in this document.
|
|
|
|
|
|
|
|
## Ubuntu 20.04
|
2020-10-21 22:57:03 +00:00
|
|
|
|
2020-08-23 20:18:46 +00:00
|
|
|
```bash
|
2020-09-21 20:16:17 +00:00
|
|
|
sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev
|
2020-08-23 20:18:46 +00:00
|
|
|
```
|
2021-02-22 04:50:05 +00:00
|
|
|
|
2021-03-07 19:17:25 +00:00
|
|
|
Depending on your graphics card, you may have to install one of the following:
|
|
|
|
`vulkan-radeon`, `vulkan-intel`, or `mesa-vulkan-drivers`
|
|
|
|
|
2021-02-04 03:15:25 +00:00
|
|
|
If you want to enable fast compiles
|
2021-02-22 04:50:05 +00:00
|
|
|
|
2020-12-15 07:10:58 +00:00
|
|
|
```bash
|
|
|
|
sudo apt-get install clang
|
|
|
|
```
|
|
|
|
|
2020-10-29 01:51:51 +00:00
|
|
|
### Windows Subsystem for Linux (WSL 2)
|
|
|
|
|
2021-02-22 04:50:05 +00:00
|
|
|
Graphics and audio need to be configured for them to work with WSL 2 backend.
|
|
|
|
Please see the ubuntu [WSL documentation](https://wiki.ubuntu.com/WSL) on how to set up graphics and audio.
|
2020-08-13 23:45:43 +00:00
|
|
|
|
2020-12-24 19:30:36 +00:00
|
|
|
## Fedora 33
|
2020-10-21 22:57:03 +00:00
|
|
|
|
2020-08-23 20:18:46 +00:00
|
|
|
```bash
|
2020-09-21 20:53:17 +00:00
|
|
|
sudo dnf install gcc-c++ libX11-devel alsa-lib-devel systemd-devel
|
2020-08-23 20:18:46 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Arch / Manjaro
|
2020-10-21 22:57:03 +00:00
|
|
|
|
2020-08-23 20:18:46 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -S libx11 pkgconf alsa-lib
|
|
|
|
```
|
2020-08-25 23:50:44 +00:00
|
|
|
|
|
|
|
## Solus
|
2020-10-21 22:57:03 +00:00
|
|
|
|
2020-08-25 23:50:44 +00:00
|
|
|
```bash
|
|
|
|
sudo eopkg install pkg-config libx11-devel g++ alsa-lib-devel
|
|
|
|
```
|
2020-08-29 00:09:44 +00:00
|
|
|
|
2020-10-08 17:28:56 +00:00
|
|
|
## Void
|
2020-10-21 22:57:03 +00:00
|
|
|
|
2020-10-08 17:28:56 +00:00
|
|
|
```bash
|
|
|
|
sudo xbps-install -S pkgconf alsa-lib-devel libX11-devel eudev-libudev-devel
|
|
|
|
```
|
|
|
|
|
2020-08-29 00:09:44 +00:00
|
|
|
## NixOS
|
|
|
|
|
2021-03-03 03:27:02 +00:00
|
|
|
Add a `build.rs` file to your project containing:
|
2020-08-29 00:09:44 +00:00
|
|
|
|
|
|
|
```rust
|
2021-03-03 03:27:02 +00:00
|
|
|
# build.rs
|
|
|
|
|
2020-08-29 00:09:44 +00:00
|
|
|
fn main() {
|
|
|
|
if cfg!(target_os = "linux") {
|
|
|
|
println!("cargo:rustc-link-lib=vulkan");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-02-04 03:15:25 +00:00
|
|
|
These packages provide the dependencies required to run a bevy project. They can be installed globally or via nix-shell.
|
2021-03-03 03:27:02 +00:00
|
|
|
Based on your global configuration it also might be necessary to allow unfree packages:
|
2020-08-29 00:09:44 +00:00
|
|
|
|
2021-03-03 03:27:02 +00:00
|
|
|
```bash
|
|
|
|
export NIXPKGS_ALLOW_UNFREE=1 # needed for lutris
|
|
|
|
nix-shell -p cargo pkgconfig udev lutris alsaLib x11 xorg.libXcursor xorg.libXrandr xorg.libXi vulkan-tools vulkan-headers vulkan-loader vulkan-validation-layers
|
|
|
|
```
|
2020-08-29 00:09:44 +00:00
|
|
|
|
2021-03-03 03:27:02 +00:00
|
|
|
Alternatively, you can define `shell.nix` containing:
|
2020-09-14 21:34:43 +00:00
|
|
|
|
|
|
|
```nix
|
|
|
|
# shell.nix
|
|
|
|
|
|
|
|
{ pkgs ? import <nixpkgs> { } }:
|
2021-03-03 03:27:02 +00:00
|
|
|
with pkgs;
|
|
|
|
mkShell {
|
2020-09-14 21:34:43 +00:00
|
|
|
buildInputs = [
|
2021-03-03 03:27:02 +00:00
|
|
|
cargo
|
|
|
|
pkgconfig udev alsaLib lutris
|
|
|
|
x11 xorg.libXcursor xorg.libXrandr xorg.libXi
|
|
|
|
vulkan-tools vulkan-headers vulkan-loader vulkan-validation-layers
|
2020-09-14 21:34:43 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-03-03 03:27:02 +00:00
|
|
|
And enter it by just running `nix-shell`.
|
2020-08-29 00:09:44 +00:00
|
|
|
|
2021-03-03 03:27:02 +00:00
|
|
|
You should be able compile bevy programms using `cargo` within this nix-shell.
|