Skip to content

Commit

Permalink
Merge pull request #2216 from LizardByte/nightly
Browse files Browse the repository at this point in the history
v0.22.1
  • Loading branch information
ReenigneArcher committed Mar 14, 2024
2 parents c63637f + c43dd24 commit 00fbbc9
Show file tree
Hide file tree
Showing 41 changed files with 604 additions and 312 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
@@ -0,0 +1,3 @@
# ensure dockerfiles are checked out with LF line endings
Dockerfile text eol=lf
*.dockerfile text eol=lf
180 changes: 86 additions & 94 deletions .github/workflows/CI.yml
Expand Up @@ -505,124 +505,111 @@ jobs:
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}

build_mac:
name: MacOS
runs-on: macos-11
build_mac_brew:
needs: [check_changelog, setup_release]
env:
BOOST_VERSION: 1.83.0
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix:
include:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# while GitHub has larger macOS runners, they are not available for our repos :(
- os_version: "12"
release: true
- os_version: "13"
- os_version: "14"
name: Homebrew (macOS-${{ matrix.os_version }})
runs-on: macos-${{ matrix.os_version }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Dependencies MacOS
- name: Setup Dependencies Homebrew
run: |
# install dependencies using homebrew
brew install cmake curl miniupnpc node openssl opus pkg-config
# fix openssl header not found
# ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl
# by installing boost from source, several headers cannot be found...
# the above commented out link only works if boost is installed from homebrew... does not make sense
ln -sf $(find /usr/local/Cellar -type d -name "openssl" -path "*/openssl@3/*/include" | head -n 1) \
/usr/local/include/openssl
brew install cmake
# fix opus header not found
ln -sf $(find /usr/local/Cellar -type d -name "opus" -path "*/opus/*/include" | head -n 1) \
/usr/local/include/opus
- name: Configure formula
run: |
# variables for formula
branch=${GITHUB_HEAD_REF}
# fix miniupnpc header not found
ln -sf $(find /usr/local/Cellar -type d -name "miniupnpc" -path "*/miniupnpc/*/include" | head -n 1) \
/usr/local/include/miniupnpc
# check the branch variable
if [ -z "$branch" ]
then
echo "This is a PUSH event"
clone_url=${{ github.event.repository.clone_url }}
branch="${{ github.ref_name }}"
else
echo "This is a PR event"
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
branch="${{ github.event.pull_request.head.ref }}"
fi
echo "Branch: ${branch}"
echo "Clone URL: ${clone_url}"
- name: Install Boost
# installing boost from homebrew takes 30 minutes in a GitHub runner
run: |
export BOOST_ROOT=${HOME}/boost-${BOOST_VERSION}
# install boost
wget \
https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}.tar.gz \
--progress=bar:force:noscroll -q --show-progress
tar xf boost-${BOOST_VERSION}.tar.gz
cd boost-${BOOST_VERSION}
# libdir should be set by --prefix but isn't
./bootstrap.sh \
--prefix=${BOOST_ROOT} \
--libdir=${BOOST_ROOT}/lib \
--with-libraries=locale,log,program_options,system,thread
./b2 headers
./b2 install \
--prefix=${BOOST_ROOT} \
--libdir=${BOOST_ROOT}/lib \
-j$(sysctl -n hw.ncpu) \
link=shared,static \
variant=release \
cxxflags=-std=c++14 \
cxxflags=-stdlib=libc++ \
linkflags=-stdlib=libc++
# put boost in cmake prefix path
echo "BOOST_ROOT=${BOOST_ROOT}" >> ${GITHUB_ENV}
- name: Build MacOS
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version_bare }}
COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
mkdir build
cd build
cmake \
-DBUILD_WERROR=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSUNSHINE_ASSETS_DIR=local/sunshine/assets \
-DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine \
-DGITHUB_BRANCH="${branch}" \
-DGITHUB_CLONE_URL="${clone_url}" \
-DSUNSHINE_CONFIGURE_HOMEBREW=ON \
-DSUNSHINE_CONFIGURE_ONLY=ON \
..
make -j $(sysctl -n hw.ncpu)
- name: Package MacOS
run: |
mkdir -p artifacts
cd build
cd ..
# package
cpack -G DragNDrop
mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine.dmg
# copy formula to artifacts
mkdir -p homebrew
cp -f ./build/sunshine.rb ./homebrew/sunshine.rb
# cpack -G Bundle
# mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-bundle.dmg
# testing
cat ./homebrew/sunshine.rb
- name: Upload Artifacts
if: ${{ matrix.release }}
uses: actions/upload-artifact@v4
with:
name: sunshine-macos
path: artifacts/
name: sunshine-homebrew
path: homebrew/

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
uses: ncipollo/release-action@v1
- name: Should Publish Homebrew Formula
id: homebrew_publish
run: |
PUBLISH=false
if [[ \
"${{ matrix.release }}" == "true" && \
"${{ github.repository_owner }}" == "LizardByte" && \
"${{ needs.setup_release.outputs.create_release }}" == "true" && \
"${{ github.ref }}" == "refs/heads/master" \
]]; then
PUBLISH=true
fi
echo "publish=${PUBLISH}" >> $GITHUB_OUTPUT
- name: Validate and Publish Homebrew Formula
uses: LizardByte/homebrew-release-action@v2024.311.172824
with:
name: ${{ needs.setup_release.outputs.release_name }}
tag: ${{ needs.setup_release.outputs.release_tag }}
commit: ${{ needs.setup_release.outputs.release_commit }}
artifacts: "*artifacts/*"
formula_file: ${{ github.workspace }}/homebrew/sunshine.rb
git_email: ${{ secrets.GH_BOT_EMAIL }}
git_username: ${{ secrets.GH_BOT_NAME }}
publish: ${{ steps.homebrew_publish.outputs.publish }}
token: ${{ secrets.GH_BOT_TOKEN }}
allowUpdates: true
body: ${{ needs.setup_release.outputs.release_body }}
discussionCategory: announcements
prerelease: ${{ needs.setup_release.outputs.pre_release }}

