build: add freebsd support (#4049)

This commit is contained in:
David Lane
2025-11-11 23:46:11 -05:00
committed by GitHub
parent 2dbe837ebc
commit 1d6d916b7a
31 changed files with 1055 additions and 39 deletions

View File

@ -26,6 +26,14 @@ and applications to Sunshine.
> process is killed.
@tabs{
@tab{FreeBSD | <!-- -->
\| Field \| Value \|
\|------------------------------\|------------------------------------------------------\|
\| Application Name \| @code{}Steam Big Picture@endcode \|
\| Command Preporations -> Undo \| @code{}setsid steam steam://close/bigpicture@endcode \|
\| Detached Commands \| @code{}setsid steam steam://open/bigpicture@endcode \|
\| Image \| @code{}steam.png@endcode \|
}
@tab{Linux | <!-- -->
\| Field \| Value \|
\|------------------------------\|------------------------------------------------------\|
@ -97,6 +105,12 @@ and applications to Sunshine.
#### URI
@tabs{
@tab{FreeBSD | <!-- -->
\| Field \| Value \|
\|-------------------\|------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \|
\| Detached Commands \| @code{}setsid steam steam://rungameid/464920@endcode \|
}
@tab{Linux | <!-- -->
\| Field \| Value \|
\|-------------------\|------------------------------------------------------\|
@ -119,6 +133,13 @@ and applications to Sunshine.
#### Binary (w/ working directory
@tabs{
@tab{FreeBSD | <!-- -->
\| Field \| Value \|
\|-------------------\|--------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \|
\| Command \| @code{}MarsSteam@endcode \|
\| Working Directory \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars@endcode \|
}
@tab{Linux | <!-- -->
\| Field \| Value \|
\|-------------------\|--------------------------------------------------------------\|
@ -144,6 +165,12 @@ and applications to Sunshine.
#### Binary (w/o working directory)
@tabs{
@tab{FreeBSD | <!-- -->
\| Field \| Value \|
\|-------------------\|------------------------------------------------------------------------\|
\| Application Name \| @code{}Surviving Mars@endcode \|
\| Command \| @code{}~/.steam/steam/SteamApps/common/Survivng Mars/MarsSteam@endcode \|
}
@tab{Linux | <!-- -->
\| Field \| Value \|
\|-------------------\|------------------------------------------------------------------------\|

View File

@ -14,6 +14,39 @@ It is recommended to use one of the following compilers:
### Dependencies
#### FreeBSD
> [!CAUTION]
> Sunshine support for FreeBSD is experimental and may be incomplete or not work as expected
##### Install dependencies
```sh
pkg install -y \
audio/opus \
audio/pulseaudio \
devel/cmake \
devel/evdev-proto \
devel/git \
devel/libayatana-appindicator \
devel/libevdev \
devel/libnotify \
devel/ninja \
devel/pkgconf \
ftp/curl \
graphics/libdrm \
graphics/wayland \
multimedia/libva \
net/miniupnpc \
ports-mgmt/pkg \
security/openssl \
shells/bash \
www/npm \
x11/libX11 \
x11/libxcb \
x11/libXfixes \
x11/libXrandr \
x11/libXtst
```
#### 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
@ -135,6 +168,11 @@ ninja -C build
### Package
@tabs{
@tab{FreeBSD | @tabs{
@tab{pkg | ```bash
cpack -G FREEBSD --config ./build/CPackConfig.cmake
```}
}}
@tab{Linux | @tabs{
@tab{deb | ```bash
cpack -G DEB --config ./build/CPackConfig.cmake

View File

@ -26,6 +26,7 @@ location by modifying the configuration file.
| OS | Location |
|---------|-------------------------------------------------|
| Docker | @code{}/config@endcode |
| FreeBSD | @code{}~/.config/sunshine@endcode |
| Linux | @code{}~/.config/sunshine@endcode |
| macOS | @code{}~/.config/sunshine@endcode |
| Windows | @code{}%ProgramFiles%\\Sunshine\\config@endcode |
@ -339,12 +340,12 @@ editing the `conf` file in a text editor. Use the examples as reference.
<tr>
<td>ds5</td>
<td>DualShock 5 controller (PS5)
@note{This option applies to Linux only.}</td>
@note{This option applies to FreeBSD and Linux only.}</td>
</tr>
<tr>
<td>switch</td>
<td>Switch Pro controller
@note{This option applies to Linux only.}</td>
@note{This option applies to FreeBSD and Linux only.}</td>
</tr>
<tr>
<td>x360</td>
@ -354,7 +355,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
<tr>
<td>xone</td>
<td>Xbox One controller
@note{This option applies to Linux only.}</td>
@note{This option applies to FreeBSD and Linux only.}</td>
</tr>
</table>
@ -735,14 +736,14 @@ editing the `conf` file in a text editor. Use the examples as reference.
@tip{To find the name of the audio sink follow these instructions.
<br>
<br>
**Linux + pulseaudio:**
**FreeBSD/Linux + pulseaudio:**
<br>
@code{}
pacmd list-sinks | grep "name:"
@endcode
<br>
<br>
**Linux + pipewire:**
**FreeBSD/Linux + pipewire:**
<br>
@code{}
pactl info | grep Source
@ -776,7 +777,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
<td colspan="2">Sunshine will select the default audio device.</td>
</tr>
<tr>
<td>Example (Linux)</td>
<td>Example (FreeBSD/Linux)</td>
<td colspan="2">@code{}
audio_sink = alsa_output.pci-0000_09_00.3.analog-stereo
@endcode</td>
@ -883,7 +884,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
@tip{To find the appropriate values follow these instructions.
<br>
<br>
**Linux + VA-API:**
**FreeBSD/Linux + VA-API:**
<br>
Unlike with *amdvce* and *nvenc*, it doesn't matter if video encoding is done on a different GPU.
@code{}
@ -913,7 +914,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
<td colspan="2">Sunshine will select the default video card.</td>
</tr>
<tr>
<td>Example (Linux)</td>
<td>Example (FreeBSD/Linux)</td>
<td colspan="2">@code{}
adapter_name = /dev/dri/renderD128
@endcode</td>
@ -936,7 +937,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
@tip{To find the appropriate values follow these instructions.
<br>
<br>
**Linux:**
**FreeBSD/Linux:**
<br>
During Sunshine startup, you should see the list of detected displays:
@code{}
@ -1021,7 +1022,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
<td colspan="2">Sunshine will select the default display.</td>
</tr>
<tr>
<td>Example (Linux)</td>
<td>Example (FreeBSD/Linux)</td>
<td colspan="2">@code{}
output_name = 0
@endcode</td>
@ -2034,7 +2035,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
<tr>
<td>x11</td>
<td>Uses XCB. This is the slowest and most CPU intensive so should be avoided if possible.
@note{Applies to Linux only.}</td>
@note{Applies to FreeBSD and Linux only.}</td>
</tr>
<tr>
<td>ddx</td>
@ -2083,7 +2084,7 @@ editing the `conf` file in a text editor. Use the examples as reference.
</tr>
<tr>
<td>vaapi</td>
<td>Use Linux VA-API (AMD, Intel)</td>
<td>Use VA-API (AMD, Intel)</td>
</tr>
<tr>
<td>software</td>

View File

@ -8,7 +8,7 @@ and release artifacts may be missing when merging changes on a faster cadence.
## Binaries
Binaries of Sunshine are created for each release. They are available for Linux, macOS, and Windows.
Binaries of Sunshine are created for each release. They are available for FreeBSD, Linux, macOS, and Windows.
Binaries can be found in the [latest release][latest-release].
> [!NOTE]
@ -28,7 +28,28 @@ and [ghcr.io](https://github.com/orgs/LizardByte/packages?repo_name=sunshine).
See [Docker](../DOCKER_README.md) for more information.
### FreeBSD
#### Install
1. Download the appropriate package for your architecture
| Architecture | Package |
|---------------|----------------------------------------------------------------------------------------------------------------------------------------|
| amd64/x86_64 | [Sunshine-FreeBSD-14.3-amd64.pkg](https://github.com/LizardByte/Sunshine/releases/latest/download/Sunshine-FreeBSD-14.3-amd64.pkg) |
| arm64/aarch64 | [Sunshine-FreeBSD-14.3-aarch64.pkg](https://github.com/LizardByte/Sunshine/releases/latest/download/Sunshine-FreeBSD-14.3-aarch64.pkg) |
2. Open terminal and run the following command.
```sh
sudo pkg install ./Sunshine-FreeBSD-14.3-{arch}.pkg
```
#### Uninstall
```sh
sudo pkg delete Sunshine
```
### Linux
**CUDA Compatibility**
CUDA is used for NVFBC capture.
@ -380,6 +401,22 @@ overflow menu. Different versions of Windows may provide slightly different step
## Initial Setup
After installation, some initial setup is required.
### FreeBSD
#### Virtual Input Devices
> [!IMPORTANT]
> To use virtual input devices (keyboard, mouse, gamepads), you must add your user to the `input` group.
The installation process creates the `input` group and configures permissions for `/dev/uinput`.
To allow your user to create virtual input devices, run:
```bash
pw groupmod input -m $USER
```
After adding yourself to the group, log out and log back in for the changes to take effect.
### Linux
#### KMS Capture
@ -542,7 +579,16 @@ All shortcuts start with `Ctrl+Alt+Shift`, just like Moonlight.
instead it simply starts a stream. If you removed it and would like to get it back, just add a new application with
the name "Desktop" and "desktop.png" as the image path.
* For the Linux flatpak you must prepend commands with `flatpak-spawn --host`.
* If inputs (mouse, keyboard, gamepads...) aren't working after connecting, add the user running sunshine to the `input` group.
* If inputs (mouse, keyboard, gamepads...) aren't working after connecting:
* On FreeBSD/Linux, add the user running sunshine to the `input` group.
* The FreeBSD version of Sunshine is missing some features that are present on Linux.
The following are known limitations.
* Only X11 and Wayland capture are supported
* DualSense/DS5 emulation is not available due to missing uhid features
### HDR Support
Streaming HDR content is officially supported on Windows hosts and experimentally supported for Linux hosts.