Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/nightly' into unpair-single-cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
xanderfrangos committed May 21, 2024
2 parents d2e21f9 + 26ceec5 commit 1633f75
Show file tree
Hide file tree
Showing 84 changed files with 2,179 additions and 1,418 deletions.
35 changes: 24 additions & 11 deletions .codeql-prebuild-cpp-Linux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# install dependencies for C++ analysis
set -e

CUDA_VERSION=11.8.0
CUDA_BUILD=520.61.05

# install wget and cuda first
sudo apt-get update -y
sudo apt-get install -y \
wget

# Install CUDA
url_base="https://developer.download.nvidia.com/compute/cuda/${CUDA_VERSION}/local_installers"
url="${url_base}/cuda_${CUDA_VERSION}_${CUDA_BUILD}_linux.run"
sudo wget -q -O /root/cuda.run ${url}
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr/local/cuda --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run

# Install dependencies
sudo apt-get install -y \
build-essential \
gcc-10 \
Expand Down Expand Up @@ -32,8 +48,7 @@ sudo apt-get install -y \
libxcb1-dev \
libxfixes-dev \
libxrandr-dev \
libxtst-dev \
wget
libxtst-dev

# clean apt cache
sudo apt-get clean
Expand All @@ -48,19 +63,17 @@ sudo update-alternatives --install \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-10 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-10

# Install CUDA
sudo wget \
https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run \
--progress=bar:force:noscroll -q --show-progress -O /root/cuda.run
sudo chmod a+x /root/cuda.run
sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm
sudo rm /root/cuda.run

# build
mkdir -p build
cd build || exit 1
cmake -G "Unix Makefiles" ..
cmake \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
-G "Unix Makefiles" \
..
make -j"$(nproc)"

# Delete CUDA
sudo rm -rf /usr/local/cuda

# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"
44 changes: 38 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ jobs:
# allow libfuse2 for appimage on 22.04
sudo add-apt-repository universe
# libx11-xcb-dev and libxcb-dri3-dev are required for building libva
sudo apt-get install -y \
build-essential \
cmake \
Expand All @@ -349,10 +350,11 @@ jobs:
libopus-dev \
libpulse-dev \
libssl-dev \
libva-dev \
libvdpau-dev \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-dri3-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
libxcb1-dev \
Expand Down Expand Up @@ -380,12 +382,30 @@ jobs:
with:
python-version: '3.11'

