Dev environment setup

This has been tested on Debian 12, you should adjust the setup based on your distro of choice.

Install Nvidia driver + cuda

(Only needed on Nvidia hosts)

Please refer to NvidiaGraphicsDrivers for how to install the proprietary Nvidia drivers on your system.

You also have to install Cuda, you can follow the official instructions.

Wolf dependencies

Build Gstreamer

We prefer to build Gstreamer from scratch and place it in a separate folder so that it doesn’t interfere with your system-installed version (if any). This will make sure that you end up with all the required plugins.

Build dependencies
apt install -y build-essential ninja-build gcc meson cmake ccache bison equivs \
	ca-certificates git libllvm15 \
	flex libx265-dev libopus-dev nasm libzxing-dev libzbar-dev libdrm-dev libva-dev \
	libmfx-dev libvpl-dev libmfx-tools libunwind8 libcap2-bin \
	libx11-dev libxfixes-dev libxdamage-dev libwayland-dev libpulse-dev libglib2.0-dev \
	libopenjp2-7-dev liblcms2-dev libcairo2-dev libcairo-gobject2 libwebp7 librsvg2-dev libaom-dev \
	libharfbuzz-dev libpango1.0-dev
Build gstreamer
git clone -b 1.22.7 --depth=1 https://gitlab.freedesktop.org/gstreamer/gstreamer.git
cd gstreamer
# Setup a place where we'll put the libraries
mkdir -p $HOME/gstreamer/include -p $HOME/gstreamer/usr/local/include
meson setup --prefix=$HOME/gstreamer \
	--buildtype=release \
	--strip \
	-Dgst-full-libraries=app,video \
	-Dorc=disabled \
	-Dgpl=enabled  \
	-Dbase=enabled \
	-Dgood=enabled  \
	-Dugly=enabled \
	-Drs=disabled \
	-Dtls=disabled \
	-Dgst-examples=disabled \
	-Dlibav=disabled \
	-Dtests=disabled \
	-Dexamples=disabled \
	-Ddoc=disabled \
	-Dpython=disabled \
	-Drtsp_server=disabled \
	-Dqt5=disabled \
	-Dbad=enabled \
	-Dgst-plugins-good:soup=disabled \
	-Dgst-plugins-good:ximagesrc=enabled \
	-Dgst-plugins-good:pulse=enabled \
	-Dgst-plugins-bad:x265=enabled  \
	-Dgst-plugins-bad:qsv=enabled \
	-Dgst-plugins-bad:aom=enabled \
	-Dgst-plugin-bad:nvcodec=enabled  \
	-Dvaapi=enabled \
	-Dgstreamer-vaapi:x11=disabled \
	build
meson compile -C build
meson install -C build

This will install libraries and include files under ~/gstreamer, in order for Wolf to pick this up during builing we have to setup the following env variables (you can add them at the end of ~/.bash_rc for example)

Custom env
export PATH="$HOME/gstreamer/usr/local/bin:$PATH"
export LIBRARY_PATH="$LIBRARY_PATH:$HOME/gstreamer/usr/local/lib/x86_64-linux-gnu/"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/gstreamer/lib/x86_64-linux-gnu/"
export LDFLAGS="$LDFLAGS -L$HOME/gstreamer/usr/local/lib/x86_64-linux-gnu/"
export CFLAGS="$CFLAGS -I$HOME/gstreamer/usr/local/include"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/gstreamer/usr/local/lib/x86_64-linux-gnu/pkgconfig/"

You can now check that the nvcodec plugin correctly works (only on Nvidia hosts)

GST_DEBUG=4 gst-inspect-1.0 nvcodec

Adding GST_DEBUG helps debugging possible issues with this.

Build gst-wayland-display

Install Rust following the official docs.

git clone https://github.com/games-on-whales/gst-wayland-display
cd gst-wayland-display
cargo install cargo-c
mkdir $HOME/gst-wayland-display
cargo cinstall --prefix=$HOME/gst-wayland-display

Like we have done for Gstreamer we are going to install this in a different directory: $HOME/gst-wayland-display in order to keep things clean.

Custom env
export LIBRARY_PATH="$LIBRARY_PATH:$HOME/gst-wayland-display/lib/"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/gst-wayland-display/lib/"
export LDFLAGS="$LDFLAGS -L$HOME/gst-wayland-display/lib"
export CFLAGS="$CFLAGS -I$HOME/gst-wayland-display/include"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/gst-wayland-display/lib/pkgconfig/"

Install Wolf deps

Build dependencies
apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    ninja-build \
    cmake \
    pkg-config \
    ccache \
    git \
    clang \
    libboost-thread-dev libboost-locale-dev libboost-filesystem-dev libboost-log-dev libboost-stacktrace-dev libboost-container-dev \
    libwayland-dev libwayland-server0 libinput-dev libxkbcommon-dev libgbm-dev \
    libcurl4-openssl-dev \
    libssl-dev \
    libevdev-dev \
    libpulse-dev \
    libunwind-dev \
    libudev-dev \
    libdrm-dev \
    libpci-dev \

Compile Wolf

Compile
cmake -Bbuild -DCMAKE_C_FLAGS=$CFLAGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -G Ninja
ninja -C build

If compilation completes correctly, you can finally start Wolf

Run!
build/src/wolf/wolf
INFO  | Reading config file from: config.toml
WARN  | Unable to open config file: config.toml, creating one using defaults
INFO  | x509 certificates not present, generating...
INFO  | HTTP server listening on port: 47989
INFO  | HTTPS server listening on port: 47984