Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
29be89d
New prebuilts for every os
brad-richardson Nov 22, 2022
5d94bd1
Sunshine binaries, organize, comments
brad-richardson Nov 22, 2022
54a79e5
Remove ffmpeg from build dependencies and docs
brad-richardson Nov 22, 2022
a8b175c
Update naming, urls, add windows-specific libraries
brad-richardson Nov 22, 2022
61cbed3
Add submodules
brad-richardson Nov 23, 2022
d5af311
Fix commit pins, https urls
brad-richardson Nov 23, 2022
ec8274e
Cmake fixes
brad-richardson Nov 23, 2022
65608f2
Additional linux libraries
brad-richardson Nov 23, 2022
9742cd7
Pin correct libvdpau version
brad-richardson Nov 23, 2022
680307c
Fix thread link, add mvec library
brad-richardson Nov 23, 2022
01922bf
Bump CI os to attempt thread fix, add math library
brad-richardson Nov 23, 2022
916325c
Install libfuse2
brad-richardson Nov 23, 2022
ce4dc57
Revert target distro bump, attempt gcc 11
brad-richardson Nov 23, 2022
3d53f1b
Fix attempts
brad-richardson Nov 24, 2022
e864ff9
Link video toolbox on macos
brad-richardson Nov 24, 2022
7c0cff9
Add libiconv
brad-richardson Nov 24, 2022
918daab
Cleanup old attempts, find iconv for macos
brad-richardson Nov 24, 2022
a1ab9e4
Macports pkgconfig
brad-richardson Nov 24, 2022
05ce925
Thread find flags, iconv additional params
brad-richardson Nov 24, 2022
c3243db
Find libiconv paths
brad-richardson Nov 24, 2022
0a26927
Move path checks, install brew libiconv
brad-richardson Nov 24, 2022
6cdfda3
Remove yml whitespace
brad-richardson Nov 24, 2022
789be9f
Remove libiconv port (incompatible to link)
brad-richardson Nov 24, 2022
1f58d02
PR fixes, libiconv fix attempt
brad-richardson Nov 24, 2022
e7b6e40
Use brew libiconv
brad-richardson Nov 24, 2022
278f16d
Fixes, check homebrew dir
brad-richardson Nov 24, 2022
aaf4e51
Whoops
brad-richardson Nov 24, 2022
abf2a52
Iconv through framework
brad-richardson Nov 24, 2022
416ab23
Revert unnecessary changes
brad-richardson Nov 26, 2022
872f89d
Remove libavdevice from rpm requires
brad-richardson Nov 26, 2022
8005ee5
Support linux-aarch64
brad-richardson Dec 2, 2022
ec8659a
Bump to latest builds
brad-richardson Dec 2, 2022
b771dc8
Add libnuma-dev
brad-richardson Dec 2, 2022
0bd0fde
Include numa as platform library
brad-richardson Dec 2, 2022
212b061
Bump ffmpeg builds, add libnuma to flatpak
brad-richardson Dec 3, 2022
68243a1
Use correct numa library for aur
brad-richardson Dec 3, 2022
c9c8c45
Flatpak numactl
brad-richardson Dec 4, 2022
dccc48d
Use libfuse2-dev, doc updates
brad-richardson Dec 11, 2022
b3863bd
Correct libfuse
brad-richardson Dec 11, 2022
baa6370
Remove libfuse
brad-richardson Dec 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y \
cmake \
qemu-user-static \
flatpak
flatpak \
qemu-user-static
sudo su $(whoami) -c "flatpak --user remote-add --if-not-exists flathub \
https://flathub.org/repo/flathub.flatpakrepo"
sudo su $(whoami) -c "flatpak --user install -y flathub \
Expand Down Expand Up @@ -372,8 +372,6 @@ jobs:

- name: Setup Dependencies Linux
run: |
sudo add-apt-repository ppa:savoury1/ffmpeg4 -y
# sudo add-apt-repository ppa:savoury1/boost-defaults-1.71 -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y

