Build toolbox
Some checks are pending
Build / setup (push) Waiting to run
Build / build-appimage (push) Blocked by required conditions
Build / build-steamlink (push) Blocked by required conditions
Build / build-windows-macos (push) Blocked by required conditions

This commit is contained in:
Joey Yakimowich-Payne 2026-02-11 11:40:41 -07:00
commit 97c7b8bf14

View file

@ -0,0 +1,79 @@
#!/usr/bin/env bash
set -euo pipefail
JOBS="${JOBS:-$(nproc)}"
SKIP_BUILD=0
for arg in "$@"; do
case "$arg" in
--skip-build)
SKIP_BUILD=1
;;
--jobs=*)
JOBS="${arg#*=}"
;;
*)
echo "Unknown argument: $arg"
echo "Usage: $0 [--skip-build] [--jobs=N]"
exit 1
;;
esac
done
if [[ ! -f /run/.containerenv ]]; then
echo "Run this script inside your toolbox container."
exit 1
fi
if ! command -v dnf >/dev/null 2>&1; then
echo "This script expects a Fedora/RHEL-like toolbox with dnf."
exit 1
fi
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$REPO_ROOT"
FEDORA_VER="$(rpm -E %fedora)"
if ! rpm -q rpmfusion-free-release >/dev/null 2>&1; then
sudo dnf -y install "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VER}.noarch.rpm"
fi
if ! rpm -q rpmfusion-nonfree-release >/dev/null 2>&1; then
sudo dnf -y install "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VER}.noarch.rpm"
fi
sudo dnf -y install \
ffmpeg ffmpeg-devel \
git make gcc gcc-c++ pkgconf-pkg-config \
qt6-qtbase-devel qt6-qtdeclarative-devel qt6-qtquickcontrols2-devel qt6-qtsvg-devel qt6-qtwayland-devel \
SDL2-devel SDL2_ttf-devel \
opus-devel openssl-devel \
libva-utils libva-devel libdrm-devel mesa-libEGL-devel mesa-libGL-devel \
libX11-devel libXext-devel libXrandr-devel libXfixes-devel libXi-devel libXcursor-devel
if rpm -q libva-intel-media-driver >/dev/null 2>&1; then
sudo dnf -y swap libva-intel-media-driver intel-media-driver --allowerasing
elif ! rpm -q intel-media-driver >/dev/null 2>&1; then
sudo dnf -y install intel-media-driver
fi
git submodule update --init --recursive
if command -v vainfo >/dev/null 2>&1; then
if ! vainfo 2>/dev/null | grep -q 'VAProfileHEVCMain'; then
echo "Warning: HEVC decode profile not detected in VAAPI."
fi
if ! vainfo 2>/dev/null | grep -q 'VAProfileH264High'; then
echo "Warning: H264 decode profile not detected in VAAPI."
fi
fi
rm -rf Makefile */Makefile */Makefile.* app/release app/debug
qmake6 moonlight-qt.pro
if [[ "$SKIP_BUILD" -eq 0 ]]; then
make release -j"$JOBS"
fi
echo "Done."