-
Notifications
You must be signed in to change notification settings - Fork 28
Build from source
Preferred IDE (optional): Visual Studio Code with rust-analyzer extension
- Install rustup
- Install LLVM
- Install MSVC compiler (for example from C++ build tools with Visual Studio)
On the repository root execute:
cargo xtask build-server --release
ALVR server will be built into /build/alvr_server_windows
.
- Install rustup
- Install LLVM
- Latest version of Android Studio, SDK level 30, NDK v22
- Environment variable
JAVA_HOME
set toC:\Program Files\Android\Android Studio\jre
- Environment variable
ANDROID_SDK_ROOT
set to%LOCALAPPDATA%\Android\Sdk
- For building Android dependencies (optional): Python
On the repository root execute:
cargo xtask build-android-deps
cargo xtask build-client --release
ALVR client APKs will be built as /build/alvr_client_*.apk
.
Note: You can debug the client normally by opening the Android Studio project at alvr/client/android
.
Note: If you have problems running build-android-deps
:
- Go to the nightly CI runs list
- Open the latest workflow run
- Download the artifact
android-deps
- Create a
deps
folder on the project root - Unzip
android-deps.zip
inside thedeps
folder. You should have the filedeps/rust-android-gradle/runst-android-0.8.3.jar
- AMD using radv is known to work, with hardware encoding
- AMD using amdvlk does not work
- NVIDIA using proprietary driver works, with software encoding
- Intel is untested
An RPM for ALVR can be built for Fedora (and possibly other RPM-based distros), and is preferred where possible.
- Install dnf-utils, git, and RPMFusion
sudo dnf -y install dnf-utils git https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- Clone the git repository:
git clone https://github.com/alvr-org/ALVR.git
- Change to the repository directory:
cd ALVR
- Install build dependencies (This will take >1GB space)
sudo yum-builddep -y packaging/rpm/alvr.spec
- For a build of the current source, create the source directory and tar the repository:
mkdir -p "${HOME}/rpmbuild/SOURCES"
tar -cvz . > "${HOME}/rpmbuild/SOURCES/$(spectool packaging/rpm/alvr.spec | grep -oP 'v\d+\.\d+\..*\.tar\.gz')"
- Build the RPM:
rpmbuild -ba packaging/rpm/alvr.spec
If a build for a specific release is needed, spectool
may be used to fetch that release from the specfile instead of using tar
in the current working directory.
You need rustup and the following platform specific dependencies:
sudo pacman -S clang curl nasm pkgconf yasm vulkan-headers libva-mesa-driver
# Install ffmpeg-vulkan from the AUR
# Use either
paru -S ffmpeg-vulkan
yay -S ffmpeg-vulkan
However, for now, vulkan-headers must be downgraded to the earliest 1.2.x version. On arch, you can install "downgrade" from the AUR
media-video/ffmpeg >= 4.4 [encode vulkan vaapi]
sys-libs/libunwind
dev-lang/rust >= 1.51
Use the shell.nix
in packaging/nix
.
There's a youtube tutorial here
Dependencies:
sudo apt install build-essential pkg-config libclang-dev libssl-dev libasound2-dev libgtk-3-dev libvulkan-dev libunwind-dev gcc-8 g++-8 yasm nasm curl libx264-dev libx265-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libdrm-dev
cargo xtask build-server --release
Or, if the ffmpeg package provided by your distribution does not have vulkan support enabled (such as Ubuntu)
cargo xtask build-server --release --bundle-ffmpeg
Steam Native on some distro's runs this a little better. To get Steam Native on Ubuntu run it with:
env STEAM_RUNTIME=0 steam
On Arch Linux, you can also get all the required libraries by downloading the steam-native-runtime
package from the multilib repository
sudo pacman -S steam-native-runtime
Dependencies might be missing then, so run:
cd ~/.steam/root/ubuntu12_32
file * | grep ELF | cut -d: -f1 | LD_LIBRARY_PATH=. xargs ldd | grep 'not found' | sort | uniq
Some dependencies have to be fixed manually for example instead of forcing a downgrade to libffi version 6 (which could downgrade a bunch of the system) you can do a symlink instead (requires testing):
cd /lib/i386-linux-gnu
ln -s libffi.so.7 libffi.so.6
and
cd /lib/x86_64-linux-gnu
ln -s libffi.so.7 libffi.so.6