build_mac_port:
name: Macports
needs: [check_changelog, setup_release]
runs-on: macos-11
strategy:
fail-fast: false # false to test all, true to fail entire job if any fail
matrix:
include:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
# while GitHub has larger macOS runners, they are not available for our repos :(
- os_version: "12"
release: true
- os_version: "13"
- os_version: "14"
name: Macports (macOS-${{ matrix.os_version }})
runs-on: macos-${{ matrix.os_version }}

steps:
- name: Checkout
Expand Down Expand Up @@ -725,13 +712,14 @@ jobs:
echo "::endgroup::"
- name: Upload Artifacts
if: ${{ matrix.release }}
uses: actions/upload-artifact@v4
with:
name: sunshine-macports
path: artifacts/

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.create_release == 'true' }}
if: ${{ needs.setup_release.outputs.create_release == 'true' && matrix.release }}
uses: ncipollo/release-action@v1
with:
name: ${{ needs.setup_release.outputs.release_name }}
Expand Down Expand Up @@ -814,11 +802,15 @@ jobs:
- name: Package Windows Debug Info
working-directory: build
run: |
# save the original binaries with debug info
# use .dbg file extension for binaries to avoid confusion with real packages
Get-ChildItem -File -Recurse | `
% { Rename-Item -Path $_.PSPath -NewName $_.Name.Replace(".exe",".dbg") }
# save the binaries with debug info
7z -r `
"-xr!CMakeFiles" `
"-xr!cpack_artifacts" `
a "../artifacts/sunshine-debuginfo-win32.zip" "*.exe"
a "../artifacts/sunshine-win32-debuginfo.7z" "*.dbg"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,43 @@
# Changelog

## [0.22.1] - 2024-03-13
**Breaking**
- (ArchLinux) Drop support for standalone PKGBUILD files. Use the binary Arch package or install via AUR instead.
- (macOS) Drop support for experimental dmg package. Use Homebrew or MacPorts instead.

