From 57b5b296da60b07aaa11c517a071992beb19bb11 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:12:59 -0400 Subject: [PATCH 01/22] build(homebrew): explicitly set cxx standard (#3797) --- packaging/sunshine.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index 81e42b09..ecd8ff3e 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -65,6 +65,7 @@ class @PROJECT_NAME@ < Formula args = %W[ -DBUILD_WERROR=ON + -DCMAKE_CXX_STANDARD=20 -DCMAKE_INSTALL_PREFIX=#{prefix} -DHOMEBREW_ALLOW_FETCHCONTENT=ON -DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} From 5529850c10a2837103b145311718a9fec25a4486 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 19 Apr 2025 13:33:09 -0400 Subject: [PATCH 02/22] docs: add external documentation (#3801) --- docs/Doxyfile | 1 + docs/app_examples.md | 6 +++--- docs/awesome_sunshine.md | 23 +++++++++++++++++++++++ docs/guides.md | 6 +++--- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 docs/awesome_sunshine.md diff --git a/docs/Doxyfile b/docs/Doxyfile index 5fa4ee6c..8549dbba 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -49,6 +49,7 @@ INPUT = ../README.md \ legal.md \ configuration.md \ app_examples.md \ + awesome_sunshine.md \ guides.md \ performance_tuning.md \ api.md \ diff --git a/docs/app_examples.md b/docs/app_examples.md index 0a814f75..deefc478 100644 --- a/docs/app_examples.md +++ b/docs/app_examples.md @@ -322,9 +322,9 @@ UAC prompt.
-| Previous | Next | -|:----------------------------------|--------------------:| -| [Configuration](configuration.md) | [Guides](guides.md) | +| Previous | Next | +|:----------------------------------|----------------------------------------:| +| [Configuration](configuration.md) | [Awesome-Sunshine](awesome_sunshine.md) |
diff --git a/docs/awesome_sunshine.md b/docs/awesome_sunshine.md new file mode 100644 index 00000000..554c8113 --- /dev/null +++ b/docs/awesome_sunshine.md @@ -0,0 +1,23 @@ +# Awesome-Sunshine + +@htmlonly + + + +@endhtmlonly + +
+ +| Previous | Next | +|:--------------------------------|--------------------:| +| [App Examples](app_examples.md) | [Guides](guides.md) | + +
+ +
+ + [TOC] +
diff --git a/docs/guides.md b/docs/guides.md index 1b9f654a..8f3d056d 100644 --- a/docs/guides.md +++ b/docs/guides.md @@ -7,9 +7,9 @@ Feel free to contribute your own tips and trips by making a PR to
-| Previous | Next | -|:--------------------------------|--------------------------------------------:| -| [App Examples](app_examples.md) | [Performance Tuning](performance_tuning.md) | +| Previous | Next | +|:----------------------------------------|--------------------------------------------:| +| [Awesome-Sunshine](awesome_sunshine.md) | [Performance Tuning](performance_tuning.md) |
From 4f2603ff636d4cab907fc239c913fd1261840f71 Mon Sep 17 00:00:00 2001 From: Andy Grundman Date: Sat, 19 Apr 2025 17:48:17 -0400 Subject: [PATCH 03/22] fix(audio): set the bits-per-sample of Steam Streaming Speakers to 16-bit when the default audio device is 16-bit (#3704) --- src/platform/windows/audio.cpp | 39 ++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/platform/windows/audio.cpp b/src/platform/windows/audio.cpp index 6726a470..7c38b1bc 100644 --- a/src/platform/windows/audio.cpp +++ b/src/platform/windows/audio.cpp @@ -117,15 +117,26 @@ namespace { using virtual_sink_waveformats_t = std::vector; + /** + * @brief List of supported waveformats for an N-channel virtual audio device + * @tparam channel_count Number of virtual audio channels + * @returns std::vector + * @note The list of virtual formats returned are sorted in preference order and the first valid + * format will be used. All bits-per-sample options are listed because we try to match + * this to the default audio device. See also: set_format() below. + */ template virtual_sink_waveformats_t create_virtual_sink_waveformats() { if constexpr (channel_count == 2) { auto channel_mask = waveformat_mask_stereo; - // only choose 24 or 16-bit formats to avoid clobbering existing Dolby/DTS spatial audio settings + // The 32-bit formats are a lower priority for stereo because using one will disable Dolby/DTS + // spatial audio mode if the user enabled it on the Steam speaker. return { create_waveformat(sample_format_e::s24in32, channel_count, channel_mask), create_waveformat(sample_format_e::s24, channel_count, channel_mask), create_waveformat(sample_format_e::s16, channel_count, channel_mask), + create_waveformat(sample_format_e::f32, channel_count, channel_mask), + create_waveformat(sample_format_e::s32, channel_count, channel_mask), }; } else if (channel_count == 6) { auto channel_mask1 = waveformat_mask_surround51_with_backspeakers; @@ -298,6 +309,10 @@ namespace platf::audio { auto waveformatext_pointer = reinterpret_cast(mixer_waveformat.get()); capture_waveformat.dwChannelMask = waveformatext_pointer->dwChannelMask; } + + BOOST_LOG(info) << "Audio mixer format is "sv << mixer_waveformat->wBitsPerSample << "-bit, "sv + << mixer_waveformat->nSamplesPerSec << " Hz, "sv + << ((mixer_waveformat->nSamplesPerSec != 48000) ? "will be resampled to 48000 by Windows"sv : "no resampling needed"sv); } status = audio_client->Initialize( @@ -315,7 +330,7 @@ namespace platf::audio { return nullptr; } - BOOST_LOG(info) << "Audio capture format is " << logging::bracket(waveformat_to_pretty_string(capture_waveformat)); + BOOST_LOG(info) << "Audio capture format is "sv << logging::bracket(waveformat_to_pretty_string(capture_waveformat)); return audio_client; } @@ -793,6 +808,22 @@ namespace platf::audio { } } + // When switching to a Steam virtual speaker device, try to retain the bit depth of the + // default audio device. Switching from a 16-bit device to a 24-bit one has been known to + // cause glitches for some users. + int wanted_bits_per_sample = 32; + auto current_default_dev = default_device(device_enum); + if (current_default_dev) { + audio::prop_t prop; + prop_var_t current_device_format; + + if (SUCCEEDED(current_default_dev->OpenPropertyStore(STGM_READ, &prop)) && SUCCEEDED(prop->GetValue(PKEY_AudioEngine_DeviceFormat, ¤t_device_format.prop))) { + auto *format = (WAVEFORMATEXTENSIBLE *) current_device_format.prop.blob.pBlobData; + wanted_bits_per_sample = format->Samples.wValidBitsPerSample; + BOOST_LOG(info) << "Virtual audio device will use "sv << wanted_bits_per_sample << "-bit to match default device"sv; + } + } + auto &device_id = virtual_sink_info->first; auto &waveformats = virtual_sink_info->second.get().virtual_sink_waveformats; for (const auto &waveformat : waveformats) { @@ -802,6 +833,10 @@ namespace platf::audio { auto waveformat_copy = waveformat; auto waveformat_copy_pointer = reinterpret_cast(&waveformat_copy); + if (wanted_bits_per_sample != waveformat.Samples.wValidBitsPerSample) { + continue; + } + WAVEFORMATEXTENSIBLE p {}; if (SUCCEEDED(policy->SetDeviceFormat(device_id_copy.c_str(), waveformat_copy_pointer, (WAVEFORMATEX *) &p))) { BOOST_LOG(info) << "Changed virtual audio sink format to " << logging::bracket(waveformat_to_pretty_string(waveformat)); From f76ad0d238720108646e0401270c4ccd653b1881 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 19 Apr 2025 22:22:43 -0400 Subject: [PATCH 04/22] docs(website): use cdn for branded icons (#3803) --- gh-pages-template/index.html | 75 +++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/gh-pages-template/index.html b/gh-pages-template/index.html index 24a97352..9b0c2f5e 100644 --- a/gh-pages-template/index.html +++ b/gh-pages-template/index.html @@ -56,7 +56,7 @@ ext-js:
- Moonlight + Moonlight
Moonlight Support
@@ -163,7 +163,7 @@ ext-js:
- + Android
@@ -182,7 +182,7 @@ ext-js: Get it on Google Play + height="60"/>
@@ -190,14 +190,14 @@ ext-js: Available at Amazon Appstore + style="padding: 10px;"/>
@@ -210,7 +210,7 @@ ext-js:
- + Chrome Web Store
@@ -229,7 +229,7 @@ ext-js: Available in the Chrome Web Store + height="30"/>
@@ -242,7 +242,8 @@ ext-js:
- + iOS + Apple TV
@@ -261,14 +262,14 @@ ext-js: Download on the App Store + height="40"/>
@@ -281,10 +282,10 @@ ext-js:
- - - - + Linux + macOS + Windows + Steam
@@ -314,7 +315,7 @@ ext-js:
- + Raspberry Pi
@@ -344,7 +345,7 @@ ext-js:
- + Xbox
@@ -363,7 +364,7 @@ ext-js: Get it from Microsoft + height="40"/>
@@ -376,7 +377,7 @@ ext-js:
- + PlayStation Vita
@@ -406,12 +407,16 @@ ext-js:
- + Nintendo Switch + Android + Apple TV + iOS + macOS
@@ -436,7 +441,7 @@ ext-js:
- + Wii U
@@ -466,7 +471,7 @@ ext-js:
- + LG webOS TV
@@ -514,7 +519,7 @@ ext-js:
@@ -537,27 +542,37 @@ ext-js:
From e58a437e6ba55ef420a44242ac559302e62aca32 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 20 Apr 2025 10:25:33 -0400 Subject: [PATCH 05/22] ci(workflows): minor fixes and updates (#3581) --- .github/workflows/ci-copr.yml | 2 +- .../workflows/release-notifier-moonlight.yml | 12 ++--- .github/workflows/update-flathub-repo.yml | 23 ++++++++- .github/workflows/update-pacman-repo.yml | 25 ++++++++++ scripts/linux_build.sh | 50 ++++++++++++------- 5 files changed, 84 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci-copr.yml b/.github/workflows/ci-copr.yml index db02c912..7820d756 100644 --- a/.github/workflows/ci-copr.yml +++ b/.github/workflows/ci-copr.yml @@ -26,7 +26,7 @@ jobs: github_org_owner: LizardByte copr_ownername: lizardbyte auto_update_package: true - job_timeout: 60 + job_timeout: 90 secrets: COPR_BETA_WEBHOOK_TOKEN: ${{ secrets.COPR_BETA_WEBHOOK_TOKEN }} COPR_STABLE_WEBHOOK_TOKEN: ${{ secrets.COPR_STABLE_WEBHOOK_TOKEN }} diff --git a/.github/workflows/release-notifier-moonlight.yml b/.github/workflows/release-notifier-moonlight.yml index 9369a7fa..3cf18a37 100644 --- a/.github/workflows/release-notifier-moonlight.yml +++ b/.github/workflows/release-notifier-moonlight.yml @@ -15,13 +15,13 @@ jobs: runs-on: ubuntu-latest steps: - name: discord - uses: sarisia/actions-status-discord@v1 # https://github.com/sarisia/actions-status-discord + uses: sarisia/actions-status-discord@v1 with: - webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }} + avatar_url: ${{ vars.ORG_LOGO_URL }}256 + color: 0x${{ vars.COLOR_HEX_GREEN }} + description: ${{ github.event.release.body }} nodetail: true nofail: false - username: ${{ secrets.DISCORD_USERNAME }} - avatar_url: ${{ secrets.ORG_LOGO_URL }} title: ${{ github.event.repository.name }} ${{ github.ref_name }} Released - description: ${{ github.event.release.body }} - color: 0xFF4500 + username: ${{ secrets.DISCORD_USERNAME }} + webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK_MOONLIGHT }} diff --git a/.github/workflows/update-flathub-repo.yml b/.github/workflows/update-flathub-repo.yml index c1ffcdd0..effbc07b 100644 --- a/.github/workflows/update-flathub-repo.yml +++ b/.github/workflows/update-flathub-repo.yml @@ -9,7 +9,8 @@ name: Update flathub repo on: release: - types: [released] + types: + - released concurrency: group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" @@ -114,7 +115,7 @@ jobs: out-file-path: "flathub/${{ env.FLATHUB_PKG }}" extract: true - - name: Delete arhive + - name: Delete archive if: >- steps.check-label.outputs.hasTopic == 'true' && steps.check-release.outputs.isLatestRelease == 'true' @@ -172,6 +173,7 @@ jobs: git checkout $main_commit - name: Create/Update Pull Request + id: create-pr if: >- steps.check-label.outputs.hasTopic == 'true' && steps.check-release.outputs.isLatestRelease == 'true' && @@ -185,3 +187,20 @@ jobs: delete-branch: true title: "chore: Update ${{ env.FLATHUB_PKG }} to ${{ github.event.release.tag_name }}" body: ${{ github.event.release.body }} + + - name: Automerge PR + env: + GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} + if: >- + steps.check-label.outputs.hasTopic == 'true' && + steps.check-release.outputs.isLatestRelease == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + run: | + gh \ + pr \ + merge \ + --auto \ + --delete-branch \ + --repo "flathub/${{ env.FLATHUB_PKG }}" \ + --squash \ + "${{ steps.create-pr.outputs.pull-request-number }}" diff --git a/.github/workflows/update-pacman-repo.yml b/.github/workflows/update-pacman-repo.yml index 9f379618..0307b285 100644 --- a/.github/workflows/update-pacman-repo.yml +++ b/.github/workflows/update-pacman-repo.yml @@ -87,7 +87,16 @@ jobs: out-file-path: "pkgbuilds/${{ steps.prep.outputs.pkg_name }}" extract: true + - name: Remove pkg.tar.gz + if: >- + steps.check-label.outputs.hasTopic == 'true' && + steps.check-release.outputs.isLatestRelease == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + run: | + rm -f "pkgbuilds/${{ steps.prep.outputs.pkg_name }}" + - name: Create/Update Pull Request + id: create-pr if: >- steps.check-label.outputs.hasTopic == 'true' && steps.check-release.outputs.isLatestRelease == 'true' && @@ -105,3 +114,19 @@ jobs: labels: | auto-approve auto-merge + + - name: Automerge PR + env: + GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }} + if: >- + steps.check-label.outputs.hasTopic == 'true' && + steps.check-release.outputs.isLatestRelease == 'true' && + fromJson(steps.download.outputs.downloaded_files)[0] + run: | + gh \ + pr \ + merge \ + --auto \ + --delete-branch \ + --squash \ + "${{ steps.create-pr.outputs.pull-request-number }}" diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 4cb071ec..e13ad594 100644 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -90,7 +90,7 @@ shift $((OPTIND -1)) # dependencies array to build out dependencies=() -function add_debain_based_deps() { +function add_debian_based_deps() { dependencies+=( "bison" # required if we need to compile doxygen "build-essential" @@ -134,8 +134,8 @@ function add_debain_based_deps() { fi } -function add_debain_deps() { - add_debain_based_deps +function add_debian_deps() { + add_debian_based_deps dependencies+=( "libayatana-appindicator3-dev" ) @@ -147,7 +147,7 @@ function add_ubuntu_deps() { ${sudo_cmd} add-apt-repository ppa:ubuntu-toolchain-r/test -y fi - add_debain_based_deps + add_debian_based_deps dependencies+=( "libappindicator3-dev" ) @@ -157,8 +157,8 @@ function add_fedora_deps() { dependencies+=( "cmake" "doxygen" - "gcc" - "g++" + "gcc${gcc_version}" + "gcc${gcc_version}-c++" "git" "graphviz" "libappindicator-gtk3-devel" @@ -304,12 +304,12 @@ function run_install() { $package_update_command if [ "$distro" == "debian" ]; then - add_debain_deps + add_debian_deps elif [ "$distro" == "ubuntu" ]; then add_ubuntu_deps elif [ "$distro" == "fedora" ]; then add_fedora_deps - ${sudo_cmd} dnf group install "Development Tools" -y + ${sudo_cmd} dnf group install "$dev_tools_group" -y fi # Install the dependencies @@ -445,24 +445,36 @@ if grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then cuda_build="525.60.13" gcc_version="12" nvm_node=0 -elif grep -q "PLATFORM_ID=\"platform:f39\"" /etc/os-release; then - distro="fedora" - version="39" - package_update_command="${sudo_cmd} dnf update -y" - package_install_command="${sudo_cmd} dnf install -y" - cuda_version="12.4.0" - cuda_build="550.54.14" - gcc_version="13" - nvm_node=0 elif grep -q "PLATFORM_ID=\"platform:f40\"" /etc/os-release; then distro="fedora" version="40" package_update_command="${sudo_cmd} dnf update -y" package_install_command="${sudo_cmd} dnf install -y" - cuda_version= - cuda_build= + cuda_version=12.6.3 + cuda_build=560.35.05 gcc_version="13" nvm_node=0 + dev_tools_group="Development Tools" +elif grep -q "PLATFORM_ID=\"platform:f41\"" /etc/os-release; then + distro="fedora" + version="41" + package_update_command="${sudo_cmd} dnf update -y" + package_install_command="${sudo_cmd} dnf install -y" + cuda_version=12.6.3 + cuda_build=560.35.05 + gcc_version="13" + nvm_node=0 + dev_tools_group="development-tools" +elif grep -q "PLATFORM_ID=\"platform:f42\"" /etc/os-release; then + distro="fedora" + version="42" + package_update_command="${sudo_cmd} dnf update -y" + package_install_command="${sudo_cmd} dnf install -y" + cuda_version=12.8.1 + cuda_build=570.124.06 + gcc_version="14" + nvm_node=0 + dev_tools_group="development-tools" elif grep -q "Ubuntu 22.04" /etc/os-release; then distro="ubuntu" version="22.04" From 65b0217a903db803744f62c1fff51cb85b5a4409 Mon Sep 17 00:00:00 2001 From: Vladimir Romashchenko <52473614+eaglesemanation@users.noreply.github.com> Date: Tue, 22 Apr 2025 22:43:13 -0400 Subject: [PATCH 06/22] fix(apps): exit steam big picture mode on session end (#3808) --- docs/app_examples.md | 33 ++++++++++++++++------------- src_assets/linux/assets/apps.json | 6 ++++++ src_assets/macos/assets/apps.json | 6 ++++++ src_assets/windows/assets/apps.json | 6 ++++++ 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/docs/app_examples.md b/docs/app_examples.md index deefc478..8e7d8940 100644 --- a/docs/app_examples.md +++ b/docs/app_examples.md @@ -23,25 +23,28 @@ process is killed.} @tabs{ @tab{Linux | - \| Field \| Value \| - \|-------------------\|-----------------------------------------------------\| - \| Application Name \| @code{}Steam Big Picture@endcode \| - \| Detached Commands \| @code{}setsid steam steam://open/bigpicture@endcode \| - \| Image \| @code{}steam.png@endcode \| + \| 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{macOS | - \| Field \| Value \| - \|-------------------\|---------------------------------------------------\| - \| Application Name \| @code{}Steam Big Picture@endcode \| - \| Detached Commands \| @code{}open steam steam://open/bigpicture@endcode \| - \| Image \| @code{}steam.png@endcode \| + \| Field \| Value \| + \|------------------------------\|------------------------------------------------\| + \| Application Name \| @code{}Steam Big Picture@endcode \| + \| Command Preporations -> Undo \| @code{}open steam://close/bigpicture@endcode \| + \| Detached Commands \| @code{}open steam://open/bigpicture@endcode \| + \| Image \| @code{}steam.png@endcode \| } @tab{Windows | - \| Field \| Value \| - \|-------------------\|----------------------------------------\| - \| Application Name \| @code{}Steam Big Picture@endcode \| - \| Detached Commands \| @code{}steam://open/bigpicture@endcode \| - \| Image \| @code{}steam.png@endcode \| + \| Field \| Value \| + \|------------------------------\|-------------------------------------------\| + \| Application Name \| @code{}Steam Big Picture@endcode \| + \| Command Preporations -> Undo \| @code{}steam://close/bigpicture@endcode \| + \| Detached Commands \| @code{}steam://open/bigpicture@endcode \| + \| Image \| @code{}steam.png@endcode \| } } diff --git a/src_assets/linux/assets/apps.json b/src_assets/linux/assets/apps.json index 04d98b62..bde2842e 100644 --- a/src_assets/linux/assets/apps.json +++ b/src_assets/linux/assets/apps.json @@ -22,6 +22,12 @@ "detached": [ "setsid steam steam://open/bigpicture" ], + "prep-cmd": [ + { + "do": "", + "undo": "setsid steam steam://close/bigpicture" + } + ], "image-path": "steam.png" } ] diff --git a/src_assets/macos/assets/apps.json b/src_assets/macos/assets/apps.json index dcb8637c..ebc636e0 100644 --- a/src_assets/macos/assets/apps.json +++ b/src_assets/macos/assets/apps.json @@ -12,6 +12,12 @@ "detached": [ "open steam://open/bigpicture" ], + "prep-cmd": [ + { + "do": "", + "undo": "open steam://close/bigpicture" + } + ], "image-path": "steam.png" } ] diff --git a/src_assets/windows/assets/apps.json b/src_assets/windows/assets/apps.json index c8d4cb74..9197dd84 100644 --- a/src_assets/windows/assets/apps.json +++ b/src_assets/windows/assets/apps.json @@ -8,6 +8,12 @@ { "name": "Steam Big Picture", "cmd": "steam://open/bigpicture", + "prep-cmd": [ + { + "do": "", + "undo": "steam://close/bigpicture" + } + ], "auto-detach": true, "wait-all": true, "image-path": "steam.png" From 1df4c890263076dae8f0d9eb876dbd2f3549c974 Mon Sep 17 00:00:00 2001 From: LizardByte-bot <108553330+LizardByte-bot@users.noreply.github.com> Date: Fri, 25 Apr 2025 19:09:06 -0400 Subject: [PATCH 07/22] chore: update global workflows (#3813) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- .github/workflows/CI.yml | 82 +++++++++---------- .github/workflows/ci-copr.yml | 2 + .github/workflows/ci-docker.yml | 50 ++++++----- .github/workflows/codeql.yml | 63 ++++++++++---- .github/workflows/common-lint.yml | 18 ++-- .github/workflows/issues.yml | 11 ++- .github/workflows/localize.yml | 13 ++- .../workflows/release-notifier-moonlight.yml | 19 ++++- .github/workflows/release-notifier.yml | 15 ++-- .github/workflows/update-changelog.yml | 10 ++- .github/workflows/update-docs.yml | 13 +-- .github/workflows/update-flathub-repo.yml | 22 ++--- .github/workflows/update-homebrew-release.yml | 21 +++-- .github/workflows/update-pacman-repo.yml | 22 ++--- .github/workflows/update-pages.yml | 10 ++- .github/workflows/update-winget-release.yml | 21 +++-- scripts/requirements.txt | 2 +- src/config.cpp | 7 +- src/network.cpp | 2 +- src/platform/linux/graphics.cpp | 2 +- src/platform/windows/display_vram.cpp | 4 +- src/platform/windows/input.cpp | 6 +- src/rtsp.cpp | 8 +- src/utility.h | 10 +-- 24 files changed, 256 insertions(+), 177 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f80092b7..0636112f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,12 +1,19 @@ --- name: CI +permissions: + contents: read on: pull_request: - branches: [master] - types: [opened, synchronize, reopened] + branches: + - master + types: + - opened + - synchronize + - reopened push: - branches: [master] + branches: + - master workflow_dispatch: concurrency: @@ -17,7 +24,6 @@ jobs: github_env: name: GitHub Env Debug runs-on: ubuntu-latest - steps: - name: Dump github context run: echo "$GITHUB_CONTEXT" @@ -46,12 +52,12 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} build_linux_flatpak: + name: Linux Flatpak env: APP_ID: dev.lizardbyte.app.Sunshine NODE_VERSION: "20" PLATFORM_VERSION: "23.08" - name: Linux Flatpak - needs: [setup_release] + needs: setup_release runs-on: ${{ matrix.runner }} strategy: fail-fast: false # false to test all, true to fail entire job if any fail @@ -61,7 +67,6 @@ jobs: runner: ubuntu-22.04 - arch: aarch64 runner: ubuntu-22.04-arm - steps: - name: Maximize build space uses: easimon/maximize-build-space@v10 @@ -85,12 +90,10 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Install npm dependencies - run: | - npm install --package-lock-only + run: npm install --package-lock-only - name: Debug package-lock.json - run: | - cat package-lock.json + run: cat package-lock.json - name: Setup python id: python @@ -121,12 +124,10 @@ jobs: - name: flatpak node generator # https://github.com/flatpak/flatpak-builder-tools/blob/master/node/README.md - run: | - flatpak-node-generator npm package-lock.json + run: flatpak-node-generator npm package-lock.json - name: Debug generated-sources.json - run: | - cat generated-sources.json + run: cat generated-sources.json - name: Cache Flatpak build uses: actions/cache@v4 @@ -171,8 +172,7 @@ jobs: - name: Debug Manifest working-directory: build - run: | - cat ${APP_ID}.yml + run: cat ${APP_ID}.yml - name: Build Linux Flatpak working-directory: build @@ -225,7 +225,7 @@ jobs: - name: Package Flathub repo archive # copy files required to generate the Flathub repo - if: ${{ matrix.arch == 'x86_64' }} + if: matrix.arch == 'x86_64' run: | mkdir -p flathub/modules cp ./build/generated-sources.json ./flathub/ @@ -245,9 +245,10 @@ jobs: with: name: sunshine-linux-flatpak-${{ matrix.arch }} path: artifacts/ + if-no-files-found: error - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + if: needs.setup_release.outputs.publish_release == 'true' uses: LizardByte/create-release-action@v2025.102.13208 with: allowUpdates: true @@ -261,7 +262,7 @@ jobs: build_linux: name: Linux ${{ matrix.type }} runs-on: ubuntu-${{ matrix.dist }} - needs: [setup_release] + needs: setup_release strategy: fail-fast: false # false to test all, true to fail entire job if any fail matrix: @@ -269,7 +270,6 @@ jobs: - type: AppImage EXTRA_ARGS: '--appimage-build' dist: 22.04 - steps: - name: Maximize build space uses: easimon/maximize-build-space@v10 @@ -344,14 +344,13 @@ jobs: --ubuntu-test-repo ${{ matrix.EXTRA_ARGS }} - name: Set AppImage Version - if: | - matrix.type == 'AppImage' + if: matrix.type == 'AppImage' run: | version=${{ needs.setup_release.outputs.release_tag }} echo "VERSION=${version}" >> $GITHUB_ENV - name: Package Linux - AppImage - if: ${{ matrix.type == 'AppImage' }} + if: matrix.type == 'AppImage' working-directory: build run: | # install sunshine to the DESTDIR @@ -396,7 +395,7 @@ jobs: rm -rf ./build/cuda - name: Verify AppImage - if: ${{ matrix.type == 'AppImage' }} + if: matrix.type == 'AppImage' run: | wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage @@ -408,6 +407,7 @@ jobs: with: name: sunshine-linux-${{ matrix.type }}-${{ matrix.dist }} path: artifacts/ + if-no-files-found: error - name: Install test deps run: | @@ -431,9 +431,9 @@ jobs: ./test_sunshine --gtest_color=yes - name: Generate gcov report + id: test_report # any except canceled or skipped if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') - id: test_report working-directory: build run: | ${{ steps.python.outputs.python-path }} -m pip install gcovr @@ -461,7 +461,7 @@ jobs: verbose: true - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + if: needs.setup_release.outputs.publish_release == 'true' uses: LizardByte/create-release-action@v2025.102.13208 with: allowUpdates: true @@ -473,7 +473,8 @@ jobs: token: ${{ secrets.GH_BOT_TOKEN }} build_homebrew: - needs: [setup_release] + name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) + needs: setup_release strategy: fail-fast: false # false to test all, true to fail entire job if any fail matrix: @@ -489,9 +490,7 @@ jobs: - os_version: "latest" # this job will only configure the formula for release, no validation os_name: "ubuntu" release: true - name: Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) runs-on: ${{ matrix.os_name }}-${{ matrix.os_version }} - steps: - name: Checkout uses: actions/checkout@v4 @@ -579,16 +578,15 @@ jobs: cat ./homebrew/sunshine.rb - name: Upload Artifacts - if: ${{ matrix.release }} + if: matrix.release uses: actions/upload-artifact@v4 with: name: sunshine-homebrew path: homebrew/ + if-no-files-found: error - name: Setup Xvfb - if: | - matrix.release != true && - runner.os == 'Linux' + if: matrix.release != true && runner.os == 'Linux' run: | sudo apt-get update -y sudo apt-get install -y \ @@ -601,8 +599,7 @@ jobs: - name: Validate Homebrew Formula id: test - if: | - matrix.release != true + if: matrix.release != true uses: LizardByte/homebrew-release-action@v2024.1115.14934 with: formula_file: ${{ github.workspace }}/homebrew/sunshine.rb @@ -613,6 +610,7 @@ jobs: validate: true - name: Generate gcov report + id: test_report # any except canceled or skipped # TODO: fix coverage, no .gcno files are being created # TODO: .gcno files are supposed to be created next to .o files @@ -621,7 +619,6 @@ jobs: # always() && # matrix.release != true && # (steps.test.outcome == 'success' || steps.test.outcome == 'failure') - id: test_report run: | # if linux if [ "${{ runner.os }}" == "Linux" ]; then @@ -680,8 +677,7 @@ jobs: - name: Patch homebrew formula # create beta version of the formula # don't run this on macOS, as the sed command fails - if: >- - matrix.release + if: matrix.release run: | # variables formula_file="homebrew/sunshine-beta.rb" @@ -713,9 +709,8 @@ jobs: build_win: name: Windows + needs: setup_release runs-on: windows-2019 - needs: [setup_release] - steps: - name: Checkout uses: actions/checkout@v4 @@ -931,9 +926,9 @@ jobs: ./test_sunshine.exe --gtest_color=yes - name: Generate gcov report + id: test_report # any except canceled or skipped if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') - id: test_report shell: msys2 {0} working-directory: build run: | @@ -979,9 +974,10 @@ jobs: with: name: sunshine-windows path: artifacts/ + if-no-files-found: error - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + if: needs.setup_release.outputs.publish_release == 'true' uses: LizardByte/create-release-action@v2025.102.13208 with: allowUpdates: true diff --git a/.github/workflows/ci-copr.yml b/.github/workflows/ci-copr.yml index 7820d756..d30e4d41 100644 --- a/.github/workflows/ci-copr.yml +++ b/.github/workflows/ci-copr.yml @@ -1,5 +1,7 @@ --- name: CI Copr +permissions: + contents: read on: pull_request: diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index e66a3377..a058d646 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -1,5 +1,5 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. @@ -19,13 +19,20 @@ # GitHub runner. name: CI Docker +permissions: + contents: read on: pull_request: - branches: [master] - types: [opened, synchronize, reopened] + branches: + - master + types: + - opened + - synchronize + - reopened push: - branches: [master] + branches: + - master workflow_dispatch: concurrency: @@ -97,10 +104,9 @@ jobs: solution: ${{ steps.find_dotnet.outputs.solution }} setup_release: - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} name: Setup Release - needs: - - check_dockerfiles + if: needs.check_dockerfiles.outputs.dockerfiles + needs: check_dockerfiles outputs: publish_release: ${{ steps.setup_release.outputs.publish_release }} release_body: ${{ steps.setup_release.outputs.release_body }} @@ -121,17 +127,18 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} docker: - needs: [check_dockerfiles, setup_release] - if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} - runs-on: ubuntu-22.04 + name: Docker${{ matrix.tag }} + if: needs.check_dockerfiles.outputs.dockerfiles + needs: + - check_dockerfiles + - setup_release permissions: packages: write contents: write + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: ${{ fromJson(needs.check_dockerfiles.outputs.matrix) }} - name: Docker${{ matrix.tag }} - steps: - name: Maximize build space uses: easimon/maximize-build-space@v10 @@ -256,14 +263,14 @@ jobs: Docker-buildx${{ matrix.tag }}- - name: Log in to Docker Hub - if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets + if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Log in to the Container registry - if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets + if: needs.setup_release.outputs.publish_release == 'true' # PRs do not have access to secrets uses: docker/login-action@v3 with: registry: ghcr.io @@ -271,7 +278,7 @@ jobs: password: ${{ secrets.GH_BOT_TOKEN }} - name: Build artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} + if: steps.prepare.outputs.artifacts == 'true' id: build_artifacts uses: docker/build-push-action@v6 with: @@ -314,7 +321,7 @@ jobs: no-cache-filters: ${{ steps.prepare.outputs.no_cache_filters }} - name: Arrange Artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} + if: steps.prepare.outputs.artifacts == 'true' working-directory: artifacts run: | # debug directory @@ -336,14 +343,17 @@ jobs: rm -f ./provenance.json - name: Upload Artifacts - if: ${{ steps.prepare.outputs.artifacts == 'true' }} + if: steps.prepare.outputs.artifacts == 'true' uses: actions/upload-artifact@v4 with: name: Docker${{ matrix.tag }} path: artifacts/ + if-no-files-found: error - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} + if: > + needs.setup_release.outputs.publish_release == 'true' && + steps.prepare.outputs.artifacts == 'true' uses: LizardByte/create-release-action@v2025.102.13208 with: allowUpdates: true @@ -356,7 +366,9 @@ jobs: token: ${{ secrets.GH_BOT_TOKEN }} - name: Update Docker Hub Description - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + if: > + github.event_name == 'push' && + github.ref == 'refs/heads/master' uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4fd5fa25..c9949dd3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,17 +1,21 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. # This workflow will analyze all supported languages in the repository using CodeQL Analysis. name: "CodeQL" +permissions: + contents: read on: push: - branches: ["master"] + branches: + - master pull_request: - branches: ["master"] + branches: + - master schedule: - cron: '00 12 * * 0' # every Sunday at 12:00 UTC @@ -22,14 +26,17 @@ concurrency: jobs: languages: name: Get language matrix - runs-on: ubuntu-latest outputs: matrix: ${{ steps.lang.outputs.result }} continue: ${{ steps.continue.outputs.result }} + runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Get repo languages - uses: actions/github-script@v7 id: lang + uses: actions/github-script@v7 with: script: | // CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] @@ -54,6 +61,22 @@ jobs: // Track languages we've already added to avoid duplicates const addedLanguages = new Set() + // Check if workflow files exist to determine if we should add actions language + const fs = require('fs'); + const hasYmlFiles = fs.existsSync('.github/workflows') && + fs.readdirSync('.github/workflows').some(file => file.endsWith('.yml') || file.endsWith('.yaml')); + + // Add actions language if workflow files exist + if (hasYmlFiles) { + console.log('Found GitHub Actions workflow files. Adding actions to the matrix.'); + matrix['include'].push({ + "category": "/language:actions", + "language": "actions", + "name": "actions", + "os": "ubuntu-latest" + }); + } + for (let [key, value] of Object.entries(response.data)) { // remap language if (remap_languages[key.toLowerCase()]) { @@ -78,11 +101,18 @@ jobs: // set name for matrix let name = osList.length === 1 ? normalizedKey : `${normalizedKey}, ${os}` + // set category for matrix + let category = `/language:${normalizedKey}` + if (normalizedKey === 'cpp') { + category = `/language:cpp-${os.split('-')[0]}` + } + // add to matrix matrix['include'].push({ + "category": category, "language": normalizedKey, - "os": os, - "name": name + "name": name, + "os": os }) } } @@ -94,8 +124,8 @@ jobs: return matrix - name: Continue - uses: actions/github-script@v7 id: continue + uses: actions/github-script@v7 with: script: | // if matrix['include'] is an empty list return false, otherwise true @@ -109,24 +139,22 @@ jobs: analyze: name: Analyze (${{ matrix.name }}) - if: ${{ needs.languages.outputs.continue == 'true' }} + if: needs.languages.outputs.continue == 'true' defaults: run: shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} env: GITHUB_CODEQL_BUILD: true - needs: [languages] - runs-on: ${{ matrix.os || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + needs: languages permissions: actions: read contents: read security-events: write - + runs-on: ${{ matrix.os || 'ubuntu-latest' }} strategy: fail-fast: false matrix: ${{ fromJson(needs.languages.outputs.matrix) }} - + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} steps: - name: Maximize build space if: >- @@ -174,8 +202,7 @@ jobs: - third-party # Pre autobuild - # create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository - # create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository + # create a file named .codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh in the root of your repository - name: Prebuild id: prebuild run: | @@ -194,7 +221,7 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: - category: "/language:${{matrix.language}}" + category: "${{ matrix.category }}" output: sarif-results upload: failure-only @@ -211,6 +238,7 @@ jobs: - name: Upload SARIF uses: github/codeql-action/upload-sarif@v3 with: + category: "${{ matrix.category }}" sarif_file: sarif-results/${{ matrix.language }}.sarif - name: Upload loc as a Build Artifact @@ -218,4 +246,5 @@ jobs: with: name: sarif-results-${{ matrix.language }}-${{ runner.os }} path: sarif-results + if-no-files-found: error retention-days: 1 diff --git a/.github/workflows/common-lint.yml b/.github/workflows/common-lint.yml index 10692ad9..524be6ff 100644 --- a/.github/workflows/common-lint.yml +++ b/.github/workflows/common-lint.yml @@ -1,16 +1,22 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. # Common linting. name: common lint +permissions: + contents: read on: pull_request: - branches: [master] - types: [opened, synchronize, reopened] + branches: + - master + types: + - opened + - synchronize + - reopened concurrency: group: "${{ github.workflow }}-${{ github.ref }}" @@ -77,9 +83,10 @@ jobs: - name: C++ - Clang format lint if: always() && steps.cpp_files.outputs.found_files - uses: DoozyX/clang-format-lint-action@v0.18 + uses: DoozyX/clang-format-lint-action@v0.20 with: source: ${{ steps.cpp_files.outputs.found_files }} + clangFormatVersion: '20' extensions: 'c,cpp,h,hpp,m,mm' style: file inplace: false @@ -263,5 +270,4 @@ jobs: - name: YAML - log if: always() && steps.yamllint.outcome == 'failure' - run: | - cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY + run: cat "${{ steps.yamllint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index aec6006c..5bd4e881 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -1,17 +1,22 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. # Label and un-label actions using `../label-actions.yml`. name: Issues +permissions: {} on: issues: - types: [labeled, unlabeled] + types: + - labeled + - unlabeled discussion: - types: [labeled, unlabeled] + types: + - labeled + - unlabeled jobs: label: diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index f31a3aa5..476f2f2c 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -1,10 +1,13 @@ --- name: localize +permissions: + contents: read on: push: - branches: [master] - paths: # prevents workflow from running unless these files change + branches: + - master + paths: - '.github/workflows/localize.yml' - 'src/**' - 'locale/sunshine.po' @@ -54,7 +57,7 @@ jobs: python ./scripts/_locale.py --extract - name: git diff - if: ${{ env.new_file == 'false' }} + if: env.new_file == 'false' run: | # disable the pager git config --global pager.diff false @@ -68,7 +71,9 @@ jobs: - name: git reset # only run if a single line changed (date/time) and file already existed - if: ${{ env.git_diff == '1 1 locale/sunshine.po' && env.new_file == 'false' }} + if: >- + env.git_diff == '1 1 locale/sunshine.po' && + env.new_file == 'false' run: | git reset --hard diff --git a/.github/workflows/release-notifier-moonlight.yml b/.github/workflows/release-notifier-moonlight.yml index 3cf18a37..1e1f6cf4 100644 --- a/.github/workflows/release-notifier-moonlight.yml +++ b/.github/workflows/release-notifier-moonlight.yml @@ -1,5 +1,6 @@ --- name: Release Notifications (Moonlight) +permissions: {} on: release: @@ -8,13 +9,23 @@ on: jobs: discord: - if: >- - startsWith(github.repository, 'LizardByte/') && - !github.event.release.prerelease && - !github.event.release.draft + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: + - name: Check if latest GitHub release + id: check-release + uses: actions/github-script@v7 + with: + script: | + const latestRelease = await github.rest.repos.getLatestRelease({ + owner: context.repo.owner, + repo: context.repo.repo + }); + + core.setOutput('isLatestRelease', latestRelease.data.tag_name === context.payload.release.tag_name); + - name: discord + if: steps.check-release.outputs.isLatestRelease == 'true' uses: sarisia/actions-status-discord@v1 with: avatar_url: ${{ vars.ORG_LOGO_URL }}256 diff --git a/.github/workflows/release-notifier.yml b/.github/workflows/release-notifier.yml index 71ac344e..d724abf3 100644 --- a/.github/workflows/release-notifier.yml +++ b/.github/workflows/release-notifier.yml @@ -1,11 +1,13 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. # Create a blog post for a new release and open a PR to the blog repo name: Release Notifications +permissions: + contents: read on: release: @@ -14,8 +16,8 @@ on: jobs: update-blog: - if: >- - github.repository_owner == 'LizardByte' + name: Update blog + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: - name: Check topics @@ -41,8 +43,7 @@ jobs: - name: Check if latest GitHub release id: check-release - if: >- - steps.check-label.outputs.hasTopic == 'true' + if: steps.check-label.outputs.hasTopic == 'true' uses: actions/github-script@v7 with: script: | @@ -128,9 +129,7 @@ jobs: steps.check-label.outputs.hasTopic == 'true' && steps.check-release.outputs.isLatestRelease == 'true' run: | - gh \ - pr \ - merge \ + gh pr merge \ --auto \ --delete-branch \ --repo "LizardByte/LizardByte.github.io" \ diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml index 3c095fcf..394a2432 100644 --- a/.github/workflows/update-changelog.yml +++ b/.github/workflows/update-changelog.yml @@ -1,15 +1,20 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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 +permissions: + contents: read on: release: - types: [created, edited, deleted] + types: + - created + - edited + - deleted workflow_dispatch: concurrency: @@ -18,6 +23,7 @@ concurrency: jobs: update-changelog: + name: Update Changelog if: >- github.event_name == 'workflow_dispatch' || (!github.event.release.prerelease && !github.event.release.draft) diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml index ba84de86..04e1e903 100644 --- a/.github/workflows/update-docs.yml +++ b/.github/workflows/update-docs.yml @@ -1,19 +1,23 @@ --- -# This action is centrally managed in https://github.com//.github/ +# This workflow is centrally managed in https://github.com//.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. -# Use the `rtd` repository label to identify repositories that should trigger have this workflow. +# To use, add the `rtd` repository label to identify repositories that should trigger this workflow. # If the project slug is not the repository name, add a repository variable named `READTHEDOCS_SLUG` with the value of # the ReadTheDocs project slug. # Update readthedocs on release events. name: Update docs +permissions: {} on: release: - types: [created, edited, deleted] + types: + - created + - edited + - deleted concurrency: group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" @@ -73,8 +77,7 @@ jobs: - name: Update RTD project # changing the default branch in readthedocs makes "latest" point to that branch/tag # we can also update other properties like description, etc. - if: >- - steps.check.outputs.isLatestRelease == 'true' + if: steps.check.outputs.isLatestRelease == 'true' run: | json_body=$(jq -n \ --arg default_branch "${TAG}" \ diff --git a/.github/workflows/update-flathub-repo.yml b/.github/workflows/update-flathub-repo.yml index effbc07b..524a8a41 100644 --- a/.github/workflows/update-flathub-repo.yml +++ b/.github/workflows/update-flathub-repo.yml @@ -1,11 +1,15 @@ --- -# This action is a candidate to centrally manage in https://github.com//.github/ -# If more Flathub applications are developed, consider moving this action to the organization's .github repository, -# using the `flathub-pkg` repository label to identify repositories that should trigger this workflow. +# This workflow is centrally managed in https://github.com//.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. + +# To use, add the `flathub-pkg` repository label to identify repositories that should trigger this workflow. # Update Flathub on release events. name: Update flathub repo +permissions: + contents: read on: release: @@ -20,14 +24,13 @@ jobs: update-flathub-repo: env: FLATHUB_PKG: dev.lizardbyte.app.${{ github.event.repository.name }} - if: >- - github.repository_owner == 'LizardByte' + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: - name: Check if flathub repo + id: check-label env: TOPIC: flathub-pkg - id: check-label uses: actions/github-script@v7 with: script: | @@ -47,8 +50,7 @@ jobs: - name: Check if latest GitHub release id: check-release - if: >- - steps.check-label.outputs.hasTopic == 'true' + if: steps.check-label.outputs.hasTopic == 'true' uses: actions/github-script@v7 with: script: | @@ -196,9 +198,7 @@ jobs: steps.check-release.outputs.isLatestRelease == 'true' && fromJson(steps.download.outputs.downloaded_files)[0] run: | - gh \ - pr \ - merge \ + gh pr merge \ --auto \ --delete-branch \ --repo "flathub/${{ env.FLATHUB_PKG }}" \ diff --git a/.github/workflows/update-homebrew-release.yml b/.github/workflows/update-homebrew-release.yml index 068e3d55..cc442e8d 100644 --- a/.github/workflows/update-homebrew-release.yml +++ b/.github/workflows/update-homebrew-release.yml @@ -1,15 +1,20 @@ --- -# This action is a candidate to centrally manage in https://github.com//.github/ -# If more Homebrew applications are developed, consider moving this action to the organization's .github repository, -# using the `homebrew-pkg` repository label to identify repositories that should trigger this workflow. +# This workflow is centrally managed in https://github.com//.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. + +# To use, add the `homebrew-pkg` repository label to identify repositories that should trigger this workflow. # Update Homebrew on release events. name: Update Homebrew release +permissions: + contents: read on: release: - types: [released] + types: + - released concurrency: group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" @@ -17,14 +22,13 @@ concurrency: jobs: update-homebrew-release: - if: >- - github.repository_owner == 'LizardByte' + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: - name: Check if Homebrew repo + id: check-label env: TOPIC: homebrew-pkg - id: check-label uses: actions/github-script@v7 with: script: | @@ -44,8 +48,7 @@ jobs: - name: Download release asset id: download - if: >- - steps.check-label.outputs.hasTopic == 'true' + if: steps.check-label.outputs.hasTopic == 'true' uses: robinraju/release-downloader@v1.12 with: repository: "${{ github.repository }}" diff --git a/.github/workflows/update-pacman-repo.yml b/.github/workflows/update-pacman-repo.yml index 0307b285..a0fd8183 100644 --- a/.github/workflows/update-pacman-repo.yml +++ b/.github/workflows/update-pacman-repo.yml @@ -1,15 +1,20 @@ --- -# This action is a candidate to centrally manage in https://github.com//.github/ -# If more pacman packages are developed, consider moving this action to the organization's .github repository, -# using the `pacman-pkg` repository label to identify repositories that should trigger have this workflow. +# This workflow is centrally managed in https://github.com//.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. + +# To use, add the `pacman-pkg` repository label to identify repositories that should trigger this workflow. # Update pacman repo on release events. name: Update pacman repo +permissions: + contents: read on: release: - types: [released] + types: + - released concurrency: group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" @@ -17,14 +22,13 @@ concurrency: jobs: update-homebrew-release: - if: >- - github.repository_owner == 'LizardByte' + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: - name: Check if pacman repo + id: check-label env: TOPIC: pacman-pkg - id: check-label uses: actions/github-script@v7 with: script: | @@ -123,9 +127,7 @@ jobs: steps.check-release.outputs.isLatestRelease == 'true' && fromJson(steps.download.outputs.downloaded_files)[0] run: | - gh \ - pr \ - merge \ + gh pr merge \ --auto \ --delete-branch \ --squash \ diff --git a/.github/workflows/update-pages.yml b/.github/workflows/update-pages.yml index 3c3219b3..06b1532f 100644 --- a/.github/workflows/update-pages.yml +++ b/.github/workflows/update-pages.yml @@ -1,5 +1,7 @@ --- name: Build GH-Pages +permissions: + contents: read on: pull_request: @@ -37,11 +39,11 @@ jobs: call-jekyll-build: needs: prep uses: LizardByte/LizardByte.github.io/.github/workflows/jekyll-build.yml@master - with: - site_artifact: 'prep' - target_branch: 'gh-pages' - clean_gh_pages: true secrets: GH_BOT_EMAIL: ${{ secrets.GH_BOT_EMAIL }} GH_BOT_NAME: ${{ secrets.GH_BOT_NAME }} GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} + with: + clean_gh_pages: true + site_artifact: 'prep' + target_branch: 'gh-pages' diff --git a/.github/workflows/update-winget-release.yml b/.github/workflows/update-winget-release.yml index 03b600a3..860f086f 100644 --- a/.github/workflows/update-winget-release.yml +++ b/.github/workflows/update-winget-release.yml @@ -1,15 +1,20 @@ --- -# This action is a candidate to centrally manage in https://github.com//.github/ -# If more Winget applications are developed, consider moving this action to the organization's .github repository, -# using the `winget-pkg` repository label to identify repositories that should trigger this workflow. +# This workflow is centrally managed in https://github.com//.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. + +# To use, add the `winget-pkg` repository label to identify repositories that should trigger this workflow. # Update Winget on release events. name: Update Winget release +permissions: + contents: read on: release: - types: [released] + types: + - released concurrency: group: "${{ github.workflow }}-${{ github.event.release.tag_name }}" @@ -17,14 +22,13 @@ concurrency: jobs: update-winget-release: - if: >- - github.repository_owner == 'LizardByte' + if: github.repository_owner == 'LizardByte' runs-on: ubuntu-latest steps: - name: Check if Winget repo + id: check-label env: TOPIC: winget-pkg - id: check-label uses: actions/github-script@v7 with: script: | @@ -44,8 +48,7 @@ jobs: - name: Download release asset id: download - if: >- - steps.check-label.outputs.hasTopic == 'true' + if: steps.check-label.outputs.hasTopic == 'true' uses: robinraju/release-downloader@v1.12 with: repository: "${{ github.repository }}" diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 7cfbae48..b2c50014 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1,2 +1,2 @@ Babel==2.17.0 -clang-format +clang-format==20.* diff --git a/src/config.cpp b/src/config.cpp index 693f4f92..167b244a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -414,12 +414,7 @@ namespace config { auto final_resolution = entry.template get_optional("final_resolution"s); auto final_refresh_rate = entry.template get_optional("final_refresh_rate"s); - output_field.push_back(video_t::dd_t::mode_remapping_entry_t { - requested_resolution.value_or(""), - requested_fps.value_or(""), - final_resolution.value_or(""), - final_refresh_rate.value_or("") - }); + output_field.push_back(video_t::dd_t::mode_remapping_entry_t {requested_resolution.value_or(""), requested_fps.value_or(""), final_resolution.value_or(""), final_refresh_rate.value_or("")}); } }}; diff --git a/src/network.cpp b/src/network.cpp index 338afca5..fedee2b8 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -186,7 +186,7 @@ namespace net { std::uint16_t map_port(int port) { // calculate the port from the config port - auto mapped_port = (std::uint16_t)((int) config::sunshine.port + port); + auto mapped_port = (std::uint16_t) ((int) config::sunshine.port + port); // Ensure port is in the range of 1024-65535 if (mapped_port < 1024 || mapped_port > 65535) { diff --git a/src/platform/linux/graphics.cpp b/src/platform/linux/graphics.cpp index 568067f3..245addb6 100644 --- a/src/platform/linux/graphics.cpp +++ b/src/platform/linux/graphics.cpp @@ -19,7 +19,7 @@ extern "C" { // There aren't that many DRM_FORMAT I need to use, so define them here // // They aren't likely to change any time soon. -#define fourcc_code(a, b, c, d) ((std::uint32_t)(a) | ((std::uint32_t)(b) << 8) | ((std::uint32_t)(c) << 16) | ((std::uint32_t)(d) << 24)) +#define fourcc_code(a, b, c, d) ((std::uint32_t) (a) | ((std::uint32_t) (b) << 8) | ((std::uint32_t) (c) << 16) | ((std::uint32_t) (d) << 24)) #define fourcc_mod_code(vendor, val) ((((uint64_t) vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) #define DRM_FORMAT_MOD_INVALID fourcc_mod_code(0, ((1ULL << 56) - 1)) diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index bf85af4f..7a8b0705 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -219,7 +219,7 @@ namespace platf::dxgi { { util::buffer_t cursor_img = img_data; std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) { - auto alpha = (std::uint8_t)((pixel >> 24) & 0xFF); + auto alpha = (std::uint8_t) ((pixel >> 24) & 0xFF); if (alpha == 0xFF) { // Pixels with 0xFF alpha will be XOR-blended as is. } else if (alpha == 0x00) { @@ -286,7 +286,7 @@ namespace platf::dxgi { { util::buffer_t cursor_img = img_data; std::for_each((std::uint32_t *) std::begin(cursor_img), (std::uint32_t *) std::end(cursor_img), [](auto &pixel) { - auto alpha = (std::uint8_t)((pixel >> 24) & 0xFF); + auto alpha = (std::uint8_t) ((pixel >> 24) & 0xFF); if (alpha == 0xFF) { // Pixels with 0xFF alpha will be XOR-blended by make_cursor_xor_image(). // We make them transparent for the alpha-blended cursor image. diff --git a/src/platform/windows/input.cpp b/src/platform/windows/input.cpp index 53591bd7..50f8aab8 100644 --- a/src/platform/windows/input.cpp +++ b/src/platform/windows/input.cpp @@ -92,10 +92,10 @@ namespace platf { constexpr float EARTH_G = 9.80665f; -#define MPS2_TO_DS4_ACCEL(x) (int32_t)(((x) / EARTH_G) * 8192) -#define DPS_TO_DS4_GYRO(x) (int32_t)((x) * (1024 / 64)) +#define MPS2_TO_DS4_ACCEL(x) (int32_t) (((x) / EARTH_G) * 8192) +#define DPS_TO_DS4_GYRO(x) (int32_t) ((x) * (1024 / 64)) -#define APPLY_CALIBRATION(val, bias, scale) (int32_t)(((float) (val) + (bias)) / (scale)) +#define APPLY_CALIBRATION(val, bias, scale) (int32_t) (((float) (val) + (bias)) / (scale)) constexpr DS4_TOUCH ds4_touch_unused = { .bPacketCounter = 0, diff --git a/src/rtsp.cpp b/src/rtsp.cpp index 81627d9c..d6f6fbbb 100644 --- a/src/rtsp.cpp +++ b/src/rtsp.cpp @@ -112,7 +112,7 @@ namespace rtsp_stream { boost::asio::async_read(sock, boost::asio::buffer(begin, sizeof(encrypted_rtsp_header_t)), boost::bind(&socket_t::handle_read_encrypted_header, shared_from_this(), boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } else { sock.async_read_some( - boost::asio::buffer(begin, (std::size_t)(std::end(msg_buf) - begin)), + boost::asio::buffer(begin, (std::size_t) (std::end(msg_buf) - begin)), boost::bind( &socket_t::handle_read_plaintext, shared_from_this(), @@ -253,7 +253,7 @@ namespace rtsp_stream { } sock.async_read_some( - boost::asio::buffer(begin, (std::size_t)(std::end(msg_buf) - begin)), + boost::asio::buffer(begin, (std::size_t) (std::end(msg_buf) - begin)), boost::bind( &socket_t::handle_plaintext_payload, shared_from_this(), @@ -289,7 +289,7 @@ namespace rtsp_stream { auto end = socket->begin + bytes; msg_t req {new msg_t::element_type {}}; - if (auto status = parseRtspMessage(req.get(), socket->msg_buf.data(), (std::size_t)(end - socket->msg_buf.data()))) { + if (auto status = parseRtspMessage(req.get(), socket->msg_buf.data(), (std::size_t) (end - socket->msg_buf.data()))) { BOOST_LOG(error) << "Malformed RTSP message: ["sv << status << ']'; respond(socket->sock, *socket->session, nullptr, 400, "BAD REQUEST", 0, {}); @@ -321,7 +321,7 @@ namespace rtsp_stream { if (end - socket->crlf >= content_length) { if (end - socket->crlf > content_length) { - BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t)(end - socket->crlf) << " > "sv << content_length; + BOOST_LOG(warning) << "(end - socket->crlf) > content_length -- "sv << (std::size_t) (end - socket->crlf) << " > "sv << content_length; } fg.disable(); diff --git a/src/utility.h b/src/utility.h index 9721a1a2..db5d7f9d 100644 --- a/src/utility.h +++ b/src/utility.h @@ -375,7 +375,7 @@ namespace util { return (std::uint8_t) ch - '0'; } - return (std::uint8_t)(ch | (char) 32) - 'a' + (char) 10; + return (std::uint8_t) (ch | (char) 32) - 'a' + (char) 10; }; std::fill_n(buf + buf_size, padding, 0); @@ -429,7 +429,7 @@ namespace util { return (std::uint8_t) ch - '0'; } - return (std::uint8_t)(ch | (char) 32) - 'a' + (char) 10; + return (std::uint8_t) (ch | (char) 32) - 'a' + (char) 10; }; for (auto &el : buf) { @@ -483,12 +483,12 @@ namespace util { std::int64_t res {}; std::int64_t mul = 1; while (begin != --end) { - res += (std::int64_t)(*end - '0') * mul; + res += (std::int64_t) (*end - '0') * mul; mul *= 10; } - return *begin != '-' ? res + (std::int64_t)(*begin - '0') * mul : -res; + return *begin != '-' ? res + (std::int64_t) (*begin - '0') * mul : -res; } inline std::int64_t from_view(const std::string_view &number) { @@ -955,7 +955,7 @@ namespace util { template std::string_view view(It begin, It end) { - return std::string_view {(const char *) begin, (std::size_t)(end - begin)}; + return std::string_view {(const char *) begin, (std::size_t) (end - begin)}; } template From c6f36474ba9b492eea2a60930ca7304ea96176af Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 25 Apr 2025 21:01:37 -0400 Subject: [PATCH 08/22] ci(release): increase permission for job and bump actions (#3816) --- .github/workflows/CI.yml | 12 +++++++----- .github/workflows/ci-docker.yml | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0636112f..a202d01a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,6 +40,8 @@ jobs: release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }} release_tag: ${{ steps.setup_release.outputs.release_tag }} release_version: ${{ steps.setup_release.outputs.release_version }} + permissions: + contents: write # read does not work to check squash and merge details runs-on: ubuntu-latest steps: - name: Checkout @@ -47,7 +49,7 @@ jobs: - name: Setup Release id: setup_release - uses: LizardByte/setup-release-action@v2025.102.14715 + uses: LizardByte/setup-release-action@v2025.426.225 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -249,7 +251,7 @@ jobs: - name: Create/Update GitHub Release if: needs.setup_release.outputs.publish_release == 'true' - uses: LizardByte/create-release-action@v2025.102.13208 + uses: LizardByte/create-release-action@v2025.426.1549 with: allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} @@ -462,7 +464,7 @@ jobs: - name: Create/Update GitHub Release if: needs.setup_release.outputs.publish_release == 'true' - uses: LizardByte/create-release-action@v2025.102.13208 + uses: LizardByte/create-release-action@v2025.426.1549 with: allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} @@ -663,7 +665,7 @@ jobs: if: >- matrix.release && needs.setup_release.outputs.publish_release == 'true' - uses: LizardByte/create-release-action@v2025.102.13208 + uses: LizardByte/create-release-action@v2025.426.1549 with: allowUpdates: true artifacts: '${{ github.workspace }}/homebrew/*' @@ -978,7 +980,7 @@ jobs: - name: Create/Update GitHub Release if: needs.setup_release.outputs.publish_release == 'true' - uses: LizardByte/create-release-action@v2025.102.13208 + uses: LizardByte/create-release-action@v2025.426.1549 with: allowUpdates: true body: ${{ needs.setup_release.outputs.release_body }} diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index a058d646..d307d369 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -114,6 +114,8 @@ jobs: release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }} release_tag: ${{ steps.setup_release.outputs.release_tag }} release_version: ${{ steps.setup_release.outputs.release_version }} + permissions: + contents: write # read does not work to check squash and merge details runs-on: ubuntu-latest steps: - name: Checkout @@ -121,7 +123,7 @@ jobs: - name: Setup Release id: setup_release - uses: LizardByte/setup-release-action@v2025.102.14715 + uses: LizardByte/setup-release-action@v2025.426.225 with: dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }} github_token: ${{ secrets.GITHUB_TOKEN }} @@ -354,7 +356,7 @@ jobs: if: > needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' - uses: LizardByte/create-release-action@v2025.102.13208 + uses: LizardByte/create-release-action@v2025.426.1549 with: allowUpdates: true artifacts: "*artifacts/*" From f82923e5c5c8220c8146b153ea006260f5fc4926 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 28 Apr 2025 13:45:12 -0400 Subject: [PATCH 09/22] fix(homebrew): enable system tray for linux (#3819) --- packaging/sunshine.rb | 205 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 199 insertions(+), 6 deletions(-) diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index ecd8ff3e..a61a4295 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -29,6 +29,7 @@ class @PROJECT_NAME@ < Formula depends_on "cmake" => :build depends_on "doxygen" => :build depends_on "graphviz" => :build + depends_on "ninja" => :build depends_on "node" => :build depends_on "pkg-config" => :build depends_on "curl" @@ -38,6 +39,24 @@ class @PROJECT_NAME@ < Formula depends_on "icu4c" => :recommended on_linux do + # the "build" dependencies are for libayatana-appindicator + depends_on "at-spi2-core" => :build + depends_on "cairo" => :build + depends_on "fontconfig" => :build + depends_on "freetype" => :build + depends_on "fribidi" => :build + depends_on "gettext" => :build + depends_on "gobject-introspection" => :build + depends_on "graphite2" => :build + depends_on "gtk+3" => :build + depends_on "harfbuzz" => :build + depends_on "intltool" => :build + depends_on "libepoxy" => :build + depends_on "libxdamage" => :build + depends_on "libxkbcommon" => :build + depends_on "pango" => :build + depends_on "perl" => :build + depends_on "pixman" => :build depends_on "avahi" depends_on "libcap" depends_on "libdrm" @@ -56,6 +75,128 @@ class @PROJECT_NAME@ < Formula depends_on "pulseaudio" depends_on "systemd" depends_on "wayland" + + # resources that do not have brew packages + resource "libayatana-appindicator" do + url "https://github.com/AyatanaIndicators/libayatana-appindicator/archive/refs/tags/0.5.94.tar.gz" + sha256 "884a6bc77994c0b58c961613ca4c4b974dc91aa0f804e70e92f38a542d0d0f90" + end + + resource "libdbusmenu" do + url "https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz" + sha256 "b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a" + + patch 'From 729546c51806a1b3ea6cb6efb7a115b1baa811f1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Mon, 18 Nov 2019 19:58:53 +0100 +Subject: [PATCH 1/1] Fix HAVE_VALGRIND AM_CONDITIONAL + +The AM_CONDITIONAL should also be run with --disable-tests, otherwise +HAVE_VALGRIND is undefined. +--- + configure | 4 ++-- + configure.ac | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index 831a3bb..8913b9b 100644 +--- a/configure ++++ b/configure +@@ -14801,6 +14801,8 @@ else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + have_valgrind=yes ++fi ++ + fi + if test "x$have_valgrind" = "xyes"; then + HAVE_VALGRIND_TRUE= +@@ -14811,8 +14813,6 @@ else + fi + + +-fi +- + + + +diff --git a/configure.ac b/configure.ac +index ace54d1..cbd38a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -120,8 +120,8 @@ PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION + [have_tests=yes] + ) + PKG_CHECK_MODULES(DBUSMENUTESTSVALGRIND, valgrind, have_valgrind=yes, have_valgrind=no) +-AM_CONDITIONAL([HAVE_VALGRIND], [test "x$have_valgrind" = "xyes"]) + ]) ++AM_CONDITIONAL([HAVE_VALGRIND], [test "x$have_valgrind" = "xyes"]) + + AC_SUBST(DBUSMENUTESTS_CFLAGS) + AC_SUBST(DBUSMENUTESTS_LIBS) +-- +2.46.2 + + +' + end + + resource "ayatana-ido" do + url "https://github.com/AyatanaIndicators/ayatana-ido/archive/refs/tags/0.10.4.tar.gz" + sha256 "bd59abd5f1314e411d0d55ce3643e91cef633271f58126be529de5fb71c5ab38" + + patch 'From 8a09e6ad33c58c017c0c8fd756da036fc39428ea Mon Sep 17 00:00:00 2001 +From: Alexander Koskovich +Date: Sun, 29 Sep 2024 13:47:54 -0400 +Subject: [PATCH 1/1] Make introspection configurable + +--- + CMakeLists.txt | 1 + + src/CMakeLists.txt | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0e13fcd..f3e9ec0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,6 +12,7 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + option(ENABLE_TESTS "Enable all tests and checks" OFF) + option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF) + option(ENABLE_WERROR "Treat all build warnings as errors" OFF) ++option(ENABLE_INTROSPECTION "Enable introspection" ON) + + if(ENABLE_COVERAGE) + set(ENABLE_TESTS ON) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 5b3638d..aca9481 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -108,6 +108,8 @@ install(TARGETS "ayatana-ido3-0.4" LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIB + + # AyatanaIdo3-0.4.gir + ++if (ENABLE_INTROSPECTION) ++ + find_package(GObjectIntrospection REQUIRED QUIET) + + if (INTROSPECTION_FOUND) +@@ -183,3 +185,5 @@ if (INTROSPECTION_FOUND) + endif () + + endif () ++ ++endif () +-- +2.46.2 + + +' + end + + resource "libayatana-indicator" do + url "https://github.com/AyatanaIndicators/libayatana-indicator/archive/refs/tags/0.9.4.tar.gz" + sha256 "a18d3c682e29afd77db24366f8475b26bda22b0e16ff569a2ec71cd6eb4eac95" + end end def install @@ -71,7 +212,6 @@ class @PROJECT_NAME@ < Formula -DOPENSSL_ROOT_DIR=#{Formula["openssl"].opt_prefix} -DSUNSHINE_ASSETS_DIR=sunshine/assets -DSUNSHINE_BUILD_HOMEBREW=ON - -DSUNSHINE_ENABLE_TRAY=OFF -DSUNSHINE_PUBLISHER_NAME='LizardByte' -DSUNSHINE_PUBLISHER_WEBSITE='https://app.lizardbyte.dev' -DSUNSHINE_PUBLISHER_ISSUE_URL='https://app.lizardbyte.dev/support' @@ -106,16 +246,69 @@ class @PROJECT_NAME@ < Formula end args << "-DCUDA_FAIL_ON_MISSING=OFF" if OS.linux? + args << "-DSUNSHINE_ENABLE_TRAY=OFF" if OS.mac? - system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args + # Handle system tray on Linux + if OS.linux? + # Build and install libayatana components - cd "build" do - system "make" - system "make", "install" + # Build libdbusmenu + resource("libdbusmenu").stage do + system "./configure", + "--prefix=#{prefix}", + "--with-gtk=3", + "--disable-dumper", + "--disable-static", + "--disable-tests", + "--disable-gtk-doc", + "--enable-introspection=no", + "--disable-vala" + system "make", "install" + end - bin.install "tests/test_sunshine" + # Build ayatana-ido + resource("ayatana-ido").stage do + system "cmake", "-S", ".", "-B", "build", "-G", "Ninja", + "-DCMAKE_INSTALL_PREFIX=#{prefix}", + "-DENABLE_INTROSPECTION=OFF", + *std_cmake_args + system "ninja", "-C", "build" + system "ninja", "-C", "build", "install" + end + + # Build libayatana-indicator + resource("libayatana-indicator").stage do + ENV.append_path "PKG_CONFIG_PATH", "#{lib}/pkgconfig" + ENV.append "LDFLAGS", "-L#{lib}" + + system "cmake", "-S", ".", "-B", "build", "-G", "Ninja", + "-DCMAKE_INSTALL_PREFIX=#{prefix}", + *std_cmake_args + system "ninja", "-C", "build" + system "ninja", "-C", "build", "install" + end + + # Build libayatana-appindicator + resource("libayatana-appindicator").stage do + system "cmake", "-S", ".", "-B", "build", "-G", "Ninja", + "-DCMAKE_INSTALL_PREFIX=#{prefix}", + "-DENABLE_BINDINGS_MONO=OFF", + "-DENABLE_BINDINGS_VALA=OFF", + "-DENABLE_GTKDOC=OFF", + *std_cmake_args + system "ninja", "-C", "build" + system "ninja", "-C", "build", "install" + end end + system "cmake", "-S", ".", "-B", "build", "-G", "Unix Makefiles", + *std_cmake_args, + *args + + system "make", "-C", "build" + system "make", "-C", "build", "install" + bin.install "build/tests/test_sunshine" + # codesign the binary on intel macs system "codesign", "-s", "-", "--force", "--deep", bin/"sunshine" if OS.mac? && Hardware::CPU.intel? From 326592d08c2f78ecd079efc0f3cd00e593dac946 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 28 Apr 2025 15:20:08 -0400 Subject: [PATCH 10/22] ci(flatpak): disable maximize build space for arm64 (#3820) --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a202d01a..22405414 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -71,6 +71,7 @@ jobs: runner: ubuntu-22.04-arm steps: - name: Maximize build space + if: matrix.arch == 'x86_64' uses: easimon/maximize-build-space@v10 with: root-reserve-mb: 10240 From bdf15f527741366b82c15df5f2945c7df26bed09 Mon Sep 17 00:00:00 2001 From: Clutchnp <105556048+Clutchnp@users.noreply.github.com> Date: Tue, 29 Apr 2025 18:54:29 +0530 Subject: [PATCH 11/22] build(linux): add arch linux support for linux_build.sh script (#3814) Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- scripts/linux_build.sh | 72 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-) mode change 100644 => 100755 scripts/linux_build.sh diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh old mode 100644 new mode 100755 index e13ad594..3b541d95 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -90,6 +90,50 @@ shift $((OPTIND -1)) # dependencies array to build out dependencies=() +function add_arch_deps() { + dependencies+=( + 'avahi' + 'base-devel' + 'cmake' + 'curl' + 'git' + 'libayatana-appindicator' + 'libcap' + 'libdrm' + 'libevdev' + 'libmfx' + 'libnotify' + 'libpulse' + 'libva' + 'libx11' + 'libxcb' + 'libxfixes' + 'libxrandr' + 'libxtst' + 'miniupnpc' + 'ninja' + 'nodejs' + 'npm' + 'numactl' + 'openssl' + 'opus' + 'udev' + 'wayland' + ) + + if [ "$skip_libva" == 0 ]; then + dependencies+=( + "libva" # VA-API + ) + fi + + if [ "$skip_cuda" == 0 ]; then + dependencies+=( + "cuda" # VA-API + ) + fi +} + function add_debian_based_deps() { dependencies+=( "bison" # required if we need to compile doxygen @@ -198,9 +242,15 @@ function add_fedora_deps() { } function install_cuda() { + nvcc_path=$(command -v nvcc 2>/dev/null) || true + if [ -n "$nvcc_path" ]; then + echo "found system cuda" + return + fi # check if we need to install cuda if [ -f "${build_dir}/cuda/bin/nvcc" ]; then - echo "cuda already installed" + nvcc_path="${build_dir}/cuda/bin/nvcc" + echo "found local cuda" return fi @@ -237,6 +287,7 @@ function install_cuda() { chmod a+x "${build_dir}/cuda.run" "${build_dir}/cuda.run" --silent --toolkit --toolkitpath="${build_dir}/cuda" --no-opengl-libs --no-man-page --no-drm rm "${build_dir}/cuda.run" + nvcc_path="${build_dir}/cuda/bin/nvcc" } function check_version() { @@ -250,6 +301,8 @@ function check_version() { installed_version=$(dpkg -s "$package_name" 2>/dev/null | grep '^Version:' | awk '{print $2}') elif [ "$distro" == "fedora" ]; then installed_version=$(rpm -q --queryformat '%{VERSION}' "$package_name" 2>/dev/null) + elif [ "$distro" == "arch" ]; then + installed_version=$(pacman -Q "$package_name" | awk '{print $2}' ) else echo "Unsupported Distro" return 1 @@ -303,7 +356,9 @@ function run_install() { # Update the package list $package_update_command - if [ "$distro" == "debian" ]; then + if [ "$distro" == "arch" ]; then + add_arch_deps + elif [ "$distro" == "debian" ]; then add_debian_deps elif [ "$distro" == "ubuntu" ]; then add_ubuntu_deps @@ -393,10 +448,10 @@ function run_install() { fi # run the cuda install - if [ -n "$cuda_version" ] && [ "$skip_cuda" == 0 ]; then + if [ "$skip_cuda" == 0 ]; then install_cuda cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON") - cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=${build_dir}/cuda/bin/nvcc") + cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=$nvcc_path") fi # Cmake stuff here @@ -436,7 +491,14 @@ function run_install() { # Determine the OS and call the appropriate function cat /etc/os-release -if grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then + +if grep -q "Arch Linux" /etc/os-release; then + distro="arch" + version="" + package_update_command="${sudo_cmd} pacman -Syu --noconfirm" + package_install_command="${sudo_cmd} pacman -Sy --needed" + nvm_node=0 +elif grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then distro="debian" version="12" package_update_command="${sudo_cmd} apt-get update" From e807769f6adc74ab9a773291910b6b663930a23d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 12:43:47 -0400 Subject: [PATCH 12/22] build(deps): bump third-party/wayland-protocols from `4313a51` to `810f1ad` (#3826) build(deps): bump third-party/wayland-protocols Bumps [third-party/wayland-protocols](https://github.com/LizardByte-infrastructure/wayland-protocols) from `4313a51` to `810f1ad`. - [Commits](https://github.com/LizardByte-infrastructure/wayland-protocols/compare/4313a51a170efffece8f60f7a5dfdad135e6befa...810f1adaf33521cc55fc510566efba2a1418174f) --- updated-dependencies: - dependency-name: third-party/wayland-protocols dependency-version: 810f1adaf33521cc55fc510566efba2a1418174f dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/wayland-protocols | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/wayland-protocols b/third-party/wayland-protocols index 4313a51a..810f1ada 160000 --- a/third-party/wayland-protocols +++ b/third-party/wayland-protocols @@ -1 +1 @@ -Subproject commit 4313a51a170efffece8f60f7a5dfdad135e6befa +Subproject commit 810f1adaf33521cc55fc510566efba2a1418174f From e9bce254fd1e137b1dcf0b653f7500b3db393f4f Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:29:38 -0400 Subject: [PATCH 13/22] ci(windows): pin gcc to 14 (#3831) --- .codeql-prebuild-cpp-Windows.sh | 25 +++++++++++++- .github/workflows/CI.yml | 59 +++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/.codeql-prebuild-cpp-Windows.sh b/.codeql-prebuild-cpp-Windows.sh index e03f8740..b860c9e8 100644 --- a/.codeql-prebuild-cpp-Windows.sh +++ b/.codeql-prebuild-cpp-Windows.sh @@ -4,6 +4,28 @@ set -e # update pacman pacman --noconfirm -Syu +gcc_version="14.2.0-3" + +broken_deps=( + "mingw-w64-ucrt-x86_64-gcc" + "mingw-w64-ucrt-x86_64-gcc-libs" +) + +tarballs="" +for dep in "${broken_deps[@]}"; do + tarball="${dep}-${gcc_version}-any.pkg.tar.zst" + + # download and install working version + wget https://repo.msys2.org/mingw/ucrt64/${tarball} + + tarballs="${tarballs} ${tarball}" +done + +# install broken dependencies +if [ -n "$tarballs" ]; then + pacman -U --noconfirm ${tarballs} +fi + # install dependencies dependencies=( "git" @@ -20,7 +42,8 @@ dependencies=( "mingw-w64-ucrt-x86_64-opus" "mingw-w64-ucrt-x86_64-toolchain" ) -pacman -S --noconfirm "${dependencies[@]}" + +pacman -Syu --noconfirm --ignore="$(IFS=,; echo "${broken_deps[*]}")" "${dependencies[@]}" # build mkdir -p build diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 22405414..47e472c3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -825,26 +825,59 @@ jobs: Get-Content -Path monitor_list.txt - name: Setup Dependencies Windows + # if a dependency needs to be pinned, see https://github.com/LizardByte/build-deps/pull/186 uses: msys2/setup-msys2@v2 with: msystem: ucrt64 update: true install: >- - git - 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 - mingw-w64-ucrt-x86_64-MinHook - mingw-w64-ucrt-x86_64-miniupnpc - 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 wget + - name: Update Windows dependencies + env: + gcc_version: "14.2.0-3" + shell: msys2 {0} + run: | + broken_deps=( + "mingw-w64-ucrt-x86_64-gcc" + "mingw-w64-ucrt-x86_64-gcc-libs" + ) + + tarballs="" + for dep in "${broken_deps[@]}"; do + tarball="${dep}-${gcc_version}-any.pkg.tar.zst" + + # download and install working version + wget https://repo.msys2.org/mingw/ucrt64/${tarball} + + tarballs="${tarballs} ${tarball}" + done + + # install broken dependencies + if [ -n "$tarballs" ]; then + pacman -U --noconfirm ${tarballs} + fi + + # install dependencies + dependencies=( + "git" + "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" + "mingw-w64-ucrt-x86_64-MinHook" + "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 -Syu --noconfirm --ignore="$(IFS=,; echo "${broken_deps[*]}")" "${dependencies[@]}" + - name: Install Doxygen # GCC compiled doxygen has issues when running graphviz env: From 3de3c299b23f64909bd6b3e42626ec818b0221d6 Mon Sep 17 00:00:00 2001 From: SuperKenVery <39673849+SuperKenVery@users.noreply.github.com> Date: Thu, 1 May 2025 01:33:38 +0800 Subject: [PATCH 14/22] docs(configuration): Update doc for wlr capture method (#3828) --- docs/configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index 315ea7e2..bdd187be 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1947,7 +1947,8 @@ editing the `conf` file in a text editor. Use the examples as reference. wlr - Capture for wlroots based Wayland compositors via DMA-BUF. + Capture for wlroots based Wayland compositors via wlr-screencopy-unstable-v1. It is possible to capture + virtual displays in e.g. Hyprland using this method. @note{Applies to Linux only.} From 7b6818ab4a3f6fd91233f7d64ed744aef652e09d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 12:39:22 +0000 Subject: [PATCH 15/22] build(deps): bump third-party/googletest from `6910c9d` to `04ee1b4` (#3836) Bumps [third-party/googletest](https://github.com/google/googletest) from `6910c9d` to `04ee1b4`. - [Release notes](https://github.com/google/googletest/releases) - [Commits](https://github.com/google/googletest/compare/6910c9d9165801d8827d628cb72eb7ea9dd538c5...04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4) --- updated-dependencies: - dependency-name: third-party/googletest dependency-version: 04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/googletest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/googletest b/third-party/googletest index 6910c9d9..04ee1b4f 160000 --- a/third-party/googletest +++ b/third-party/googletest @@ -1 +1 @@ -Subproject commit 6910c9d9165801d8827d628cb72eb7ea9dd538c5 +Subproject commit 04ee1b4f2aefdffb0135d7cf2a2c519fe50dabe4 From 8ef838bada7f6c361fb1e81d7423644ed442f944 Mon Sep 17 00:00:00 2001 From: Clutchnp <105556048+Clutchnp@users.noreply.github.com> Date: Thu, 1 May 2025 21:09:43 +0530 Subject: [PATCH 16/22] feat(audio): add an option to disable sound streaming (#3833) --- docs/configuration.md | 23 +++++++++++++++++++ src/audio.cpp | 4 ++++ src/config.cpp | 2 ++ src/config.h | 1 + .../assets/web/configs/tabs/AudioVideo.vue | 8 +++++++ .../assets/web/public/assets/locale/en.json | 2 ++ 6 files changed, 40 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index bdd187be..ef248643 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -770,6 +770,29 @@ editing the `conf` file in a text editor. Use the examples as reference. +### stream_audio + + + + + + + + + + + + + + +
Description + Whether to stream audio or not. Disabling this can be useful for streaming headless displays as second monitors. +
Default@code{} + enabled + @endcode
Example@code{} + stream_audio = disabled + @endcode
+ ### install_steam_audio_drivers diff --git a/src/audio.cpp b/src/audio.cpp index f060118d..0d287071 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -129,6 +129,10 @@ namespace audio { void capture(safe::mail_t mail, config_t config, void *channel_data) { auto shutdown_event = mail->event(mail::shutdown); + if (!config::audio.stream) { + shutdown_event->view(); + return; + } auto stream = stream_configs[map_stream(config.channels, config.flags[config_t::HIGH_QUALITY])]; if (config.flags[config_t::CUSTOM_SURROUND_PARAMS]) { apply_surround_params(stream, config.customStreamParams); diff --git a/src/config.cpp b/src/config.cpp index 167b244a..7147fd6c 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -511,6 +511,7 @@ namespace config { audio_t audio { {}, // audio_sink {}, // virtual_sink + true, // stream audio true, // install_steam_drivers }; @@ -1160,6 +1161,7 @@ namespace config { string_f(vars, "audio_sink", audio.sink); string_f(vars, "virtual_sink", audio.virtual_sink); + bool_f(vars, "stream_audio", audio.stream); bool_f(vars, "install_steam_audio_drivers", audio.install_steam_drivers); string_restricted_f(vars, "origin_web_ui_allowed", nvhttp.origin_web_ui_allowed, {"pc"sv, "lan"sv, "wan"sv}); diff --git a/src/config.h b/src/config.h index 474cbb5a..066b95df 100644 --- a/src/config.h +++ b/src/config.h @@ -147,6 +147,7 @@ namespace config { struct audio_t { std::string sink; std::string virtual_sink; + bool stream; bool install_steam_drivers; }; diff --git a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue index 6791a9c6..27f58365 100644 --- a/src_assets/common/assets/web/configs/tabs/AudioVideo.vue +++ b/src_assets/common/assets/web/configs/tabs/AudioVideo.vue @@ -63,6 +63,14 @@ const config = ref(props.config) + + + Date: Sat, 3 May 2025 14:22:13 -0400 Subject: [PATCH 17/22] ci(codecov): add test analytics (#3841) --- .github/workflows/CI.yml | 71 ++++++++++++++++++++++++++++++++-------- packaging/sunshine.rb | 3 +- 2 files changed, 59 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 47e472c3..410d1f8f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -431,12 +431,14 @@ jobs: Xvfb ${DISPLAY} -screen 0 1024x768x24 & sleep 5 # give Xvfb time to start - ./test_sunshine --gtest_color=yes + ./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml - name: Generate gcov report id: test_report # any except canceled or skipped - if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure') + if: >- + always() && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') working-directory: build run: | ${{ steps.python.outputs.python-path }} -m pip install gcovr @@ -448,6 +450,22 @@ jobs: --xml-pretty \ -o coverage.xml + - name: Upload test results to Codecov + # any except canceled or skipped + if: >- + always() && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/test-results-action@v1 + with: + disable_search: true + fail_ci_if_error: true + files: ./build/tests/test_results.xml + flags: ${{ runner.os }} + handle_no_reports_found: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Upload coverage # any except canceled or skipped if: >- @@ -603,7 +621,7 @@ jobs: - name: Validate Homebrew Formula id: test if: matrix.release != true - uses: LizardByte/homebrew-release-action@v2024.1115.14934 + uses: LizardByte/homebrew-release-action@v2025.503.165455 with: formula_file: ${{ github.workspace }}/homebrew/sunshine.rb git_email: ${{ secrets.GH_BOT_EMAIL }} @@ -623,15 +641,7 @@ jobs: # matrix.release != true && # (steps.test.outcome == 'success' || steps.test.outcome == 'failure') run: | - # if linux - if [ "${{ runner.os }}" == "Linux" ]; then - prefix="/tmp" - else - prefix="/private/tmp" - fi - - brew_dir=$(find ${prefix} -type d -name "sunshine-*" -maxdepth 1 2>/dev/null) - cp -rf $brew_dir/build/ ./build/ + cp -rf ${{ steps.test.outputs.buildpath }}/build/ ./build/ cd build ls -Ra @@ -644,6 +654,23 @@ jobs: --xml-pretty \ -o coverage.xml + - name: Upload test results to Codecov + # any except canceled or skipped + if: >- + always() && + matrix.release != true && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/test-results-action@v1 + with: + disable_search: true + fail_ci_if_error: true + files: ${{ steps.test.outputs.testpath }}/test_results.xml + flags: ${{ matrix.os_name }}-${{ matrix.os_version }} (Homebrew) + handle_no_reports_found: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Upload coverage # any except canceled or skipped # TODO: enable this once coverage report is fixed @@ -701,7 +728,7 @@ jobs: github.repository_owner == 'LizardByte' && matrix.release && needs.setup_release.outputs.publish_release == 'true' - uses: LizardByte/homebrew-release-action@v2024.1115.14934 + uses: LizardByte/homebrew-release-action@v2025.503.165455 with: formula_file: ${{ github.workspace }}/homebrew/sunshine-beta.rb git_email: ${{ secrets.GH_BOT_EMAIL }} @@ -959,7 +986,7 @@ jobs: shell: msys2 {0} working-directory: build/tests run: | - ./test_sunshine.exe --gtest_color=yes + ./test_sunshine.exe --gtest_color=yes --gtest_output=xml:test_results.xml - name: Generate gcov report id: test_report @@ -977,6 +1004,22 @@ jobs: --xml-pretty \ -o coverage.xml + - name: Upload test results to Codecov + # any except canceled or skipped + if: >- + always() && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/test-results-action@v1 + with: + disable_search: true + fail_ci_if_error: true + files: ./build/tests/test_results.xml + flags: ${{ runner.os }} + handle_no_reports_found: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + - name: Upload coverage # any except canceled or skipped if: >- diff --git a/packaging/sunshine.rb b/packaging/sunshine.rb index a61a4295..f13a5a38 100644 --- a/packaging/sunshine.rb +++ b/packaging/sunshine.rb @@ -351,6 +351,7 @@ index 5b3638d..aca9481 100644 system bin/"sunshine", "--version" # run the test suite - system bin/"test_sunshine", "--gtest_color=yes" + system bin/"test_sunshine", "--gtest_color=yes", "--gtest_output=xml:test_results.xml" + assert_path_exists testpath/"test_results.xml" end end From 808a862952b69495fe33d63fa47a1833e49f91e5 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 4 May 2025 09:38:34 -0400 Subject: [PATCH 18/22] ci(codecov): add bundle analysis (#3843) --- .github/workflows/CI.yml | 1 + package.json | 1 + vite.config.js | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 410d1f8f..33d0f2c8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -952,6 +952,7 @@ jobs: env: BRANCH: ${{ github.head_ref || github.ref_name }} BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} COMMIT: ${{ needs.setup_release.outputs.release_commit }} run: | mkdir -p build diff --git a/package.json b/package.json index 96fc8fc8..f504e49c 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "vue-i18n": "11.1.3" }, "devDependencies": { + "@codecov/vite-plugin": "1.9.0", "@vitejs/plugin-vue": "4.6.2", "serve": "14.2.3", "vite": "4.5.9", diff --git a/vite.config.js b/vite.config.js index 36397f4f..60bdc2a2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,13 +3,14 @@ import fs from 'fs'; import { resolve } from 'path' import { defineConfig } from 'vite' import { ViteEjsPlugin } from "vite-plugin-ejs"; +import { codecovVitePlugin } from "@codecov/vite-plugin"; import vue from '@vitejs/plugin-vue' import process from 'process' /** * Before actually building the pages with Vite, we do an intermediate build step using ejs - * Importing this separately and joining them using ejs - * allows us to split some repeating HTML that cannot be added + * Importing this separately and joining them using ejs + * allows us to split some repeating HTML that cannot be added * by Vue itself (e.g. style/script loading, common meta head tags, Widgetbot) * The vite-plugin-ejs handles this automatically */ @@ -49,7 +50,16 @@ export default defineConfig({ } }, base: './', - plugins: [vue(), ViteEjsPlugin({ header })], + plugins: [ + vue(), + ViteEjsPlugin({ header }), + // The Codecov vite plugin should be after all other plugins + codecovVitePlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: "sunshine", + uploadToken: process.env.CODECOV_TOKEN, + }), + ], root: resolve(assetsSrcPath), build: { outDir: resolve(assetsDstPath), From 0a942437e29d8c7938d8f07d2319e634fb295b9b Mon Sep 17 00:00:00 2001 From: Vladimir Romashchenko <52473614+eaglesemanation@users.noreply.github.com> Date: Sun, 4 May 2025 22:09:18 -0400 Subject: [PATCH 19/22] feat(docs): Suggest using displayconfig-mutter for Gnome Wayland resolution change (#3845) --- docs/app_examples.md | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/app_examples.md b/docs/app_examples.md index 8e7d8940..782681fd 100644 --- a/docs/app_examples.md +++ b/docs/app_examples.md @@ -213,7 +213,7 @@ xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rot ``` } -###### Wayland +###### Wayland (wlroots, e.g. hyprland) | Prep Step | Command | |-----------|------------------------------------------------------------------------------------------------------------------------------------------| @@ -222,17 +222,30 @@ xrandr --output ${display_output} --primary --mode ${mode_alias} --pos 0x0 --rot @hint{`wlr-xrandr` only works with wlroots-based compositors.} -###### Gnome (Wayland, X11) +###### Gnome (X11) | Prep Step | Command | |-----------|---------------------------------------------------------------------------------------------------------------------------------------| | Do | @code{}sh -c "xrandr --output HDMI-1 --mode ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --rate ${SUNSHINE_CLIENT_FPS}"@endcode | | Undo | @code{}xrandr --output HDMI-1 --mode 3840x2160 --rate 120@endcode | -The commands above are valid for an X11 session but won't work for -Wayland. In that case `xrandr` must be replaced by [gnome-randr.py](https://gitlab.com/Oschowa/gnome-randr). -This script is intended as a drop-in replacement with the same syntax. (It can be saved in -`/usr/local/bin` and needs to be made executable.) +###### Gnome (Wayland) + +| Prep Step | Command | +|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Do | @code{}sh -c "displayconfig-mutter set --connector HDMI-1 --resolution ${SUNSHINE_CLIENT_WIDTH}x${SUNSHINE_CLIENT_HEIGHT} --refresh-rate ${SUNSHINE_CLIENT_FPS} --hdr ${SUNSHINE_CLIENT_HDR}"@endcode | +| Undo | @code{}displayconfig-mutter set --connector HDMI-1 --resolution 3840x2160 --refresh-rate 120 --hdr false@endcode | + +Installation instructions for displayconfig-mutter can be [found here](https://github.com/eaglesemanation/displayconfig-mutter). Alternatives include +[gnome-randr-rust](https://github.com/maxwellainatchi/gnome-randr-rust) and [gnome-randr.py](https://gitlab.com/Oschowa/gnome-randr), but both of those are +unmaintained and do not support newer Mutter features such as HDR and VRR. + +@hint{HDR support has been added to Gnome 48, to check if your display supports it you can run this: +``` +displayconfig-mutter list +``` +If it doesn't, then remove ``--hdr`` flag from both ``Do`` and ``Undo`` steps. +} ###### KDE Plasma (Wayland, X11) From a846ea909a54c0e1dd97b978c7334e3d91b33bf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 12:29:49 +0000 Subject: [PATCH 20/22] build(deps): bump packaging/linux/flatpak/deps/flatpak-builder-tools from `aac65cf` to `bf91cb0` (#3850) build(deps): bump packaging/linux/flatpak/deps/flatpak-builder-tools Bumps [packaging/linux/flatpak/deps/flatpak-builder-tools](https://github.com/flatpak/flatpak-builder-tools) from `aac65cf` to `bf91cb0`. - [Commits](https://github.com/flatpak/flatpak-builder-tools/compare/aac65cf44cd4e008594a9d9ac1db08e2025067a6...bf91cb0bee7ce0c8021e223e3ea9c5110ebb82de) --- updated-dependencies: - dependency-name: packaging/linux/flatpak/deps/flatpak-builder-tools dependency-version: bf91cb0bee7ce0c8021e223e3ea9c5110ebb82de dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packaging/linux/flatpak/deps/flatpak-builder-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/linux/flatpak/deps/flatpak-builder-tools b/packaging/linux/flatpak/deps/flatpak-builder-tools index aac65cf4..bf91cb0b 160000 --- a/packaging/linux/flatpak/deps/flatpak-builder-tools +++ b/packaging/linux/flatpak/deps/flatpak-builder-tools @@ -1 +1 @@ -Subproject commit aac65cf44cd4e008594a9d9ac1db08e2025067a6 +Subproject commit bf91cb0bee7ce0c8021e223e3ea9c5110ebb82de From c435d0fe56aa661fab6c57503787f5bd86f76032 Mon Sep 17 00:00:00 2001 From: Clutchnp <105556048+Clutchnp@users.noreply.github.com> Date: Mon, 5 May 2025 22:36:01 +0530 Subject: [PATCH 21/22] build(linux): fix gcc version and disable docs for build on arch (#3846) --- scripts/linux_build.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 3b541d95..1ac5f162 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -96,6 +96,8 @@ function add_arch_deps() { 'base-devel' 'cmake' 'curl' + "gcc${gcc_version}" + "gcc${gcc_version}-libs" 'git' 'libayatana-appindicator' 'libcap' @@ -293,6 +295,7 @@ function install_cuda() { function check_version() { local package_name=$1 local min_version=$2 + local max_version=$3 local installed_version echo "Checking if $package_name is installed and at least version $min_version" @@ -313,11 +316,12 @@ function check_version() { return 1 fi - if [ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]; then - echo "$package_name version $installed_version is at least $min_version" +if [[ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]] && \ + [[ "$(printf '%s\n' "$installed_version" "$max_version" | sort -V | head -n1)" = "$installed_version" ]]; then + echo "Installed version is within range" return 0 else - echo "$package_name version $installed_version is less than $min_version" + echo "$package_name version $installed_version is out of range" return 1 fi } @@ -382,8 +386,11 @@ function run_install() { "gcc-ranlib" ) - # update alternatives for gcc and g++ if a debian based distro - if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + #set gcc version based on distros + if [ "$distro" == "arch" ]; then + export CC=gcc-14 + export CXX=g++-14 + elif [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then for file in "${gcc_alternative_files[@]}"; do file_path="/etc/alternatives/$file" if [ -e "$file_path" ]; then @@ -402,7 +409,7 @@ function run_install() { # compile cmake if the version is too low cmake_min="3.25.0" target_cmake_version="3.30.1" - if ! check_version "cmake" "$cmake_min"; then + if ! check_version "cmake" "$cmake_min" "inf"; then cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" if [ "$architecture" == "x86_64" ]; then cmake_arch="x86_64" @@ -420,7 +427,8 @@ function run_install() { # compile doxygen if version is too low doxygen_min="1.10.0" _doxygen_min="1_10_0" - if ! check_version "doxygen" "$doxygen_min"; then + doxygen_max="1.12.0" + if ! check_version "doxygen" "$doxygen_min" "$doxygen_max"; then if [ "${SUNSHINE_COMPILE_DOXYGEN}" == "true" ]; then echo "Compiling doxygen" doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz" @@ -432,7 +440,7 @@ function run_install() { ninja -C "build" -j"${num_processors}" ninja -C "build" install else - echo "Doxygen version too low, skipping docs" + echo "Doxygen version not in range, skipping docs" cmake_args+=("-DBUILD_DOCS=OFF") fi fi @@ -498,6 +506,7 @@ if grep -q "Arch Linux" /etc/os-release; then package_update_command="${sudo_cmd} pacman -Syu --noconfirm" package_install_command="${sudo_cmd} pacman -Sy --needed" nvm_node=0 + gcc_version="14" elif grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then distro="debian" version="12" From e81a3f029f8780fd7cc30fe9c2e4110c6c357775 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 08:22:20 -0400 Subject: [PATCH 22/22] build(deps): bump third-party/inputtino from `fd136cf` to `17a9b9c` (#3853) Bumps [third-party/inputtino](https://github.com/games-on-whales/inputtino) from `fd136cf` to `17a9b9c`. - [Commits](https://github.com/games-on-whales/inputtino/compare/fd136cfe492b4375b4507718bcca1f044588fc6f...17a9b9ce85c6b8e711f777146d3c706c1a2a9fd9) --- updated-dependencies: - dependency-name: third-party/inputtino dependency-version: 17a9b9ce85c6b8e711f777146d3c706c1a2a9fd9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third-party/inputtino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/inputtino b/third-party/inputtino index fd136cfe..17a9b9ce 160000 --- a/third-party/inputtino +++ b/third-party/inputtino @@ -1 +1 @@ -Subproject commit fd136cfe492b4375b4507718bcca1f044588fc6f +Subproject commit 17a9b9ce85c6b8e711f777146d3c706c1a2a9fd9