 ca4a2114a8
			
		
	
	
		ca4a2114a8
		
			
		
	
	
	
	
		
			
			This may need to be added for all Linux distros, but I'm testing in WSL2, and Ubuntu 20.04 was all I had.
		
			
				
	
	
	
		
			2.2 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	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
sudo apt-get install pkg-config libx11-dev libasound2-dev
Fedora 32
sudo dnf install gcc-c++ libX11-devel alsa-lib-devel
Arch / Manjaro
sudo pacman -S libx11 pkgconf alsa-lib
Solus
sudo eopkg install pkg-config libx11-devel g++ alsa-lib-devel
NixOS
Add a build.rs file to your project with the following:
fn main() {
    if cfg!(target_os = "linux") {
        println!("cargo:rustc-link-lib=vulkan");
    }
}
The following packages are known to provide the dependencies required to run a bevy project. They can be installed globally or via nix-shell.
nix-shell -p pkgconfig x11 xorg.libXcursor xorg.libXrandr xorg.libXi vulkan-tools lutris vulkan-headers vulkan-loader vulkan-validation-layers alsaLib
At this point, projects should successfully compile but fail on execution. This is due to glslang_validator which, unfortunately, needs to have it's binary patched to link correctly. This is a known issue and there are plans to remove this dependency.
- find target -type f -name glslang_validatorin order to find glslang_validator in- target/debug/build/bevy-glsl-to-spirv-<hash>/out/glslang_validator. The directory containing glslang_validator will be referenced again, so save it for later:- export OUT_DIR="$(dirname $(find target -type f -name glslang_validator))".
- Running ldd $OUT_DIR/glslang_validatormay showlibstdc++.so.6is not found. If all dependencies are found, then bevy should work. If not, install (globally or in nix-shell) any of the results found bynix-locate -w libstdc++.so.6. For example purposes, considernixos.gcc-unwrapped. In theory, any of the ones infind -L /nix/store -type f -name libstdc++.so.6will work.
- patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath /nix/store/784rh7jrfhagbkydjfrv68h9x3g4gqmk-gcc-8.3.0-lib/lib $OUT_DIR/glslang_validator
- Bevy should now be working properly!