Build Instructions
Compiling manually
Section titled “Compiling manually”Prerequisites
Section titled “Prerequisites”- A recent-ish operating system release
- Windows 10 (1809 or later. Older versions may be supported, but aren’t tested)
- macOS >= 12
- Ubuntu >= 22.04 (or equivalent)
- A C++ compiler supporting at least C++17.
- This includes GCC >= 8, Clang >= 5, and MSVC >= 19.15
- Java JDK <= 17
- cmake >= 3.22
- ninja
- extra-cmake-modules
- Qt 6.0 or later, with the following addons/plugins:
- Qt NetworkAuth
- Qt Image Formats
- Qt Svg
- cmark
- gamemode (required at build time, optional at runtime. Only on Linux)
glxinfo(required at runtime, only on Linux)- libarchive
- libGL headers (only on Linux)
- libqrencode
- pciutils (required at runtime, only on Linux)
- scdoc (optional at build time, used to generate manpages)
- tomlplusplus
- vulkan-headers
- zlib
You should first install winget, a package manager for Windows.
Once winget is available, install the MSVC toolchain with:
winget install --source winget --exact --id Microsoft.VisualStudio.2022.BuildTools --override '--add Microsoft.VisualStudio.Workload.VCTools;includeRecommended'Install JDK 17 with:
winget install --source winget --exact --id EclipseAdoptium.Temurin.17.JDKWe will also be using Git:
winget install --source winget --exact --id Git.GitQt can then be installed with aqt:
winget install --source winget --exact --id miurahr.aqtinstallaqt install-qt windows desktop 6 win64_msvc2022_64 -m qtimageformats qtnetworkauthMSYS2 may be installed with winget, or by following the setup guide here:
winget install --exact --id MSYS2.MSYS2 --source wingetInstall JDK 17 with:
winget install --source winget --exact --id EclipseAdoptium.Temurin.17.JDKWe require the CLANG(ARM)64 environment. After starting the environment, you may run the following to install all dependencies:
pacman -Syu pactoys gitpacboy -S \ toolchain:p \ cmake:p ninja:p \ extra-cmake-modules:p \ qt6-base:p qt6-imageformats:p qt6-networkauth:p qt6-svg:p \ cmark:p \ libarchive:p \ qrencode:p \ tomlplusplus:p \ vulkan-headers:p \ zlib:pThe XCode toolchain can be installed with:
xcode-select --installQt and other dependencies can then be installed with the following Homebrew command:
brew install cmake ninja extra-cmake-modules openjdk@17 vcpkg qtgit clone https://github.com/Microsoft/vcpkg ~/vcpkgexport VCPKG_ROOT="$HOME/vcpkg"sudo apt install \ build-essential \ cmake ninja-build extra-cmake-modules pkg-config scdoc \ qt6-base-dev qt6-image-formats-plugins qt6-networkauth-dev qt6-svg-dev \ cmark gamemode-dev libarchive-dev libcmark-dev libgl1-mesa-dev libqrencode-dev libtomlplusplus-dev libvulkan-dev zlib1g-dev \To install JDK 17 on Debian:
sudo apt install wget apt-transport-https gpgwget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/nullecho "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.listsudo apt update && sudo apt install temurin-17-jdkWhile on Ubuntu (or derivatives) you can just:
sudo apt install openjdk-17-jdksudo pacman -S \ base-devel \ cmake ninja extra-cmake-modules pkg-config scdoc \ qt6-base qt6-imageformats qt6-networkauth qt6-svg \ cmark gamemode libarchive mesa qrencode tomlplusplus vulkan-headers zlib \ jdk17-openjdkGetting the source
Section titled “Getting the source”We use Git for our version control. The command below will clone the repository, and fetch all submodules that come with it
git clone --recursive https://github.com/PrismLauncher/PrismLauncher.gitcd PrismLauncherThe rest of the documentation assumes you have already cloned the repository.
Building the source
Section titled “Building the source”Configuration
Section titled “Configuration”Open “x64 Native Tools PowerShell” in Windows Terminal
cmake --preset windows_msvc -D CMAKE_PREFIX_PATH="C:\path\to\Qt"cmake --preset windows_mingwcmake --preset macos \ -D CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt" -D CMAKE_OSX_DEPLOYMENT_TARGET=12 \cmake --preset linuxCompilation
Section titled “Compilation”cmake --build --preset windows_msvc --config Debugcmake --build --preset windows_mingw --config Debugcmake --build --preset macos --config Debugcmake --build --preset linux --config DebugInstallation
Section titled “Installation”cmake --install build --config Debugcmake --install build --config Debug --component portable # If you want to install a portable versioncmake --install build --config Debugcmake --install build --config Debug --component portable # If you want to install a portable versioncmake --install build --config Debugcmake --install build --config Debugcmake --install build --config Debug --component portable # If you want to install a portable versionDESTDIR="$pkgdir" cmake --install build --config Debug # If you're installing for a packageBuilding with Nix (Linux and macOS)
Section titled “Building with Nix (Linux and macOS)”Nix is a tool for handling reproducible builds across multiple platforms.
After installing Nix and checking out the repository, you can run the following command to build a debug package:
nix build --print-build-logs '.#prismlauncher-debug'You can also enter a development shell with all of the tools required to build manually:
nix-shellcmake --preset linux_debugcmake --build buildcmake --install buildBuilding a Flatpak (Linux)
Section titled “Building a Flatpak (Linux)”Flatpaks allow for you to quickly build Prism and run it on any distribution
Make sure Flathub is setup.
# Install Flatpak build toolsflatpak install flathub org.flatpak.Builder
# Clone the source repositorygit clone --recursive https://github.com/prismlauncher/PrismLauncher
# Enter the Flatpak directorycd PrismLauncher/flatpak
# Run the buildflatpak run org.flatpak.Builder \ --user \ --install \ # Comment if you only want to build, not install --install-deps-from=flathub \ --ccache \ --repo=repo \ builddir \ org.prismlauncher.PrismLauncher.yml