- name: Build latest libva
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 5
run: |
gh release download --archive=tar.gz --repo=intel/libva
tar xzf libva-*.tar.gz && rm libva-*.tar.gz
cd libva-*
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu \
--enable-drm \
--enable-x11 \
--enable-glx \
--enable-wayland \
--without-legacy # emgd, nvctrl, fglrx
make -j $(nproc)
sudo make install
cd .. && rm -rf libva-*
- name: Build Linux
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
timeout-minutes: 5
timeout-minutes: 10
run: |
echo "nproc: $(nproc)"
Expand Down Expand Up @@ -456,7 +476,7 @@ jobs:
# permissions
chmod +x ../artifacts/sunshine.AppImage
- name: Delete cuda
- name: Delete CUDA
# free up space on the runner
run: |
sudo rm -rf /usr/local/cuda
Expand Down Expand Up @@ -506,8 +526,11 @@ jobs:
run: |
${{ steps.python.outputs.python-path }} -m pip install gcovr
${{ steps.python.outputs.python-path }} -m gcovr -r .. \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--exclude '.*tests/.*' \
--exclude '.*tests/.*' \
--exclude '.*third-party/.*' \
--xml-pretty \
-o coverage.xml
Expand All @@ -524,6 +547,7 @@ jobs:
files: ./build/coverage.xml
flags: ${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
Expand Down Expand Up @@ -630,7 +654,7 @@ jobs:
echo "publish=${PUBLISH}" >> $GITHUB_OUTPUT
- name: Validate and Publish Homebrew Formula
uses: LizardByte/homebrew-release-action@v2024.417.220943
uses: LizardByte/homebrew-release-action@v2024.516.191449
with:
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
git_email: ${{ secrets.GH_BOT_EMAIL }}
Expand Down Expand Up @@ -842,6 +866,9 @@ jobs:
cd ${build_dir}
${{ steps.python.outputs.python-path }} -m pip install gcovr
sudo ${{ steps.python.outputs.python-path }} -m gcovr -r ../${dir} \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--exclude '.*${dir}/tests/.*' \
--exclude '.*${dir}/third-party/.*' \
--gcov-object-directory $(pwd) \
Expand All @@ -862,6 +889,7 @@ jobs:
files: ./build/coverage.xml
flags: ${{ runner.os }}-${{ matrix.os_version }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' && matrix.release }}
Expand Down Expand Up @@ -1086,8 +1114,11 @@ jobs:
run: |
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
${{ steps.python-path.outputs.python-path }} -m gcovr -r .. \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
--exclude '.*tests/.*' \
--exclude '.*tests/.*' \
--exclude '.*third-party/.*' \
--xml-pretty \
-o coverage.xml
Expand All @@ -1104,6 +1135,7 @@ jobs:
files: ./build/coverage.xml
flags: ${{ runner.os }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Package Windows Debug Info
working-directory: build
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
if (key.toLowerCase() === 'swift') {
osList = ['macos-latest'];
} else if (key.toLowerCase() === 'cpp') {
osList = ['macos-latest', 'ubuntu-latest', 'windows-latest'];
// TODO: update macos to latest after the below issue is resolved
// https://github.com/github/codeql-action/issues/2266
osList = ['macos-13', 'ubuntu-latest', 'windows-latest'];
}
for (let os of osList) {
// set name for matrix
Expand Down Expand Up @@ -120,10 +122,12 @@ jobs:

steps:
- name: Maximize build space
if: runner.os == 'Linux'
uses: easimon/maximize-build-space@v8
if: >-
runner.os == 'Linux' &&
matrix.language == 'cpp'
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 20480
root-reserve-mb: 30720
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
remove-android: 'true'
remove-haskell: 'true'
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Update changelog on release events.

name: Update changelog

on:
release:
types: [created, edited, deleted]
workflow_dispatch:

concurrency:
group: "${{ github.workflow }}"
cancel-in-progress: true

jobs:
update-changelog:
if: >-
github.event_name == 'workflow_dispatch' ||
(!github.event.release.prerelease && !github.event.release.draft)
runs-on: ubuntu-latest
steps:
- name: Update Changelog
uses: LizardByte/[email protected]
with:
changelogBranch: changelog
changelogFile: CHANGELOG.md
token: ${{ secrets.GH_BOT_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ package-lock.json
# Translations
*.mo
*.pot

# Dummy macOS files
.DS_Store
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ System Requirements
"OS", "Windows: 10+ (Windows Server does not support virtual gamepads)"
"", "macOS: 12+"
"", "Linux/Debian: 11 (bullseye)"
"", "Linux/Fedora: 38+"
"", "Linux/Fedora: 39+"
"", "Linux/Ubuntu: 22.04+ (jammy)"
"Network", "Host: 5GHz, 802.11ac"
"", "Client: 5GHz, 802.11ac"
Expand Down
2 changes: 1 addition & 1 deletion cmake/compile_definitions/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ set(SUNSHINE_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Rtsp.h"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/RtspParser.c"
"${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Video.h"
"${CMAKE_SOURCE_DIR}/third-party/tray/tray.h"
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray.h"
"${CMAKE_SOURCE_DIR}/src/upnp.cpp"
"${CMAKE_SOURCE_DIR}/src/upnp.h"
"${CMAKE_SOURCE_DIR}/src/cbs.cpp"
Expand Down
3 changes: 1 addition & 2 deletions cmake/compile_definitions/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ if(${SUNSHINE_ENABLE_TRAY})
include_directories(SYSTEM ${APPINDICATOR_INCLUDE_DIRS} ${LIBNOTIFY_INCLUDE_DIRS})
link_directories(${APPINDICATOR_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS})

list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/third-party/tray/tray_linux.c")
list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_linux.c")
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES ${APPINDICATOR_LIBRARIES} ${LIBNOTIFY_LIBRARIES})
endif()
else()
Expand Down Expand Up @@ -248,7 +248,6 @@ list(APPEND PLATFORM_TARGET_FILES
list(APPEND PLATFORM_LIBRARIES
Boost::dynamic_linking
dl
numa
pulse
pulse-simple)

Expand Down
16 changes: 12 additions & 4 deletions cmake/compile_definitions/macos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

add_compile_definitions(SUNSHINE_PLATFORM="macos")

link_directories(/opt/local/lib)
link_directories(/usr/local/lib)
link_directories(/opt/homebrew/lib)
set(MACOS_LINK_DIRECTORIES
/opt/homebrew/lib
/opt/local/lib
/usr/local/lib)

foreach(dir ${MACOS_LINK_DIRECTORIES})
if(EXISTS ${dir})
link_directories(${dir})
endif()
endforeach()

ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK)

list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
Expand Down Expand Up @@ -46,5 +54,5 @@ if(SUNSHINE_ENABLE_TRAY)
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${COCOA})
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/tray/tray_darwin.m")
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_darwin.m")
endif()
2 changes: 1 addition & 1 deletion cmake/compile_definitions/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ list(PREPEND PLATFORM_LIBRARIES

if(SUNSHINE_ENABLE_TRAY)
list(APPEND PLATFORM_TARGET_FILES
"${CMAKE_SOURCE_DIR}/third-party/tray/tray_windows.c")
"${CMAKE_SOURCE_DIR}/third-party/tray/src/tray_windows.c")
endif()
Loading

0 comments on commit 1633f75

Please sign in to comment.