mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-12-29 12:16:08 +00:00
024bd8f8b6
Some checks failed
CI / GitHub Env Debug (push) Has been cancelled
CI / Setup Release (push) Has been cancelled
CI / Setup Flatpak Matrix (push) Has been cancelled
CI Docker / Check Dockerfiles (push) Has been cancelled
CodeQL / Get language matrix (push) Has been cancelled
localize / Update Localization (push) Has been cancelled
Build GH-Pages / update_pages (push) Has been cancelled
CI / Linux Flatpak (push) Has been cancelled
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Has been cancelled
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (13, true) (push) Has been cancelled
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Has been cancelled
CI / Windows (push) Has been cancelled
CI Docker / Setup Release (push) Has been cancelled
CI Docker / Docker${{ matrix.tag }} (push) Has been cancelled
CodeQL / Analyze (${{ matrix.name }}) (push) Has been cancelled
170 lines
4.4 KiB
Markdown
170 lines
4.4 KiB
Markdown
# Building
|
|
Sunshine binaries are built using [CMake](https://cmake.org) and requires `cmake` > 3.25.
|
|
|
|
## Building Locally
|
|
|
|
### Dependencies
|
|
|
|
#### Linux
|
|
Dependencies vary depending on the distribution. You can reference our
|
|
[linux_build.sh](https://github.com/LizardByte/Sunshine/blob/master/scripts/linux_build.sh) script for a list of
|
|
dependencies we use in Debian-based and Fedora-based distributions. Please submit a PR if you would like to extend the
|
|
script to support other distributions.
|
|
|
|
##### CUDA Toolkit
|
|
Sunshine requires CUDA Toolkit for NVFBC capture. There are two caveats to CUDA:
|
|
|
|
1. The version installed depends on the version of GCC.
|
|
2. The version of CUDA you use will determine compatibility with various GPU generations.
|
|
At the time of writing, the recommended version to use is CUDA ~11.8.
|
|
See [CUDA compatibility](https://docs.nvidia.com/deploy/cuda-compatibility/index.html) for more info.
|
|
|
|
@tip{To install older versions, select the appropriate run file based on your desired CUDA version and architecture
|
|
according to [CUDA Toolkit Archive](https://developer.nvidia.com/cuda-toolkit-archive)}
|
|
|
|
#### macOS
|
|
You can either use [Homebrew](https://brew.sh) or [MacPorts](https://www.macports.org) to install dependencies.
|
|
|
|
##### Homebrew
|
|
```bash
|
|
dependencies=(
|
|
"boost" # Optional
|
|
"cmake"
|
|
"doxygen" # Optional, for docs
|
|
"graphviz" # Optional, for docs
|
|
"icu4c" # Optional, if boost is not installed
|
|
"miniupnpc"
|
|
"ninja"
|
|
"node"
|
|
"openssl@3"
|
|
"opus"
|
|
"pkg-config"
|
|
)
|
|
brew install "${dependencies[@]}"
|
|
```
|
|
|
|
If there are issues with an SSL header that is not found:
|
|
|
|
@tabs{
|
|
@tab{ Intel | ```bash
|
|
ln -s /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
|
|
```}
|
|
@tab{ Apple Silicon | ```bash
|
|
ln -s /opt/homebrew/opt/openssl/include/openssl /opt/homebrew/include/openssl
|
|
```
|
|
}
|
|
}
|
|
|
|
##### MacPorts
|
|
```bash
|
|
dependencies=(
|
|
"cmake"
|
|
"curl"
|
|
"doxygen" # Optional, for docs
|
|
"graphviz" # Optional, for docs
|
|
"libopus"
|
|
"miniupnpc"
|
|
"ninja"
|
|
"npm9"
|
|
"pkgconfig"
|
|
)
|
|
sudo port install "${dependencies[@]}"
|
|
```
|
|
|
|
#### Windows
|
|
First you need to install [MSYS2](https://www.msys2.org), then startup "MSYS2 UCRT64" and execute the following
|
|
commands.
|
|
|
|
##### Update all packages
|
|
```bash
|
|
pacman -Syu
|
|
```
|
|
|
|
##### Install dependencies
|
|
```bash
|
|
dependencies=(
|
|
"doxygen" # Optional, for docs
|
|
"git"
|
|
"mingw-w64-ucrt-x86_64-boost" # Optional
|
|
"mingw-w64-ucrt-x86_64-cmake"
|
|
"mingw-w64-ucrt-x86_64-cppwinrt"
|
|
"mingw-w64-ucrt-x86_64-curl-winssl"
|
|
"mingw-w64-ucrt-x86_64-graphviz" # Optional, for docs
|
|
"mingw-w64-ucrt-x86_64-miniupnpc"
|
|
"mingw-w64-ucrt-x86_64-nlohmann-json"
|
|
"mingw-w64-ucrt-x86_64-nodejs"
|
|
"mingw-w64-ucrt-x86_64-nsis"
|
|
"mingw-w64-ucrt-x86_64-onevpl"
|
|
"mingw-w64-ucrt-x86_64-openssl"
|
|
"mingw-w64-ucrt-x86_64-opus"
|
|
"mingw-w64-ucrt-x86_64-toolchain"
|
|
)
|
|
pacman -S "${dependencies[@]}"
|
|
```
|
|
|
|
### Clone
|
|
Ensure [git](https://git-scm.com) is installed on your system, then clone the repository using the following command:
|
|
|
|
```bash
|
|
git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules
|
|
cd sunshine
|
|
mkdir build
|
|
```
|
|
|
|
### Build
|
|
|
|
```bash
|
|
cmake -B build -G Ninja -S .
|
|
ninja -C build
|
|
```
|
|
|
|
@tip{Available build options can be found in
|
|
[options.cmake](https://github.com/LizardByte/Sunshine/blob/master/cmake/prep/options.cmake).}
|
|
|
|
### Package
|
|
|
|
@tabs{
|
|
@tab{Linux | @tabs{
|
|
@tab{deb | ```bash
|
|
cpack -G DEB --config ./build/CPackConfig.cmake
|
|
```}
|
|
@tab{rpm | ```bash
|
|
cpack -G RPM --config ./build/CPackConfig.cmake
|
|
```}
|
|
}}
|
|
@tab{macOS | @tabs{
|
|
@tab{DragNDrop | ```bash
|
|
cpack -G DragNDrop --config ./build/CPackConfig.cmake
|
|
```}
|
|
}}
|
|
@tab{Windows | @tabs{
|
|
@tab{Installer | ```bash
|
|
cpack -G NSIS --config ./build/CPackConfig.cmake
|
|
```}
|
|
@tab{Portable | ```bash
|
|
cpack -G ZIP --config ./build/CPackConfig.cmake
|
|
```}
|
|
}}
|
|
}
|
|
|
|
### Remote Build
|
|
It may be beneficial to build remotely in some cases. This will enable easier building on different operating systems.
|
|
|
|
1. Fork the project
|
|
2. Activate workflows
|
|
3. Trigger the *CI* workflow manually
|
|
4. Download the artifacts/binaries from the workflow run summary
|
|
|
|
<div class="section_buttons">
|
|
|
|
| Previous | Next |
|
|
|:--------------------------------------|--------------------------------:|
|
|
| [Troubleshooting](troubleshooting.md) | [Contributing](contributing.md) |
|
|
|
|
</div>
|
|
|
|
<details style="display: none;">
|
|
<summary></summary>
|
|
[TOC]
|
|
</details>
|