sudo apt-get update -y
Expand All @@ -390,9 +388,12 @@ jobs:
libcurl4-openssl-dev \
libdrm-dev \
libevdev-dev \
libpulse-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \
libx11-dev \
libxcb-shm0-dev \
Expand Down Expand Up @@ -557,7 +558,7 @@ jobs:
- name: Setup Dependencies MacOS
run: |
# install dependencies using homebrew
brew install boost cmake curl ffmpeg node opus
brew install boost cmake curl node opus

# fix openssl header not found
ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
Expand Down
16 changes: 16 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@
[submodule "third-party/TPCircularBuffer"]
path = third-party/TPCircularBuffer
url = https://github.com/michaeltyson/TPCircularBuffer
[submodule "ffmpeg-windows-x86_64"]
path = third-party/ffmpeg-windows-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-windows-x86_64
[submodule "ffmpeg-macos-x86_64"]
path = third-party/ffmpeg-macos-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-macos-x86_64
[submodule "ffmpeg-linux-x86_64"]
path = third-party/ffmpeg-linux-x86_64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-linux-x86_64
[submodule "ffmpeg-linux-aarch64"]
path = third-party/ffmpeg-linux-aarch64
url = https://github.com/LizardByte/build-deps
branch = ffmpeg-linux-aarch64
1 change: 0 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ build:
## apt packages required packages to run cmake on sunshine, note that additional packages are required
# apt_packages:
# - cmake
# - ffmpeg
# - libboost-filesystem-dev
# - libboost-log-dev
# - libboost-thread-dev
Expand Down
67 changes: 34 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,12 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-missing-braces -Wno-maybe-uninit
if(WIN32)
enable_language(RC)
set(CMAKE_RC_COMPILER windres)
file(
DOWNLOAD "https://github.com/TheElixZammuto/sunshine-prebuilt/releases/download/1.0.0/pre-compiled.zip" "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
TIMEOUT 60
EXPECTED_HASH SHA256=5d59986bd7f619eaaf82b2dd56b5127b747c9cbe8db61e3b898ff6b485298ed6)

file(ARCHIVE_EXTRACT
INPUT "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip"
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pre-compiled)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CURL_STATIC_LDFLAGS} ${CURL_STATIC_CFLAGS}")

# Restrict Boost WinAPI version to work around 1.80 linker errors
ADD_DEFINITIONS(-DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7)

if(NOT DEFINED SUNSHINE_PREPARED_BINARIES)
set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled/windows")
endif()

add_compile_definitions(SUNSHINE_PLATFORM="windows")
add_subdirectory(tools) # This is temporary, only tools for Windows are needed, for now

Expand Down Expand Up @@ -123,22 +111,6 @@ if(WIN32)
libssl.a
libcrypto.a)

set(FFMPEG_INCLUDE_DIRS
${SUNSHINE_PREPARED_BINARIES}/include)
set(FFMPEG_LIBRARIES
${SUNSHINE_PREPARED_BINARIES}/lib/libavcodec.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavdevice.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavfilter.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavformat.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavutil.a
${SUNSHINE_PREPARED_BINARIES}/lib/libpostproc.a
${SUNSHINE_PREPARED_BINARIES}/lib/libswresample.a
${SUNSHINE_PREPARED_BINARIES}/lib/libswscale.a
${SUNSHINE_PREPARED_BINARIES}/lib/libx264.a
${SUNSHINE_PREPARED_BINARIES}/lib/libx265.a
${SUNSHINE_PREPARED_BINARIES}/lib/libhdr10plus.a
z lzma bcrypt libiconv.a)

list(PREPEND PLATFORM_LIBRARIES
libstdc++.a
libwinpthread.a
Expand All @@ -163,17 +135,18 @@ elseif(APPLE)
link_directories(/usr/local/lib)
ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)

find_package(FFmpeg REQUIRED)
FIND_LIBRARY(APP_SERVICES_LIBRARY ApplicationServices )
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation )
FIND_LIBRARY(CORE_MEDIA_LIBRARY CoreMedia )
FIND_LIBRARY(CORE_VIDEO_LIBRARY CoreVideo )
FIND_LIBRARY(VIDEO_TOOLBOX_LIBRARY VideoToolbox )
FIND_LIBRARY(FOUNDATION_LIBRARY Foundation )
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${APP_SERVICES_LIBRARY}
${AV_FOUNDATION_LIBRARY}
${CORE_MEDIA_LIBRARY}
${CORE_VIDEO_LIBRARY}
${VIDEO_TOOLBOX_LIBRARY}
${FOUNDATION_LIBRARY})