**Added**
- (macOS) Added Homebrew support

**Changed**
- (Process/Windows) The working directory is now searched first when the command contains a relative path
- (ArchLinux) The kmsgrab capture backend is now compiled by default to support Wayland capture on non-wlroots-based compositors
- (Capture/Linux) X11 capture is now preferred over kmsgrab for cards that lack atomic modesetting support to ensure cursor capture works
- (Capture/Linux) Kmsgrab will only choose NVENC by default if the display is connected to the Nvidia GPU to avoid possible EGL import failures

**Fixed**
- (Config) Fix unsupported resolution error with some Moonlight clients
- (Capture/Windows) Fix crash when streaming Ryujinx, Red Alert 2, and other apps that use unusually sized monochrome cursors
- (Capture/Linux) Fix crash in KMS cursor capture when running on Arch-based distros
- (Capture/Linux) Fix crash if CUDA GPU has a PCI ID with hexadecimal digits greater than 9
- (Process/Windows) Fix starting apps when the working directory is enclosed in quotes
- (Process/Windows) Fix process tree tracking when the app is launched via a cmd.exe trampoline
- (Installer/Windows) Fix slow operation during ViGEmBus installation that may cause the installer to appear stuck
- (Build/macOS) Fix issues building on macOS 13 and 14
- (Build/Linux) Fix missing install script in the Arch binary package
- (Build/Linux) Fix missing optional dependencies in the Arch binary package
- (Build/Linux) Ensure correct Arch pkg is published to GitHub releases
- (Capture/Linux) Fix mismatched case and unhandled exception in CUDA device lookup
- (Config) Add missing resolution to default config ui
- (Linux) Fix udev rules for uinput access not working until after reboot
- (Linux) Fix wrong path in desktop files
- (Tray) Cache icons to avoid possible DRM issues
- (Tray) Fix attempt to update tray icon after it was destroyed
- (Linux) Migrate old config files to new location if env SUNSHINE_MIGRATE_CONFIG=1 is set (automatically set for Flatpak)
- (Linux/Fedora) Re-enable CUDA support and bump to 12.4.0

**Misc**
- (Build/Windows) Adjust Windows debuginfo artifact to reduce confusion with real release binaries

## [0.22.0] - 2024-03-03
**Breaking**
- (Network) Clients must now be paired with the host before they can use Wake-on-LAN
Expand Down Expand Up @@ -720,3 +758,4 @@ settings. In v0.17.0, games now run under your user account without elevated pri
[0.20.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.20.0
[0.21.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.21.0
[0.22.0]: https://github.com/LizardByte/Sunshine/releases/tag/v0.22.0
[0.22.1]: https://github.com/LizardByte/Sunshine/releases/tag/v0.22.1
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.18)
# todo - set this conditionally

# todo - set version to 0.0.0 once confident in automated versioning
project(Sunshine VERSION 0.22.0
DESCRIPTION "Sunshine is a self-hosted game stream host for Moonlight."
project(Sunshine VERSION 0.22.1
DESCRIPTION "Self-hosted game stream host for Moonlight"
HOMEPAGE_URL "https://app.lizardbyte.dev/Sunshine")

set(PROJECT_LICENSE "GPL-3.0")
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -32,11 +32,11 @@ System Requirements
+------------+------------------------------------------------------------+
| OS | Windows: 10+ (Windows Server not supported) |
| +------------------------------------------------------------+
| | macOS: 11.7+ |
| | macOS: 12+ |
| +------------------------------------------------------------+
| | Linux/Debian: 11 (bullseye) |
| +------------------------------------------------------------+
| | Linux/Fedora: 37+ |
| | Linux/Fedora: 38+ |
| +------------------------------------------------------------+
| | Linux/Ubuntu: 20.04+ (focal) |
+------------+------------------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions cmake/packaging/linux.cmake
Expand Up @@ -3,15 +3,15 @@
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/"
DESTINATION "${SUNSHINE_ASSETS_DIR}")
if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK})
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules"
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules"
DESTINATION "${SUNSHINE_ASSETS_DIR}/udev/rules.d")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service"
DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user")
else()
find_package(Systemd)
find_package(Udev)

