diff --git a/scripts/setup-dev.sh b/scripts/setup-dev.sh new file mode 100755 index 00000000..33d757b9 --- /dev/null +++ b/scripts/setup-dev.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# Installs everything needed to build and test this fork on a Debian or +# Ubuntu based system, including the multi-monitor test suite and the +# Windows cross compiler. +# +# Usage: scripts/setup-dev.sh [--minimal] +# +# --minimal only what is needed to build the client and Linux host, +# skipping the test and cross compilation tooling + +set -eu + +MINIMAL=0 +[ "${1:-}" = "--minimal" ] && MINIMAL=1 + +# build the client and the Linux host +CORE=( + cmake gcc g++ make pkg-config + libegl-dev libgl-dev libgles-dev + libfontconfig-dev libgmp-dev libspice-protocol-dev nettle-dev + binutils-dev + libx11-dev libxfixes-dev libxi-dev libxinerama-dev libxss-dev + libxcursor-dev libxpresent-dev + libxkbcommon-dev libwayland-bin libwayland-dev + libpipewire-0.3-dev libsamplerate0-dev libpulse-dev + fonts-dejavu-core +) + +# the Linux host's XCB capture backend, which is what enumerates monitors +CORE+=(libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libxcb-randr0-dev) + +# host/tests: Xvfb renders the client headlessly, ImageMagick samples it +TESTS=(xvfb imagemagick x11-xserver-utils gdb) + +# cross compile the Windows host from Linux, which type checks the DXGI +# and D12 backends without a Windows machine +CROSS=(mingw-w64 nsis) + +PKGS=("${CORE[@]}") +if [ $MINIMAL -eq 0 ]; then + PKGS+=("${TESTS[@]}" "${CROSS[@]}") +fi + +echo "installing ${#PKGS[@]} packages..." +sudo apt-get update -qq +sudo DEBIAN_FRONTEND=noninteractive apt-get install -y "${PKGS[@]}" + +cat <<'EOF' + +Done. To build: + + # client + mkdir -p client/build && cd client/build && cmake .. && make -j$(nproc) + + # Linux host (needed for the live test) + mkdir -p host/build && cd host/build && cmake .. && make -j$(nproc) + + # Windows host, cross compiled + mkdir -p host/build-win && cd host/build-win + cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw64.cmake .. && make -j$(nproc) + +To run the multi-monitor tests: + + host/tests/run-tests.sh + +EOF