set(PLATFORM_INCLUDE_DIRS
Expand Down Expand Up @@ -239,8 +212,6 @@ else()
set(WAYLAND_FOUND OFF)
endif()

find_package(FFMPEG REQUIRED)

if(X11_FOUND)
add_compile_definitions(SUNSHINE_BUILD_X11)
include_directories(${X11_INCLUDE_DIR})
Expand Down Expand Up @@ -333,6 +304,7 @@ else()
list(APPEND PLATFORM_LIBRARIES
dl
evdev
numa
pulse
pulse-simple
)
Expand Down Expand Up @@ -400,6 +372,35 @@ set(SUNSHINE_TARGET_FILES

set_source_files_properties(src/upnp.cpp PROPERTIES COMPILE_FLAGS -Wno-pedantic)

# Pre-compiled binaries
if(WIN32)
set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-windows-x86_64")
set(FFMPEG_PLATFORM_LIBRARIES mfplat ole32 strmiids mfuuid)
elseif(APPLE)
set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-macos-x86_64")
else()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-aarch64")
else()
set(FFMPEG_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/third-party/ffmpeg-linux-x86_64")
endif()
set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11)
endif()
set(FFMPEG_INCLUDE_DIRS
${FFMPEG_PREPARED_BINARIES}/include)
if(EXISTS ${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
set(HDR10_PLUS_LIBRARY
${FFMPEG_PREPARED_BINARIES}/lib/libhdr10plus.a)
endif()
set(FFMPEG_LIBRARIES
${FFMPEG_PREPARED_BINARIES}/lib/libavcodec.a
${FFMPEG_PREPARED_BINARIES}/lib/libavutil.a
${FFMPEG_PREPARED_BINARIES}/lib/libswscale.a
${FFMPEG_PREPARED_BINARIES}/lib/libx264.a
${FFMPEG_PREPARED_BINARIES}/lib/libx265.a
${HDR10_PLUS_LIBRARY}
${FFMPEG_PLATFORM_LIBRARIES})

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/third-party
Expand Down Expand Up @@ -654,8 +655,8 @@ elseif(UNIX)

# Dependencies
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libcurl4, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, libcurl >= 7.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libcurl4, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2")
set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, libcurl >= 7.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config
endif()
endif()
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ RUN apt-get update -y \
libcurl4-openssl-dev=7.81.0* \
libdrm-dev=2.4.110* \
libevdev-dev=1.12.1* \
libpulse-dev=1:15.99.1* \
libnuma-dev=2.0.14* \
libopus-dev=1.3.1* \
libpulse-dev=1:15.99.1* \
libssl-dev=3.0.2* \
libva-dev=2.14.0* \
libvdpau-dev=1.4* \
libwayland-dev=1.20.0* \
libx11-dev=2:1.7.5* \
libxcb-shm0-dev=1.14* \
Expand Down
37 changes: 23 additions & 14 deletions docs/source/building/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ Install Requirements
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
Expand All @@ -35,7 +38,7 @@ Install Requirements
nodejs \
npm \
nvidia-cuda-dev \ # Cuda, NvFBC
nvidia-cuda-toolkit \ # Cuda, NvFBC
nvidia-cuda-toolkit # Cuda, NvFBC

Fedora 35
^^^^^^^^^
Expand All @@ -55,9 +58,10 @@ Install Requirements
boost-devel \
boost-static.x86_64 \
cmake \
ffmpeg-devel \
gcc-c++ \
libevdev-devel \
libva-devel \
libvdpau-devel \
libX11-devel \ # X11
libxcb-devel \ # X11
libXcursor-devel \ # X11
Expand All @@ -69,10 +73,11 @@ Install Requirements
mesa-libGL-devel \
nodejs \
npm \
numactl-devel \
openssl-devel \
opus-devel \
pulseaudio-libs-devel \
rpm-build \ # if you want to build an RPM binary package
rpm-build # if you want to build an RPM binary package

Ubuntu 18.04
^^^^^^^^^^^^
Expand All @@ -83,10 +88,7 @@ Install Repositories

sudo apt update && sudo apt install \
software-properties-common \
&& add-apt-repository ppa:savoury1/graphics && \
add-apt-repository ppa:savoury1/multimedia && \
add-apt-repository ppa:savoury1/ffmpeg4 && \
add-apt-repository ppa:savoury1/boost-defaults-1.71 && \
&& add-apt-repository ppa:savoury1/boost-defaults-1.71 && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \

Install Requirements
Expand All @@ -105,9 +107,12 @@ Install Requirements
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
Expand All @@ -118,7 +123,7 @@ Install Requirements
libxtst-dev \ # X11
nodejs \
npm \
wget \
wget

Update gcc alias
.. code-block:: bash
Expand Down Expand Up @@ -158,9 +163,12 @@ Install Requirements
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
libxcb-shm0-dev \ # X11
Expand All @@ -171,7 +179,7 @@ Install Requirements
libxtst-dev \ # X11
nodejs \
npm \
wget \
wget

Update gcc alias
.. code-block:: bash
Expand Down Expand Up @@ -201,8 +209,9 @@ Install Requirements
libcap-dev \ # KMS
libdrm-dev \ # KMS
libevdev-dev \
libpulse-dev \
libnuma-dev \
libopus-dev \
libpulse-dev \
libssl-dev \
libwayland-dev \ # Wayland
libx11-dev \ # X11
Expand All @@ -215,7 +224,7 @@ Install Requirements
nodejs \
npm \
nvidia-cuda-dev \ # Cuda, NvFBC
nvidia-cuda-toolkit \ # Cuda, NvFBC
nvidia-cuda-toolkit # Cuda, NvFBC

npm dependencies
----------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/building/macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ MacPorts
Install Requirements
.. code-block:: bash

sudo port install cmake boost ffmpeg libopus npm9
sudo port install boost cmake libopus npm9

Homebrew
""""""""
Install Requirements
.. code-block:: bash

brew install boost cmake ffmpeg node opus
brew install boost cmake node opus
# if there are issues with an SSL header that is not found:
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
Expand Down
14 changes: 2 additions & 12 deletions packaging/linux/aur/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ arch=('x86_64' 'i686')
url=@PROJECT_HOMEPAGE_URL@
license=('GPL3')

depends=('avahi' 'boost-libs' 'curl' 'ffmpeg4.4' 'libevdev' 'libpulse' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'openssl' 'opus' 'udev')
depends=('avahi' 'boost-libs' 'curl' 'libevdev' 'libpulse' 'libva' 'libvdpau' 'libx11' 'libxcb' 'libxfixes' 'libxrandr' 'libxtst' 'numactl' 'openssl' 'opus' 'udev')
makedepends=('boost' 'cmake' 'git' 'make' 'nodejs' 'npm')
optdepends=('cuda' 'libcap' 'libdrm')

Expand Down Expand Up @@ -38,17 +38,7 @@ build() {
-Wno-dev \
-D CMAKE_INSTALL_PREFIX=/usr \
-D SUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-D SUNSHINE_ASSETS_DIR="share/sunshine" \
-D LIBAVCODEC_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVCODEC_LIBRARIES=/usr/lib/ffmpeg4.4/libavcodec.so \
-D LIBAVDEVICE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVDEVICE_LIBRARIES=/usr/lib/ffmpeg4.4/libavdevice.so \
-D LIBAVFORMAT_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVFORMAT_LIBRARIES=/usr/lib/ffmpeg4.4/libavformat.so \
-D LIBAVUTIL_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBAVUTIL_LIBRARIES=/usr/lib/ffmpeg4.4/libavutil.so \
-D LIBSWSCALE_INCLUDE_DIR=/usr/include/ffmpeg4.4 \
-D LIBSWSCALE_LIBRARIES=/usr/lib/ffmpeg4.4/libswscale.so
-D SUNSHINE_ASSETS_DIR="share/sunshine"

make -C build
}
Expand Down
Loading