install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules"
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules"
DESTINATION "${UDEV_RULES_INSTALL_DIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service"
DESTINATION "${SYSTEMD_USER_UNIT_INSTALL_DIR}")
Expand Down
2 changes: 0 additions & 2 deletions cmake/packaging/unix.cmake
@@ -1,8 +1,6 @@
# unix specific packaging
# put anything here that applies to both linux and macos

include(GNUInstallDirs)

# return here if building a macos package
if(SUNSHINE_PACKAGE_MACOS)
return()
Expand Down
8 changes: 8 additions & 0 deletions cmake/prep/options.cmake
Expand Up @@ -12,7 +12,15 @@ option(CUDA_INHERIT_COMPILE_OPTIONS
"When building CUDA code, inherit compile options from the the main project. You may want to disable this if
your IDE throws errors about unknown flags after running cmake." ON)

if(UNIX)
# technically, the homebrew build could be on linux as well... no idea if it would actually work
option(SUNSHINE_BUILD_HOMEBREW
"Enable a Homebrew build." OFF)
endif ()

if(APPLE)
option(SUNSHINE_CONFIGURE_HOMEBREW
"Configure macOS Homebrew formula. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF)
option(SUNSHINE_CONFIGURE_PORTFILE
"Configure macOS Portfile. Recommended to use with SUNSHINE_CONFIGURE_ONLY" OFF)
option(SUNSHINE_PACKAGE_MACOS
Expand Down
6 changes: 6 additions & 0 deletions cmake/prep/special_package_configuration.cmake
Expand Up @@ -2,7 +2,12 @@ if (APPLE)
if(${SUNSHINE_CONFIGURE_PORTFILE})
configure_file(packaging/macos/Portfile Portfile @ONLY)
endif()
if(${SUNSHINE_CONFIGURE_HOMEBREW})
configure_file(packaging/macos/sunshine.rb sunshine.rb @ONLY)
endif()
elseif (UNIX)
include(GNUInstallDirs) # this needs to be included prior to configuring the desktop files

# configure the .desktop file
if(${SUNSHINE_BUILD_APPIMAGE})
configure_file(packaging/linux/AppImage/sunshine.desktop sunshine.desktop @ONLY)
Expand All @@ -24,6 +29,7 @@ elseif (UNIX)
# configure the arch linux pkgbuild
if(${SUNSHINE_CONFIGURE_PKGBUILD})
configure_file(packaging/linux/Arch/PKGBUILD PKGBUILD @ONLY)
configure_file(packaging/linux/Arch/sunshine.install sunshine.install @ONLY)
endif()

# configure the flatpak manifest
Expand Down
13 changes: 12 additions & 1 deletion cmake/targets/common.cmake
Expand Up @@ -37,8 +37,19 @@ endif()

target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301

# Homebrew build fails the vite build if we set these environment variables
if(${SUNSHINE_BUILD_HOMEBREW})
set(NPM_SOURCE_ASSETS_DIR "")
set(NPM_ASSETS_DIR "")
set(NPM_BUILD_HOMEBREW "true")
else()
set(NPM_SOURCE_ASSETS_DIR ${SUNSHINE_SOURCE_ASSETS_DIR})
set(NPM_ASSETS_DIR ${CMAKE_BINARY_DIR})
set(NPM_BUILD_HOMEBREW "")
endif()

#WebUI build
add_custom_target(web-ui ALL
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMENT "Installing NPM Dependencies and Building the Web UI"
COMMAND bash -c \"npm install && SUNSHINE_SOURCE_ASSETS_DIR=${SUNSHINE_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${CMAKE_BINARY_DIR} npm run build\") # cmake-lint: disable=C0301
COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301

0 comments on commit 00fbbc9

Please sign in to comment.