From c4977b5393e6a266467bb9261b7866f6384cd798 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 23 Apr 2022 10:48:05 +0100 Subject: [PATCH 01/47] WIP: Moving to cpack in order to unify installers across all platforms --- CMakeLists.txt | 62 ++++++++++++- assets/linux-deb/conffiles | 2 + assets/linux-deb/postinst | 41 +++++++++ assets/linux-deb/preinst | 9 ++ gen-deb.in | 123 ------------------------- gen-rpm.in | 179 ------------------------------------- 6 files changed, 112 insertions(+), 304 deletions(-) create mode 100644 assets/linux-deb/conffiles create mode 100644 assets/linux-deb/postinst create mode 100644 assets/linux-deb/preinst delete mode 100755 gen-deb.in delete mode 100755 gen-rpm.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 862e4f1a..291a6f2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,8 +312,6 @@ else() if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) set(SUNSHINE_EXECUTABLE_PATH "sunshine") endif() - configure_file(gen-deb.in gen-deb @ONLY) - configure_file(gen-rpm.in gen-rpm @ONLY) configure_file(sunshine.desktop.in sunshine.desktop @ONLY) configure_file(sunshine.service.in sunshine.service @ONLY) endif() @@ -448,3 +446,63 @@ foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) endforeach() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) + +############# +# CPACK +#### + +# Add all assets dependencies +install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") +install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") +if(WIN32) # TODO: test + install(TARGETS sunshine RUNTIME DESTINATION ".") + + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION ".") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "shaders") +endif() +if(APPLE) # TODO: test + install(TARGETS sunshine RUNTIME DESTINATION ".") + + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_mac.json" DESTINATION ".") + # TODO: info.plist ?? +endif() +if(UNIX AND NOT APPLE) + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION ".") + install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") + install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "shaders") + + # Pre and post install + set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA + "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst;${SUNSHINE_ASSETS_DIR}/linux-deb/postinst;${SUNSHINE_ASSETS_DIR}/linux-deb/conffiles") + set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst") + set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/postinst") +endif() + +# Common options +set(CPACK_PACKAGE_NAME "SunshineStream") +set(CPACK_PACKAGE_VENDOR "CMake.org") +set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") +set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SunshineStream/Sunshine") +set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) +set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) +set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") +set(CPACK_STRIP_FILES YES) + +# Installation destination dir +if(NOT WIN32) + set(CPACK_SET_DESTDIR true) +endif() +if(UNIX AND NOT APPLE) + set(CMAKE_INSTALL_PREFIX "/etc/sunshine") +endif() + +## DEB +set(CPACK_DEB_COMPONENT_INSTALL ON) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) + +include(CPack) \ No newline at end of file diff --git a/assets/linux-deb/conffiles b/assets/linux-deb/conffiles new file mode 100644 index 00000000..78176a81 --- /dev/null +++ b/assets/linux-deb/conffiles @@ -0,0 +1,2 @@ +/etc/sunshine/sunshine.conf +/etc/sunshine/apps_linux.json diff --git a/assets/linux-deb/postinst b/assets/linux-deb/postinst new file mode 100644 index 00000000..cf66231f --- /dev/null +++ b/assets/linux-deb/postinst @@ -0,0 +1,41 @@ +#!/bin/sh + +export GROUP_INPUT=input + +if [ -f /etc/group ]; then + if ! grep -q $GROUP_INPUT /etc/group; then + echo "Creating group $GROUP_INPUT" + + groupadd $GROUP_INPUT + fi +else + echo "Warning: /etc/group not found" +fi + +if [ -f /etc/sunshine/sunshine.conf.old ]; then + echo "Restoring old sunshine.conf" + mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf +fi + +if [ -f /etc/sunshine/apps_linux.json.old ]; then + echo "Restoring old apps_linux.json" + mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json +fi + +# Update permissions on config files for Web Manager +if [ -f /etc/sunshine/apps_linux.json ]; then + echo "chmod 666 /etc/sunshine/apps_linux.json" + chmod 666 /etc/sunshine/apps_linux.json +fi + +if [ -f /etc/sunshine/sunshine.conf ]; then + echo "chmod 666 /etc/sunshine/sunshine.conf" + chmod 666 /etc/sunshine/sunshine.conf +fi + +# Ensure Sunshine can grab images from KMS +path_to_setcap=$(which setcap) +if [ -x "$path_to_setcap" ] ; then + echo "$path_to_setcap cap_sys_admin+p /usr/bin/sunshine" + $path_to_setcap cap_sys_admin+p $(readlink -f /usr/bin/sunshine) +fi diff --git a/assets/linux-deb/preinst b/assets/linux-deb/preinst new file mode 100644 index 00000000..515d1a34 --- /dev/null +++ b/assets/linux-deb/preinst @@ -0,0 +1,9 @@ +#!/bin/sh +#Store backup for old config files to prevent it from being overwritten +if [ -f /etc/sunshine/sunshine.conf ]; then + cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old +fi + +if [ -f /etc/sunshine/apps_linux.json ]; then + cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old +fi diff --git a/gen-deb.in b/gen-deb.in deleted file mode 100755 index 25ca3609..00000000 --- a/gen-deb.in +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh - -if [ ! "@SUNSHINE_UNDEFINED_VARIABLE@" = "" ]; then - echo "Please run gen-deb generated by cmake inside the build directory" - exit 1 -fi - -if [ -d package-deb ]; then - echo "package-deb already exists: It will be replaced" - rm -rf package-deb -fi - -export DEBIAN=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/DEBIAN -export RULES=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/udev/rules.d -export BIN=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/bin -export SERVICE=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/usr/lib/systemd/user -export ASSETS=@CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine/etc/sunshine - -mkdir -p $DEBIAN -mkdir -p $RULES -mkdir -p $BIN -mkdir -p $ASSETS/shaders -mkdir -p $SERVICE - -if [ ! -f sunshine ]; then - echo "Error: Can't find sunshine" - exit 1 -fi - -cat << 'EOF' > $DEBIAN/conffiles -/etc/sunshine/sunshine.conf -/etc/sunshine/apps_linux.json -EOF - -cat << 'EOF' > $DEBIAN/control -Package: sunshine -Architecture: amd64 -Maintainer: @loki -Priority: optional -Version: @PROJECT_VERSION@ -Depends: libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2 -Description: Gamestream host for Moonlight -EOF - -cat << 'EOF' > $DEBIAN/preinst -#Store backup for old config files to prevent it from being overwritten -if [ -f /etc/sunshine/sunshine.conf ]; then - cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old -fi - -if [ -f /etc/sunshine/apps_linux.json ]; then - cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old -fi -EOF - -cat << 'EOF' > $DEBIAN/postinst -#!/bin/sh - -export GROUP_INPUT=input - -if [ -f /etc/group ]; then - if ! grep -q $GROUP_INPUT /etc/group; then - echo "Creating group $GROUP_INPUT" - - groupadd $GROUP_INPUT - fi -else - echo "Warning: /etc/group not found" -fi - -if [ -f /etc/sunshine/sunshine.conf.old ]; then - echo "Restoring old sunshine.conf" - mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf -fi - -if [ -f /etc/sunshine/apps_linux.json.old ]; then - echo "Restoring old apps_linux.json" - mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json -fi - -# Update permissions on config files for Web Manager -if [ -f /etc/sunshine/apps_linux.json ]; then - echo "chmod 666 /etc/sunshine/apps_linux.json" - chmod 666 /etc/sunshine/apps_linux.json -fi - -if [ -f /etc/sunshine/sunshine.conf ]; then - echo "chmod 666 /etc/sunshine/sunshine.conf" - chmod 666 /etc/sunshine/sunshine.conf -fi - -# Ensure Sunshine can grab images from KMS -path_to_setcap=$(which setcap) -if [ -x "$path_to_setcap" ] ; then - echo "$path_to_setcap cap_sys_admin+p /usr/bin/sunshine" - $path_to_setcap cap_sys_admin+p /usr/bin/sunshine -fi -EOF - -cat << 'EOF' > $RULES/85-sunshine-rules.rules -KERNEL=="uinput", GROUP="input", MODE="0660" -EOF - -cp sunshine $BIN/sunshine -cp @CMAKE_CURRENT_SOURCE_DIR@/assets/apps_linux.json $ASSETS/apps_linux.json -cp @CMAKE_CURRENT_SOURCE_DIR@/assets/sunshine.conf $ASSETS/sunshine.conf -cp @CMAKE_CURRENT_BINARY_DIR@/sunshine.service $SERVICE/sunshine.service -cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/web $ASSETS/web -cp -r @CMAKE_CURRENT_SOURCE_DIR@/assets/shaders/opengl $ASSETS/shaders/opengl - -chmod 755 $DEBIAN/postinst -chmod 755 $DEBIAN/preinst -chmod 755 $BIN/sunshine -chmod 644 $RULES/85-sunshine-rules.rules -chmod 666 $ASSETS/apps_linux.json -chmod 666 $ASSETS/sunshine.conf - -cd package-deb -if fakeroot dpkg-deb --build sunshine; then - echo "generated debian package: @CMAKE_CURRENT_BINARY_DIR@/package-deb/sunshine.deb" -fi -cd .. - diff --git a/gen-rpm.in b/gen-rpm.in deleted file mode 100755 index 792a3895..00000000 --- a/gen-rpm.in +++ /dev/null @@ -1,179 +0,0 @@ -#!/bin/sh - -# Export filepaths -export BUILDDIR=@CMAKE_CURRENT_SOURCE_DIR@/build -export BUILDROOT=~/rpmbuild/ -export RPMSRC=~/rpmbuild/SOURCES -export RPMSPEC=~/rpmbuild/SPECS -export RPMBUILD=~/rpmbuild/BUILD - -# Check for Docker switch -if [ "$1" == "-d" ]; then - export DOCKERSTATUS=TRUE -else - export DOCKERSTATUS=FALSE -fi - -# Check if user's rpmbuild folder is there, if so, temoprairly rename it. -if [ -d ~/rpmbuild ]; then - echo "Backing up rpmbuild" - ~/rpmbuild ~/rpmbuild.bkp - export RPMBUILDEXISTS=TRUE -else - export RPMBUILDEXISTS=FALSE -fi - -# Create rpmbuild folder structure -mkdir ~/rpmbuild -mkdir ~/rpmbuild/BUILD -mkdir ~/rpmbuild/BUILDROOT -mkdir ~/rpmbuild/RPMS -mkdir ~/rpmbuild/SOURCES -mkdir ~/rpmbuild/SPECS -mkdir ~/rpmbuild/SRPMS - -# Create sunshine .spec file with preinstall and postinstall scripts -cat << 'EOF' > $RPMSPEC/sunshine.spec -Name: sunshine -Version: @PROJECT_VERSION@ -Release: 1%{?dist} -Summary: An NVIDIA Gamestream-compatible hosting server -BuildArch: x86_64 - -License: GPLv3 -URL: https://github.com/SunshineStream/Sunshine -Source0: sunshine-@PROJECT_VERSION@_bin.tar.gz - -Requires: systemd ffmpeg rpmfusion-free-release - -%description -An NVIDIA Gamestream-compatible hosting server - -%pre -#!/bin/sh - -# Sunshine Pre-Install Script -# Store backup for old config files to prevent it from being overwritten -if [ -f /etc/sunshine/sunshine.conf ]; then - cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old -fi - -if [ -f /etc/sunshine/apps_linux.json ]; then - cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old -fi - -%post -#!/bin/sh - -# Sunshine Post-Install Script -export GROUP_INPUT=input - -if [ -f /etc/group ]; then - if ! grep -q $GROUP_INPUT /etc/group; then - echo "Creating group $GROUP_INPUT" - - groupadd $GROUP_INPUT - fi -else - echo "Warning: /etc/group not found" -fi - -if [ -f /etc/sunshine/sunshine.conf.old ]; then - echo "Restoring old sunshine.conf" - mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf -fi - -if [ -f /etc/sunshine/apps_linux.json.old ]; then - echo "Restoring old apps_linux.json" - mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json -fi - -# Update permissions on config files for Web Manager -if [ -f /etc/sunshine/apps_linux.json ]; then - echo "chmod 666 /etc/sunshine/apps_linux.json" - chmod 666 /etc/sunshine/apps_linux.json -fi - -if [ -f /etc/sunshine/sunshine.conf ]; then - echo "chmod 666 /etc/sunshine/sunshine.conf" - chmod 666 /etc/sunshine/sunshine.conf -fi - -# Ensure Sunshine can grab images from KMS -path_to_setcap=$(which setcap) -if [ -x "$path_to_setcap" ] ; then - echo "$path_to_setcap cap_sys_admin+p /usr/bin/sunshine" - $path_to_setcap cap_sys_admin+p /usr/bin/sunshine -fi - -%prep -%setup -q - -%install -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT/%{_bindir} -mkdir -p $RPM_BUILD_ROOT/etc/sunshine -mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/user -mkdir -p $RPM_BUILD_ROOT/usr/share/applications -mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d - -cp sunshine $RPM_BUILD_ROOT/%{_bindir}/sunshine -cp sunshine.conf $RPM_BUILD_ROOT/etc/sunshine/sunshine.conf -cp apps_linux.json $RPM_BUILD_ROOT/etc/sunshine/apps_linux.json -cp sunshine.service $RPM_BUILD_ROOT/usr/lib/systemd/user/sunshine.service -cp sunshine.desktop $RPM_BUILD_ROOT/usr/share/applications/sunshine.desktop -cp 85-sunshine-rules.rules $RPM_BUILD_ROOT/etc/udev/rules.d/85-sunshine-rules.rules - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%{_bindir}/sunshine -/usr/lib/systemd/user/sunshine.service -/etc/sunshine/sunshine.conf -/etc/sunshine/apps_linux.json -/usr/share/applications/sunshine.desktop -/etc/udev/rules.d/85-sunshine-rules.rules - -%changelog -* Sat Mar 12 2022 h <65380846+thatsysadmin@users.noreply.github.com> -- Initial packaging of Sunshine. -EOF - -# Copy over sunshine binary and supplemental files into rpmbuild/BUILD/ -mkdir genrpm -mkdir genrpm/sunshine-@PROJECT_VERSION@ -cp sunshine-@PROJECT_VERSION@ genrpm/sunshine-@PROJECT_VERSION@/sunshine -cp sunshine.service genrpm/sunshine-@PROJECT_VERSION@/sunshine.service -cp sunshine.desktop genrpm/sunshine-@PROJECT_VERSION@/sunshine.desktop -cp @CMAKE_CURRENT_SOURCE_DIR@/assets/sunshine.conf genrpm/sunshine-@PROJECT_VERSION@/sunshine.conf -cp @CMAKE_CURRENT_SOURCE_DIR@/assets/apps_linux.json genrpm/sunshine-@PROJECT_VERSION@/apps_linux.json -cp @CMAKE_CURRENT_SOURCE_DIR@/assets/85-sunshine-rules.rules genrpm/sunshine-@PROJECT_VERSION@/85-sunshine-rules.rules -cd genrpm - -# tarball everything as if it was a source file for rpmbuild -tar --create --file sunshine-@PROJECT_VERSION@_bin.tar.gz sunshine-@PROJECT_VERSION@/ -cp sunshine-@PROJECT_VERSION@_bin.tar.gz ~/rpmbuild/SOURCES - -# Use rpmbuild to build the RPM package. -rpmbuild -bb $RPMSPEC/sunshine.spec - -# Check if running in a CT -if [ "$DOCKERSTATUS" == "FALSE" ]; then - # Move the completed RPM into the cmake build folder - mv ~/rpmbuild/RPMS/x86_64/sunshine-@PROJECT_VERSION@-1.fc*.x86_64.rpm @CMAKE_CURRENT_BINARY_DIR@/ - echo "Moving completed RPM package into CMake build folder." -elif [ "$DOCKERSTATUS" == "TRUE" ]; then - # Move into pickup location - mkdir -p /root/sunshine-build/package-rpm/ - mv ~/rpmbuild/RPMS/x86_64/sunshine-@PROJECT_VERSION@-1.fc*.x86_64.rpm /root/sunshine-build/package-rpm/sunshine.rpm - echo "Moving completed RPM package for pickup." -fi - -# Clean up; delete the rpmbuild folder we created and move back the original one -if [ "$RPMBUILDEXISTS" == "TRUE" ]; then - echo "Removing and replacing original rpmbuild folder." - rm -rf ~/rpmbuild - mv ~/rpmbuild.bkp ~/rpmbuild -fi -exit 0 From 2ea414d1d4d6f152650b41d826c2196b14a47d42 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 23 Apr 2022 11:04:00 +0100 Subject: [PATCH 02/47] testing RPM package dependencies --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 291a6f2e..859b544a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -478,6 +478,12 @@ if(UNIX AND NOT APPLE) "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst;${SUNSHINE_ASSETS_DIR}/linux-deb/postinst;${SUNSHINE_ASSETS_DIR}/linux-deb/conffiles") set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/postinst") + + # Dependencies + set(CPACK_DEB_COMPONENT_INSTALL ON) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") + set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # endif() # Common options @@ -500,9 +506,4 @@ if(UNIX AND NOT APPLE) set(CMAKE_INSTALL_PREFIX "/etc/sunshine") endif() -## DEB -set(CPACK_DEB_COMPONENT_INSTALL ON) -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) - include(CPack) \ No newline at end of file From ffdcf0fea86bb046e329554d117510346c987d32 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 23 Apr 2022 15:13:27 +0100 Subject: [PATCH 03/47] feat: basic OSX .app generation added default brew link libraries path --- CMakeLists.txt | 40 ++++++++++++++++++++++++++-------------- sunshine.icns | Bin 0 -> 23711 bytes 2 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 sunshine.icns diff --git a/CMakeLists.txt b/CMakeLists.txt index 859b544a..d81bda12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ if(WIN32) INPUT "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled.zip" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pre-compiled) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") - + if(NOT DEFINED SUNSHINE_PREPARED_BINARIES) set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled/windows") endif() @@ -127,8 +127,8 @@ if(WIN32) elseif(APPLE) add_compile_definitions(SUNSHINE_PLATFORM="macos") list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_mac.json") + link_directories(/opt/homebrew/lib/) # Default brew lib location link_directories(/opt/local/lib) - link_directories(/usr/local/lib) ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) find_package(FFmpeg REQUIRED) @@ -296,14 +296,14 @@ else() third-party/glad/include/KHR/khrplatform.h third-party/glad/include/glad/gl.h third-party/glad/include/glad/egl.h) - + list(APPEND PLATFORM_LIBRARIES dl evdev pulse pulse-simple ) - + include_directories( /usr/include/libevdev-1.0 third-party/nv-codec-headers/include @@ -451,22 +451,36 @@ target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COM # CPACK #### -# Add all assets dependencies -install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") -install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") +# Add all assets dependencies if(WIN32) # TODO: test install(TARGETS sunshine RUNTIME DESTINATION ".") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") + install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION ".") install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "shaders") endif() if(APPLE) # TODO: test - install(TARGETS sunshine RUNTIME DESTINATION ".") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_mac.json" DESTINATION ".") - # TODO: info.plist ?? + set(prefix "${CMAKE_PROJECT_NAME}.app/Contents") + set(INSTALL_RUNTIME_DIR "${prefix}/MacOS") + + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${INSTALL_RUNTIME_DIR}") + + install(TARGETS sunshine + BUNDLE DESTINATION . COMPONENT Runtime + RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime) + + # TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop + # set(CPACK_BUNDLE_NAME "Sunshine") + # set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist") + # set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") endif() if(UNIX AND NOT APPLE) + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") + install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION ".") install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") @@ -474,7 +488,7 @@ if(UNIX AND NOT APPLE) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "shaders") # Pre and post install - set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA + set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst;${SUNSHINE_ASSETS_DIR}/linux-deb/postinst;${SUNSHINE_ASSETS_DIR}/linux-deb/conffiles") set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/postinst") @@ -499,10 +513,8 @@ set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PAC set(CPACK_STRIP_FILES YES) # Installation destination dir -if(NOT WIN32) - set(CPACK_SET_DESTDIR true) -endif() if(UNIX AND NOT APPLE) + set(CPACK_SET_DESTDIR true) set(CMAKE_INSTALL_PREFIX "/etc/sunshine") endif() diff --git a/sunshine.icns b/sunshine.icns new file mode 100644 index 0000000000000000000000000000000000000000..0420582b244aa1599ebe86a9016d3113ef42c7cc GIT binary patch literal 23711 zcmZs?V~{XB&@DK&ZQHhO+qP}nwr$&d#pBEmHbK4iKVff zGXQ{2zNIk($A3B<0002SN`Zg?7AhR-KO4o&#nZvcfr;Qh8{mIy`Tw-Ve-O>m!o&#x z0PsKaKLG&;|DPBDcw>7Tr~mN*03iG)M8+njW&j}n3j+cG|KHI7K>t;M|L}k1KRV+- z`9DPfrvE|zo9=(i|5g4!7z7*;@c(IlCIG|$fWl6uhA#F_Tm({v&I+bZ1Zt*E&X)Fe z1dMc?3=DLPe@Xx_|1kjqfP#Pk0RHI!APWdcNGSZj+n+7~3gG|I3-o{V0{{QL2>|~y zT>#o@|8!UcK+X>6iW=|yx3&f0E6ZVUV8&GuXV+u|e;u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6cM9dny=yd1hc~ z|6HdA(0!mwHL28wz@uK98AM{}cT!EY8@H@dY4x}FTMYEOwYTB132wbt3g!N#*8}w$ z;W>qaMsbQeg5?yp6@k$eJp71m?bviGV<(8}lwdh2GO?V3y#c3t-@0GSay1mMBx%Vt}F0UIW#0eIK-E*@);rsUHMK1fB)H~BGhXD literal 0 HcmV?d00001 From e2bef750b4b3201be8ef6ee49a95263f025af05f Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Wed, 27 Apr 2022 20:50:30 +0100 Subject: [PATCH 04/47] feat: created NSIS windows installer, fixed Linux packaging paths --- CMakeLists.txt | 97 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d81bda12..4c19621a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,14 +451,71 @@ target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COM # CPACK #### -# Add all assets dependencies -if(WIN32) # TODO: test - install(TARGETS sunshine RUNTIME DESTINATION ".") +# Common options +set(CPACK_PACKAGE_NAME "SunshineStream") +set(CPACK_PACKAGE_VENDOR "CMake.org") +set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") +set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") +set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SunshineStream/Sunshine") +set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) +set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) +set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") +set(CPACK_STRIP_FILES YES) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") - install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION ".") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "shaders") +# Platform specific options +if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.html + install(TARGETS sunshine RUNTIME DESTINATION "." COMPONENT application) + + # Adding tools + install(TARGETS dxgi-info RUNTIME DESTINATION "tools" COMPONENT dxgi) + install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio) + install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc) + + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT web) + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders" COMPONENT assets) + + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") + set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") + string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here + + # Sets permissions on the installed folder so that we can write in it + SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS + "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS} + ExecWait 'icacls \\\"$INSTDIR\\\" /grant:r Users:\\\(OI\\\)\\\(CI\\\)\\\(F\\\)' + ") + + # Adding an option for the start menu and PATH + set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but then it seems I can't just run it from powershell + set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") + set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${PROJECT_NAME}.exe") + set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings + set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk' '\$INSTDIR\\\\${PROJECT_NAME}.exe'") + + # Checking for previous installed versions + # set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed + + # Setting components groups and dependencies + set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "Sunshine") + set(CPACK_COMPONENT_WEB_DISPLAY_NAME "Web interface") + set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Extra assets files") + set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") + + set(CPACK_COMPONENT_APPLICATION_GROUP "Runtime") + set(CPACK_COMPONENT_WEB_GROUP "Runtime") + set(CPACK_COMPONENT_ASSETS_GROUP "Runtime") + + set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info.exe") + set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe") + set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc.exe") + + set(CPACK_COMPONENT_DXGI_GROUP "Extra Tools") + set(CPACK_COMPONENT_AUDIO_GROUP "Extra Tools") + set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Extra Tools") + + set(CPACK_COMPONENT_APPLICATION_DEPENDS web assets) endif() if(APPLE) # TODO: test @@ -478,14 +535,14 @@ if(APPLE) # TODO: test # set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") endif() if(UNIX AND NOT APPLE) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION ".") - install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION ".") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION ".") + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION "${SUNSHINE_CONFIG_DIR}") install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "shaders") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders") # Pre and post install set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA @@ -497,23 +554,9 @@ if(UNIX AND NOT APPLE) set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") - set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # -endif() + set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config -# Common options -set(CPACK_PACKAGE_NAME "SunshineStream") -set(CPACK_PACKAGE_VENDOR "CMake.org") -set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") -set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") -set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") -set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SunshineStream/Sunshine") -set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) -set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) -set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") -set(CPACK_STRIP_FILES YES) - -# Installation destination dir -if(UNIX AND NOT APPLE) + # Installation destination dir set(CPACK_SET_DESTDIR true) set(CMAKE_INSTALL_PREFIX "/etc/sunshine") endif() From cc2d982cebee5cc19894ef2a23bf9fb29f88d638 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Wed, 27 Apr 2022 21:00:20 +0100 Subject: [PATCH 05/47] feat: testing out CI building for new packages --- .github/workflows/CI.yml | 56 ++++++++++++---------------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b0be1130..e4a76c6e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -147,43 +147,29 @@ jobs: name: Linux runs-on: ubuntu-20.04 needs: check_changelog - strategy: - fail-fast: true # false to test all, true to fail entire job if any fail - matrix: - distro: [ debian, ubuntu_18_04, ubuntu_20_04, ubuntu_21_10 ] - package: [ -p ] - extension: [ deb ] - include: # package these differently - - distro: fedora_35 - package: '-p' - extension: rpm - steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - name: Setup Container + - name: Build DEB and RPM run: | + mkdir -p build mkdir -p artifacts - - cd scripts - sudo ./build-container.sh -c build -f Dockerfile-${{ matrix.distro }} -n sunshine-${{ matrix.distro }} - - name: Build Linux - run: | - cd scripts - sudo ./build-sunshine.sh ${{ matrix.package }} -e ${{ matrix.extension }} -u -n sunshine-${{ matrix.distro }} -s .. - - name: Package Linux - if: ${{ matrix.package != '' }} - run: | - cd scripts - sudo mv ./sunshine-${{ matrix.distro }}-build/sunshine-${{ matrix.distro }}.${{ matrix.extension }} ../artifacts/ + cd build + + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR="." ../ + cpack -G DEB + cpack -G RPM + + cp Sunshine__.rpm ../artifacts/ + cp Sunshine__.deb ../artifacts/ - name: Upload Artifacts if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} uses: actions/upload-artifact@v3 with: - name: sunshine-${{ matrix.distro }} + name: sunshine-linux path: artifacts/ - name: Create Release if: ${{ matrix.package == '-p' && github.event_name == 'push' && github.ref == 'refs/heads/master' }} @@ -218,6 +204,7 @@ jobs: mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost + mingw-w64-x86_64-nsis git yasm nasm @@ -226,23 +213,14 @@ jobs: - name: Build Windows shell: msys2 {0} run: | + mkdir artifacts + mkdir sunshine-windows-build && cd sunshine-windows-build cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. mingw32-make -j2 - - name: Package Windows - run: | - cd sunshine-windows-build - del ..\assets\apps_linux.json - 7z a sunshine-windows.zip ..\assets - 7z a sunshine-windows.zip sunshine.exe - 7z a sunshine-windows.zip tools\dxgi-info.exe - 7z a sunshine-windows.zip tools\audio-info.exe - 7z a sunshine-windows.zip tools\sunshinesvc.exe - 7z a sunshine-windows.zip ..\tools\install-service.bat - 7z a sunshine-windows.zip ..\tools\uninstall-service.bat - cd .. - mkdir artifacts - move "sunshine-windows-build\sunshine-windows.zip" "artifacts" + cpack + + cp Sunshine__.exe ../artifacts - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 From 4e4a5c8df8c60dcf4fe2a409c4455c9786cc45ef Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Fri, 29 Apr 2022 21:19:05 +0100 Subject: [PATCH 06/47] feat: testing out a better CI workflow --- .github/workflows/CI.yml | 162 ++++++++++++++++++++++++++------------- CMakeLists.txt | 2 +- 2 files changed, 110 insertions(+), 54 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e4a76c6e..b1503feb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -51,10 +51,60 @@ jobs: echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})" exit 1 + build_linux: + name: Build Sunshine on Linux + runs-on: ubuntu-20.04 + needs: check_changelog + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Cache Sunshine build + uses: actions/cache@v2 + with: + path: build + key: ${{ runner.os }}-sunshine-build + + - name: Setup Dependencies + run: | + mkdir -p artifacts + + sudo apt-get update -y && \ + sudo apt-get --reinstall install -y \ + git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 + sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run + sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run + sudo add-apt-repository ppa:savoury1/graphics -y + sudo add-apt-repository ppa:savoury1/multimedia -y + sudo add-apt-repository ppa:savoury1/ffmpeg4 -y + sudo apt-get update -y + sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y + sudo apt-get install ffmpeg -y + + - name: Build Sunshine + run: | + CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" + SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" + SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" + + SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} + SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} + SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} + SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} + + mkdir -p build + cd build + + cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr + make -j ${nproc} DESTDIR=AppDir + build_appimage: name: AppImage runs-on: ubuntu-20.04 - needs: check_changelog + needs: build_linux steps: - name: Checkout @@ -62,38 +112,12 @@ jobs: with: submodules: recursive - - name: Setup Dependencies AppImage - run: | - mkdir -p artifacts + - name: Cache Sunshine build + uses: actions/cache@v2 + with: + path: build + key: ${{ runner.os }}-sunshine-build - sudo apt-get update -y && \ - sudo apt-get --reinstall install -y \ - git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 - sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run - sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run - sudo add-apt-repository ppa:savoury1/graphics -y - sudo add-apt-repository ppa:savoury1/multimedia -y - sudo add-apt-repository ppa:savoury1/ffmpeg4 -y - sudo apt-get update -y - sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y - sudo apt-get install ffmpeg -y - - name: Build AppImage - run: | - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" - SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" - SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" - - SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} - SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} - SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} - SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} - - mkdir -p appimage-build && cd appimage-build - - cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr - - make -j ${nproc} DESTDIR=AppDir - name: Set AppImage Version if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} run: | @@ -143,34 +167,44 @@ jobs: last_version: ${{ needs.check_changelog.outputs.last_version }} release_body: ${{ needs.check_changelog.outputs.release_body }} - build_linux: - name: Linux + build_deb_and_rpm: + name: Build DEB and RPM runs-on: ubuntu-20.04 - needs: check_changelog + needs: build_linux steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive + - name: Cache Sunshine build + uses: actions/cache@v2 + with: + path: build + key: ${{ runner.os }}-sunshine-build + + - name: Extra dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y cpack + - name: Build DEB and RPM run: | - mkdir -p build - mkdir -p artifacts cd build - - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR="." ../ cpack -G DEB cpack -G RPM - - cp Sunshine__.rpm ../artifacts/ - cp Sunshine__.deb ../artifacts/ - - name: Upload Artifacts + - name: Upload RPM if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} uses: actions/upload-artifact@v3 with: - name: sunshine-linux - path: artifacts/ + name: sunshine-linux-rpm + path: build/Sunshine__.rpm + - name: Upload DEB + if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-linux-deb + path: build/Sunshine__.deb - name: Create Release if: ${{ matrix.package == '-p' && github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master @@ -212,21 +246,43 @@ jobs: make - name: Build Windows shell: msys2 {0} - run: | - mkdir artifacts - - mkdir sunshine-windows-build && cd sunshine-windows-build + run: | + mkdir sunshine-windows-build + cd sunshine-windows-build cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. mingw32-make -j2 + - name: Create packages + shell: msys2 {0} + run: | + cd sunshine-windows-build cpack + + mkdir -p artifacts/standalone + mkdir -p artifacts/web + mkdir -p artifacts/shaders/directx - cp Sunshine__.exe ../artifacts - - name: Upload Artifacts + # Installers + mv Sunshine__.exe artifacts/sunshine-windows-installer.exe + + # Standalone + mv ../assets/web artifacts/web + mv tools artifacts/tools + mv ../assets/shaders/directx artifacts/shaders/directx + mv ../assets/apps_windows.json artifacts/apps_windows.json + mv ../assets/sunshine.conf artifacts/sunshine.conf + mv sunshine.exe artifacts/sunshine.exe + - name: Upload Sunshine Installer if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-windows - path: artifacts/ + name: sunshine-windows-installer + path: artifacts/sunshine-windows-installer.exe + - name: Upload Sunshine executable + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-windows-standalone + path: artifacts/standalone - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c19621a..f34a86b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -457,7 +457,7 @@ set(CPACK_PACKAGE_VENDOR "CMake.org") set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") -set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SunshineStream/Sunshine") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://sunshinestream.github.io") set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") From af342c8cc98c1f9d5a29dff1dadbf1b3564f113b Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Fri, 29 Apr 2022 21:21:37 +0100 Subject: [PATCH 07/47] fix: CI, better jobs dependencies --- .github/workflows/CI.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b1503feb..082f1cd9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,7 +32,6 @@ jobs: check_versions: name: Check Versions runs-on: ubuntu-latest - needs: check_changelog if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} # base_ref for pull request check, ref for push steps: @@ -54,7 +53,7 @@ jobs: build_linux: name: Build Sunshine on Linux runs-on: ubuntu-20.04 - needs: check_changelog + needs: [check_versions, check_changelog] steps: - name: Checkout uses: actions/checkout@v3 @@ -217,7 +216,7 @@ jobs: build_win: name: Windows runs-on: windows-2019 - needs: check_changelog + needs: [check_versions, check_changelog] steps: - name: Checkout From 6858f9c8d47a4e26fc25544aac25425c5b72db08 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Fri, 29 Apr 2022 23:10:27 +0100 Subject: [PATCH 08/47] fix: testing CI --- .github/workflows/CI.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 082f1cd9..70d442d3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,13 +32,12 @@ jobs: check_versions: name: Check Versions runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push steps: - name: Checkout uses: actions/checkout@v3 - name: Check CMakeLists.txt Version + if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} run: | version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') echo "cmakelists_version=${version}" >> $GITHUB_ENV @@ -134,7 +133,7 @@ jobs: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage - ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../appimage-build/$DESKTOP_FILE" --output appimage + ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../build/sunshine -i "../$ICON_FILE" -d "../build/$DESKTOP_FILE" --output appimage mv sunshine*.AppImage sunshine.AppImage mkdir sunshine && mv sunshine.AppImage sunshine/ @@ -185,7 +184,7 @@ jobs: - name: Extra dependencies run: | sudo apt-get update -y - sudo apt-get install -y cpack + sudo apt-get install -y cmake # will install cpack - name: Build DEB and RPM run: | @@ -256,32 +255,33 @@ jobs: cd sunshine-windows-build cpack - mkdir -p artifacts/standalone - mkdir -p artifacts/web - mkdir -p artifacts/shaders/directx + mkdir -p ../artifacts # Installers - mv Sunshine__.exe artifacts/sunshine-windows-installer.exe + mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe # Standalone - mv ../assets/web artifacts/web - mv tools artifacts/tools - mv ../assets/shaders/directx artifacts/shaders/directx - mv ../assets/apps_windows.json artifacts/apps_windows.json - mv ../assets/sunshine.conf artifacts/sunshine.conf - mv sunshine.exe artifacts/sunshine.exe + del ..\assets\apps_linux.json + 7z a sunshine-windows.zip ..\assets + 7z a sunshine-windows.zip sunshine.exe + 7z a sunshine-windows.zip tools\dxgi-info.exe + 7z a sunshine-windows.zip tools\audio-info.exe + 7z a sunshine-windows.zip tools\sunshinesvc.exe + 7z a sunshine-windows.zip ..\tools\install-service.bat + 7z a sunshine-windows.zip ..\tools\uninstall-service.bat + move "sunshine-windows.zip" "../artifacts" - name: Upload Sunshine Installer if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-windows-installer - path: artifacts/sunshine-windows-installer.exe + name: sunshine-windows + path: artifacts - name: Upload Sunshine executable if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: name: sunshine-windows-standalone - path: artifacts/standalone + path: sunshine-windows-build/artifacts/standalone - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master From 5eb3e7c75f50426a9e4e5ca3eae0d55d167a90ce Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 30 Apr 2022 09:45:33 +0100 Subject: [PATCH 09/47] CI: use cpack for windows 7Z, split back deb/rpm and appimage, moved release action at the end --- .github/workflows/CI.yml | 315 ++++++++++++++++++--------------------- 1 file changed, 144 insertions(+), 171 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 70d442d3..b85dfcd7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -5,7 +5,7 @@ on: branches: [master, nightly] types: [opened, synchronize, reopened] push: - branches: [master] + branches: [ master ] workflow_dispatch: jobs: @@ -13,62 +13,134 @@ jobs: name: Check Changelog runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Verify Changelog - id: verify_changelog - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - # base_ref for pull request check, ref for push - uses: SunshineStream/actions/verify_changelog@master - with: - token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + uses: actions/checkout@v3 + + - name: Verify Changelog + id: verify_changelog + if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} + # base_ref for pull request check, ref for push + uses: SunshineStream/actions/verify_changelog@master + with: + token: ${{ secrets.GITHUB_TOKEN }} outputs: next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }} last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }} - release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} + release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} check_versions: name: Check Versions runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: Check CMakeLists.txt Version - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - run: | - version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') - echo "cmakelists_version=${version}" >> $GITHUB_ENV - - name: Compare CMakeList.txt Version - if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }} - run: | - echo CMakeLists version: "$cmakelists_version" - echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}" - echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})" - exit 1 + - name: Check CMakeLists.txt Version + if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} + run: | + version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') + echo "cmakelists_version=${version}" >> $GITHUB_ENV - build_linux: - name: Build Sunshine on Linux + - name: Compare CMakeList.txt Version + if: ${{ env.cmakelists_version != needs.check_changelog.outputs.next_version_bare }} + run: | + echo CMakeLists version: "$cmakelists_version" + echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}" + echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})" + exit 1 + + build_appimage: + name: AppImage runs-on: ubuntu-20.04 - needs: [check_versions, check_changelog] + needs: check_changelog + steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - name: Cache Sunshine build - uses: actions/cache@v2 - with: - path: build - key: ${{ runner.os }}-sunshine-build - - - name: Setup Dependencies + - name: Setup Dependencies AppImage + run: | + mkdir -p artifacts + sudo apt-get update -y && \ + sudo apt-get --reinstall install -y \ + git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 + sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run + sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run + sudo add-apt-repository ppa:savoury1/graphics -y + sudo add-apt-repository ppa:savoury1/multimedia -y + sudo add-apt-repository ppa:savoury1/ffmpeg4 -y + sudo apt-get update -y + sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y + sudo apt-get install ffmpeg -y + + - name: Build AppImage + run: | + CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" + SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" + SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" + SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} + SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} + SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} + SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} + mkdir -p appimage-build && cd appimage-build + cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr + make -j ${nproc} DESTDIR=AppDir + + - name: Set AppImage Version + if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} + run: | + version=${{ needs.check_changelog.outputs.next_version_bare }} + echo "VERSION=${version}" >> $GITHUB_ENV + - name: Package AppImage + # https://docs.appimage.org/packaging-guide/index.html + run: | + mkdir -p appimage_temp && cd appimage_temp + DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" + ICON_FILE="${ICON_FILE:-sunshine.png}" + CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" + HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../appimage-build/$DESKTOP_FILE" --output appimage + mv sunshine*.AppImage sunshine.AppImage + mkdir sunshine && mv sunshine.AppImage sunshine/ + ./sunshine/sunshine.AppImage --appimage-portable-config + ./sunshine/sunshine.AppImage --appimage-portable-home + cp -r ../assets/* "$CONFIG_DIR" + rm -f "$CONFIG_DIR"/apps_windows.json + mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" + cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" + zip -r ./sunshine-appimage.zip ./sunshine/* + mv sunshine-appimage.zip ../artifacts/ + + - name: Verify AppImage + run: | + cd appimage_temp + wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./sunshine/sunshine.AppImage + + - name: Upload Artifacts + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-appimage + path: artifacts/ + + build_linux: + name: Linux + runs-on: ubuntu-20.04 + needs: check_changelog + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Dependencies AppImage run: | mkdir -p artifacts - sudo apt-get update -y && \ sudo apt-get --reinstall install -y \ git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev @@ -86,142 +158,48 @@ jobs: run: | CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" - SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" - SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} - - mkdir -p build + SUNSHINE_CONFIG_DIR=${SUNSHINE_CONFIG_DIR:-.} + + mkdir -p build + mkdir -p artifacts + cd build - - cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr - make -j ${nproc} DESTDIR=AppDir + cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_CONFIG_DIR=$SUNSHINE_CONFIG_DIR" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr - build_appimage: - name: AppImage - runs-on: ubuntu-20.04 - needs: build_linux - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Cache Sunshine build - uses: actions/cache@v2 - with: - path: build - key: ${{ runner.os }}-sunshine-build - - - name: Set AppImage Version - if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} - run: | - version=${{ needs.check_changelog.outputs.next_version_bare }} - echo "VERSION=${version}" >> $GITHUB_ENV - - name: Package AppImage - # https://docs.appimage.org/packaging-guide/index.html - run: | - mkdir -p appimage_temp && cd appimage_temp - - DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" - ICON_FILE="${ICON_FILE:-sunshine.png}" - CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" - HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" - - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage - - ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../build/sunshine -i "../$ICON_FILE" -d "../build/$DESKTOP_FILE" --output appimage - - mv sunshine*.AppImage sunshine.AppImage - mkdir sunshine && mv sunshine.AppImage sunshine/ - ./sunshine/sunshine.AppImage --appimage-portable-config - ./sunshine/sunshine.AppImage --appimage-portable-home - cp -r ../assets/* "$CONFIG_DIR" - rm -f "$CONFIG_DIR"/apps_windows.json - mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" - cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" - zip -r ./sunshine-appimage.zip ./sunshine/* - - mv sunshine-appimage.zip ../artifacts/ - - name: Verify AppImage - run: | - cd appimage_temp - wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./sunshine/sunshine.AppImage - - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-appimage - path: artifacts/ - - name: Create Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: SunshineStream/actions/create_release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - next_version: ${{ needs.check_changelog.outputs.next_version }} - last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} - - build_deb_and_rpm: - name: Build DEB and RPM - runs-on: ubuntu-20.04 - needs: build_linux - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Cache Sunshine build - uses: actions/cache@v2 - with: - path: build - key: ${{ runner.os }}-sunshine-build - - - name: Extra dependencies - run: | - sudo apt-get update -y - sudo apt-get install -y cmake # will install cpack - - - name: Build DEB and RPM + - name: Build DEB run: | cd build cpack -G DEB + mv Sunshine__.deb ../artifacts/ + + - name: Build RPM + run: | + cd build cpack -G RPM - - name: Upload RPM + mv Sunshine__.rpm ../artifacts/ + + - name: Upload Artifacts if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} uses: actions/upload-artifact@v3 with: - name: sunshine-linux-rpm - path: build/Sunshine__.rpm - - name: Upload DEB - if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-linux-deb - path: build/Sunshine__.deb - - name: Create Release - if: ${{ matrix.package == '-p' && github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: SunshineStream/actions/create_release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - next_version: ${{ needs.check_changelog.outputs.next_version }} - last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} + name: sunshine-linux + path: artifacts/ build_win: name: Windows runs-on: windows-2019 - needs: [check_versions, check_changelog] + needs: [ check_versions, check_changelog ] steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive + - name: MSYS2 Setup uses: msys2/setup-msys2@v2 with: @@ -242,46 +220,41 @@ jobs: nasm diffutils make + - name: Build Windows shell: msys2 {0} - run: | + run: | mkdir sunshine-windows-build cd sunshine-windows-build cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. mingw32-make -j2 + - name: Create packages shell: msys2 {0} run: | cd sunshine-windows-build - cpack - + + cpack -G NSIS + cpack -G 7Z + mkdir -p ../artifacts # Installers mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe - - # Standalone - del ..\assets\apps_linux.json - 7z a sunshine-windows.zip ..\assets - 7z a sunshine-windows.zip sunshine.exe - 7z a sunshine-windows.zip tools\dxgi-info.exe - 7z a sunshine-windows.zip tools\audio-info.exe - 7z a sunshine-windows.zip tools\sunshinesvc.exe - 7z a sunshine-windows.zip ..\tools\install-service.bat - 7z a sunshine-windows.zip ..\tools\uninstall-service.bat - move "sunshine-windows.zip" "../artifacts" + mv Sunshine__.7z ../artifacts/sunshine-windows-standalone.7z + - name: Upload Sunshine Installer if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: name: sunshine-windows path: artifacts - - name: Upload Sunshine executable - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-windows-standalone - path: sunshine-windows-build/artifacts/standalone + + release: + name: Create Release + runs-on: ubuntu-20.04 + needs: [ "build_win", "build_linux", "build_appimage" ] + steps: - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master @@ -289,4 +262,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} next_version: ${{ needs.check_changelog.outputs.next_version }} last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} + release_body: ${{ needs.check_changelog.outputs.release_body }} \ No newline at end of file From dc4393a583c4dc2bb28838b993c0383b56cd3d97 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 30 Apr 2022 10:02:26 +0100 Subject: [PATCH 10/47] CI: windows build packaging to ZIP, split artifacts upload for different packages --- .github/workflows/CI.yml | 44 ++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b85dfcd7..f5cd2a62 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -53,7 +53,7 @@ jobs: build_appimage: name: AppImage runs-on: ubuntu-20.04 - needs: check_changelog + needs: [ check_versions, check_changelog ] steps: - name: Checkout @@ -61,7 +61,7 @@ jobs: with: submodules: recursive - - name: Setup Dependencies AppImage + - name: Setup Dependencies run: | mkdir -p artifacts sudo apt-get update -y && \ @@ -131,14 +131,14 @@ jobs: build_linux: name: Linux runs-on: ubuntu-20.04 - needs: check_changelog + needs: [ check_versions, check_changelog ] steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - name: Setup Dependencies AppImage + - name: Setup Dependencies run: | mkdir -p artifacts sudo apt-get update -y && \ @@ -174,20 +174,27 @@ jobs: run: | cd build cpack -G DEB - mv Sunshine__.deb ../artifacts/ + mv Sunshine__.deb ../artifacts/sunshine.deb - name: Build RPM run: | cd build cpack -G RPM - mv Sunshine__.rpm ../artifacts/ + mv Sunshine__.rpm ../artifacts/sunshine.rpm - - name: Upload Artifacts - if: ${{ matrix.package == '-p' && ( github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ) }} + - name: Upload Sunshine DEB + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-linux - path: artifacts/ + name: sunshine.deb + path: artifacts/sunshine.deb + + - name: Upload Sunshine RPM + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine.rpm + path: artifacts/sunshine.rpm build_win: name: Windows @@ -235,20 +242,27 @@ jobs: cd sunshine-windows-build cpack -G NSIS - cpack -G 7Z + cpack -G ZIP mkdir -p ../artifacts # Installers mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe - mv Sunshine__.7z ../artifacts/sunshine-windows-standalone.7z + mv Sunshine__.zip ../artifacts/sunshine-windows-standalone.zip - - name: Upload Sunshine Installer + - name: Upload Sunshine Windows Installer if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-windows - path: artifacts + name: sunshine-windows-installer + path: artifacts/sunshine-windows-installer.exe + + - name: Upload Sunshine Windows Standalone + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-windows-installer + path: artifacts/sunshine-windows-standalone.zip release: name: Create Release From 31f7faa6a504cb284962240ec9ad070d3594bc54 Mon Sep 17 00:00:00 2001 From: ABeltramo Date: Sat, 30 Apr 2022 10:18:10 +0100 Subject: [PATCH 11/47] win: installation directory fix --- .github/workflows/CI.yml | 2 +- CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f5cd2a62..160fff7f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -261,7 +261,7 @@ jobs: if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-windows-installer + name: sunshine-windows-standalone path: artifacts/sunshine-windows-standalone.zip release: diff --git a/CMakeLists.txt b/CMakeLists.txt index f34a86b0..cfe45eca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -479,6 +479,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Sunshine") # The name of the directory that will be created in C:/Program files/ string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here # Sets permissions on the installed folder so that we can write in it From 2a69385aedbd1794c612d368aeff86186dddfd6a Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Apr 2022 12:38:08 -0400 Subject: [PATCH 12/47] Revert workflow logic --- .github/workflows/CI.yml | 209 ++++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 102 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 160fff7f..87a9d9fb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -5,7 +5,7 @@ on: branches: [master, nightly] types: [opened, synchronize, reopened] push: - branches: [ master ] + branches: [master] workflow_dispatch: jobs: @@ -32,12 +32,14 @@ jobs: check_versions: name: Check Versions runs-on: ubuntu-latest + needs: check_changelog + if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} + # base_ref for pull request check, ref for push steps: - name: Checkout uses: actions/checkout@v3 - name: Check CMakeLists.txt Version - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} run: | version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') echo "cmakelists_version=${version}" >> $GITHUB_ENV @@ -53,17 +55,15 @@ jobs: build_appimage: name: AppImage runs-on: ubuntu-20.04 - needs: [ check_versions, check_changelog ] - + needs: check_changelog steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - name: Setup Dependencies + - name: Setup Dependencies AppImage run: | - mkdir -p artifacts sudo apt-get update -y && \ sudo apt-get --reinstall install -y \ git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev @@ -82,11 +82,14 @@ jobs: CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" + SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} + mkdir -p appimage-build && cd appimage-build + cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr make -j ${nproc} DESTDIR=AppDir @@ -95,16 +98,21 @@ jobs: run: | version=${{ needs.check_changelog.outputs.next_version_bare }} echo "VERSION=${version}" >> $GITHUB_ENV + - name: Package AppImage # https://docs.appimage.org/packaging-guide/index.html run: | mkdir -p appimage_temp && cd appimage_temp + DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" ICON_FILE="${ICON_FILE:-sunshine.png}" CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../appimage-build/$DESKTOP_FILE" --output appimage + mv sunshine*.AppImage sunshine.AppImage mkdir sunshine && mv sunshine.AppImage sunshine/ ./sunshine/sunshine.AppImage --appimage-portable-config @@ -114,6 +122,8 @@ jobs: mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" zip -r ./sunshine-appimage.zip ./sunshine/* + + mkdir -p artifacts mv sunshine-appimage.zip ../artifacts/ - name: Verify AppImage @@ -128,17 +138,25 @@ jobs: name: sunshine-appimage path: artifacts/ + - name: Create Release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: SunshineStream/actions/create_release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + next_version: ${{ needs.check_changelog.outputs.next_version }} + last_version: ${{ needs.check_changelog.outputs.last_version }} + release_body: ${{ needs.check_changelog.outputs.release_body }} + build_linux: name: Linux runs-on: ubuntu-20.04 - needs: [ check_versions, check_changelog ] + needs: check_changelog steps: - name: Checkout uses: actions/checkout@v3 with: submodules: recursive - - - name: Setup Dependencies + - name: Setup Dependencies Linux run: | mkdir -p artifacts sudo apt-get update -y && \ @@ -154,7 +172,7 @@ jobs: sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y sudo apt-get install ffmpeg -y - - name: Build Sunshine + - name: Build Linux run: | CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" @@ -170,105 +188,24 @@ jobs: cd build cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_CONFIG_DIR=$SUNSHINE_CONFIG_DIR" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr - - name: Build DEB + - name: Package Linux run: | cd build - cpack -G DEB - mv Sunshine__.deb ../artifacts/sunshine.deb - - name: Build RPM - run: | - cd build + # package + cpack -G DEB cpack -G RPM + + # move + mv Sunshine__.deb ../artifacts/sunshine.deb mv Sunshine__.rpm ../artifacts/sunshine.rpm - - name: Upload Sunshine DEB - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + - name: Upload Artifacts + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine.deb - path: artifacts/sunshine.deb - - - name: Upload Sunshine RPM - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine.rpm - path: artifacts/sunshine.rpm - - build_win: - name: Windows - runs-on: windows-2019 - needs: [ check_versions, check_changelog ] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: MSYS2 Setup - uses: msys2/setup-msys2@v2 - with: - update: true - install: >- - base-devel - git - mingw-w64-x86_64-binutils - mingw-w64-x86_64-openssl - mingw-w64-x86_64-cmake - mingw-w64-x86_64-toolchain - mingw-w64-x86_64-opus - mingw-w64-x86_64-x265 - mingw-w64-x86_64-boost - mingw-w64-x86_64-nsis - git - yasm - nasm - diffutils - make - - - name: Build Windows - shell: msys2 {0} - run: | - mkdir sunshine-windows-build - cd sunshine-windows-build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. - mingw32-make -j2 - - - name: Create packages - shell: msys2 {0} - run: | - cd sunshine-windows-build - - cpack -G NSIS - cpack -G ZIP - - mkdir -p ../artifacts - - # Installers - mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe - mv Sunshine__.zip ../artifacts/sunshine-windows-standalone.zip - - - name: Upload Sunshine Windows Installer - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-windows-installer - path: artifacts/sunshine-windows-installer.exe - - - name: Upload Sunshine Windows Standalone - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-windows-standalone - path: artifacts/sunshine-windows-standalone.zip - - release: - name: Create Release - runs-on: ubuntu-20.04 - needs: [ "build_win", "build_linux", "build_appimage" ] - steps: + name: sunshine-linux + path: artifacts/ - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master @@ -276,4 +213,72 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} next_version: ${{ needs.check_changelog.outputs.next_version }} last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} \ No newline at end of file + release_body: ${{ needs.check_changelog.outputs.release_body }} + + build_win: + name: Windows + runs-on: windows-2019 + needs: check_changelog + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Dependencies Windows + uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + base-devel + diffutils + git + make + mingw-w64-x86_64-binutils + mingw-w64-x86_64-boost + mingw-w64-x86_64-cmake + mingw-w64-x86_64-nsis + mingw-w64-x86_64-openssl + mingw-w64-x86_64-opus + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-x265 + nasm + yasm + + - name: Build Windows + shell: msys2 {0} + run: | + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. + mingw32-make -j2 + - name: Package Windows + shell: msys2 {0} + run: | + mkdir -p artifacts + cd build + + # package + cpack -G NSIS + cpack -G ZIP + + # move + mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe + mv Sunshine__.zip ../artifacts/sunshine-windows-standalone.zip + + - name: Upload Artifacts + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-windows + path: artifacts/ + + - name: Create Release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: SunshineStream/actions/create_release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + next_version: ${{ needs.check_changelog.outputs.next_version }} + last_version: ${{ needs.check_changelog.outputs.last_version }} + release_body: ${{ needs.check_changelog.outputs.release_body }} From 369a941c48978f258eac26cc07ba959e3154d4b8 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Apr 2022 17:51:14 -0400 Subject: [PATCH 13/47] Fix artifacts folder for AppImage --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 87a9d9fb..ff36850f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -102,6 +102,7 @@ jobs: - name: Package AppImage # https://docs.appimage.org/packaging-guide/index.html run: | + mkdir -p artifacts mkdir -p appimage_temp && cd appimage_temp DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" @@ -123,7 +124,6 @@ jobs: cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" zip -r ./sunshine-appimage.zip ./sunshine/* - mkdir -p artifacts mv sunshine-appimage.zip ../artifacts/ - name: Verify AppImage From 6741997e59b739b0bb20b94e2f99af6e3f04604d Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Apr 2022 18:22:17 -0400 Subject: [PATCH 14/47] Update documentation for cpack --- docs/source/about/installation.rst | 15 +++++++++++++++ docs/source/building/linux.rst | 2 ++ docs/source/building/windows.rst | 9 +++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index d2b9d877..3900561a 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -27,6 +27,21 @@ AppImage .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:appimage?logo=github&style=for-the-badge :alt: GitHub issues by-label +The current compatibility of the AppImage is shown below. + + - [✖] Debian oldstable (buster) + - [✔] Debian stable (bullseye) + - [✔] Debian testing (bookworm) + - [✔] Debian unstable (sid) + - [✔] Ubuntu jammy + - [✔] Ubuntu impish + - [✔] Ubuntu focal + - [✖] Ubuntu bionic + - [✖] Ubuntu xenial + - [✖] Ubuntu trusty + - [✖] CentOS 7 + + #. Download and extract `sunshine-appimage.zip` Debian Packages diff --git a/docs/source/building/linux.rst b/docs/source/building/linux.rst index a6e7eefb..475e0c66 100644 --- a/docs/source/building/linux.rst +++ b/docs/source/building/linux.rst @@ -239,6 +239,8 @@ Finally .. code-block:: bash make -j ${nproc} + cpack -G DEB # optionally, create a deb package + cpack -G RPM # optionally, create a rpm package Dockerfile Builds ----------------- diff --git a/docs/source/building/windows.rst b/docs/source/building/windows.rst index 36cea881..7708da49 100644 --- a/docs/source/building/windows.rst +++ b/docs/source/building/windows.rst @@ -8,7 +8,7 @@ Requirements First you need to install `MSYS2 `_, then startup "MSYS2 MinGW 64-bit" and install the following packages using: -.. code-block:: batch +.. code-block:: bash pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git mingw-w64-x86_64-make cmake make gcc @@ -16,7 +16,12 @@ Build ----- .. Attention:: Ensure you are in the build directory created during the clone step earlier before continuing. - .. code-block:: batch + .. code-block:: bash cmake -G"Unix Makefiles" .. + cmake -G"MinGW Makefiles" .. # alternatively + mingw32-make + + cpack -G NSIS # optionally, create a windows installer + cpack -G ZIP # optionally, create a windows standalone package From 12bf5cffc5b1bb8da40a9053b7e8e17ab7110d67 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Apr 2022 19:06:19 -0400 Subject: [PATCH 15/47] Use `CMAKE_PROJECT_NAME` --- .github/workflows/CI.yml | 9 +++++---- CMakeLists.txt | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ff36850f..236d1602 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -197,8 +197,8 @@ jobs: cpack -G RPM # move - mv Sunshine__.deb ../artifacts/sunshine.deb - mv Sunshine__.rpm ../artifacts/sunshine.rpm + mv Sunshine.deb ../artifacts/sunshine.deb + mv Sunshine.rpm ../artifacts/sunshine.rpm - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -253,6 +253,7 @@ jobs: cd build cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. mingw32-make -j2 + - name: Package Windows shell: msys2 {0} run: | @@ -264,8 +265,8 @@ jobs: cpack -G ZIP # move - mv Sunshine__.exe ../artifacts/sunshine-windows-installer.exe - mv Sunshine__.zip ../artifacts/sunshine-windows-standalone.zip + mv Sunshine.exe ../artifacts/sunshine-windows-installer.exe + mv Sunshine.zip ../artifacts/sunshine-windows-standalone.zip - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index cfe45eca..02a11376 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,7 +460,7 @@ set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") set(CPACK_PACKAGE_HOMEPAGE_URL "https://sunshinestream.github.io") set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) -set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") +set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_STRIP_FILES YES) # Platform specific options @@ -479,7 +479,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "Sunshine") # The name of the directory that will be created in C:/Program files/ + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/ string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here # Sets permissions on the installed folder so that we can write in it @@ -491,15 +491,15 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h # Adding an option for the start menu and PATH set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but then it seems I can't just run it from powershell set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") - set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${PROJECT_NAME}.exe") - set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings - set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${PROJECT_NAME}.lnk' '\$INSTDIR\\\\${PROJECT_NAME}.exe'") + set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe") + set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings + set(CPACK_NSIS_CREATE_ICONS "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${CMAKE_PROJECT_NAME}.lnk' '\$INSTDIR\\\\${CMAKE_PROJECT_NAME}.exe'") # Checking for previous installed versions # set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed # Setting components groups and dependencies - set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "Sunshine") + set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_COMPONENT_WEB_DISPLAY_NAME "Web interface") set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Extra assets files") set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") From 639af4f08a86fe70f23267ab44186ec4b11c5336 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 30 Apr 2022 19:20:16 -0400 Subject: [PATCH 16/47] Add MacOS build --- .github/workflows/CI.yml | 58 ++++++++++++++++++++++++++++-- CMakeLists.txt | 8 ++--- docs/source/about/installation.rst | 20 +++++++---- docs/source/building/macos.rst | 6 ++-- 4 files changed, 78 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 236d1602..44e75515 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -215,6 +215,60 @@ jobs: last_version: ${{ needs.check_changelog.outputs.last_version }} release_body: ${{ needs.check_changelog.outputs.release_body }} + build_mac: + name: MacOS + runs-on: macos-11 + needs: check_changelog + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup Dependencies MacOS + run: | + # install dependencies using homebrew + brew install boost cmake ffmpeg opus + + # fix openssl header not found + cd /usr/local/include + ln -s ../opt/openssl/include/openssl . + + - name: Build MacOS + run: | + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets .. + make -j ${nproc} + + - name: Package MacOS + run: | + mkdir -p artifacts + cd build + + # package + cpack -G DragNDrop + + # move + mv Sunshine.dmg ../artifacts/sunshine.dmg + + - name: Upload Artifacts + if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} + uses: actions/upload-artifact@v3 + with: + name: sunshine-macos + path: artifacts/ + + - name: Create Release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: SunshineStream/actions/create_release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + next_version: ${{ needs.check_changelog.outputs.next_version }} + last_version: ${{ needs.check_changelog.outputs.last_version }} + release_body: ${{ needs.check_changelog.outputs.release_body }} + build_win: name: Windows runs-on: windows-2019 @@ -265,8 +319,8 @@ jobs: cpack -G ZIP # move - mv Sunshine.exe ../artifacts/sunshine-windows-installer.exe - mv Sunshine.zip ../artifacts/sunshine-windows-standalone.zip + mv Sunshine.exe ../artifacts/sunshine-windows.exe + mv Sunshine.zip ../artifacts/sunshine-windows.zip - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 02a11376..944bff64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,8 +127,8 @@ if(WIN32) elseif(APPLE) add_compile_definitions(SUNSHINE_PLATFORM="macos") list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_mac.json") - link_directories(/opt/homebrew/lib/) # Default brew lib location link_directories(/opt/local/lib) + link_directories(/usr/local/lib) ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) find_package(FFmpeg REQUIRED) @@ -531,9 +531,9 @@ if(APPLE) # TODO: test RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} COMPONENT Runtime) # TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop - # set(CPACK_BUNDLE_NAME "Sunshine") - # set(CPACK_BUNDLE_PLIST "${SUNSHINE_ASSETS_DIR}/info.plist") - # set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") + set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") + set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist") + set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") endif() if(UNIX AND NOT APPLE) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}") diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 3900561a..6634a714 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -78,11 +78,15 @@ MacOS .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:macos?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Install `MacPorts `_ -#. Download the `Portfile `_ from this repository to - ``/tmp`` -#. In a terminal run ``cd /tmp && sudo port install`` -#. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. +Disk Image File option: + #. Download and install ``sunshine.dmg`` + +Portfile option: + #. Install `MacPorts `_ + #. Download the `Portfile `_ from this repository + to ``/tmp`` + #. In a terminal run ``cd /tmp && sudo port install`` + #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. Windows ------- @@ -92,7 +96,11 @@ Windows .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:windows:11?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Download and extract ``sunshine-windows.zip`` +Installed option: + #. Download and install ``sunshine-windows.exe`` + +Standalone option: + #. Download and extract ``sunshine-windows.zip`` .. _latest release: https://github.com/SunshineStream/Sunshine/releases/latest .. _Dockerhub.io: https://hub.docker.com/repository/docker/sunshinestream/sunshine diff --git a/docs/source/building/macos.rst b/docs/source/building/macos.rst index 97a58a23..51ae6b15 100644 --- a/docs/source/building/macos.rst +++ b/docs/source/building/macos.rst @@ -14,14 +14,14 @@ MacPorts Install Requirements .. code-block:: bash - sudo port install cmake boost libopus ffmpeg + sudo port install cmake boost ffmpeg libopus Homebrew """""""" Install Requirements .. code-block:: bash - brew install boost cmake ffmpeg libopusenc + brew install boost cmake ffmpeg opus # if there are issues with an SSL header that is not found: cd /usr/local/include ln -s ../opt/openssl/include/openssl . @@ -35,6 +35,8 @@ Build cmake .. make -j ${nproc} + cpack -G DragNDrop # optionally, create a MacOS dmg package + If cmake fails complaining to find Boost, try to set the path explicitly. ``cmake -DBOOST_ROOT=[boost path] ..``, e.g., ``cmake -DBOOST_ROOT=/opt/local/libexec/boost/1.76 ..`` From e6d6d47be1a486a1d75248baaf20badd238245f3 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 May 2022 19:49:16 -0400 Subject: [PATCH 17/47] Create MacOS archive --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 44e75515..791fe4eb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -249,9 +249,11 @@ jobs: # package cpack -G DragNDrop + cpack -G ZIP # move - mv Sunshine.dmg ../artifacts/sunshine.dmg + mv Sunshine.dmg ../artifacts/sunshine-macos.dmg + mv Sunshine.zip ../artifacts/sunshine-macos.zip - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} From 5135c16bdaee6e35be646f939ff1bd8557cef712 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 May 2022 21:05:57 -0400 Subject: [PATCH 18/47] Update Portfile and... - Upload Portfile as artifact during builds and releases - Update assets for cpack packages --- .github/workflows/CI.yml | 1 + CMakeLists.txt | 21 ++++++++++++++++----- Portfile => Portfile.in | 18 ++++++++++-------- docs/source/about/installation.rst | 10 ++++++++-- 4 files changed, 35 insertions(+), 15 deletions(-) rename Portfile => Portfile.in (76%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 791fe4eb..0e71e2de 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -254,6 +254,7 @@ jobs: # move mv Sunshine.dmg ../artifacts/sunshine-macos.dmg mv Sunshine.zip ../artifacts/sunshine-macos.zip + mv Portfile ../artifacts/Portfile - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 944bff64..675a5725 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,7 +312,6 @@ else() if(NOT DEFINED SUNSHINE_EXECUTABLE_PATH) set(SUNSHINE_EXECUTABLE_PATH "sunshine") endif() - configure_file(sunshine.desktop.in sunshine.desktop @ONLY) configure_file(sunshine.service.in sunshine.service @ONLY) endif() @@ -448,7 +447,7 @@ endforeach() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) ############# -# CPACK +# CPACK / Packaging #### # Common options @@ -474,6 +473,8 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT web) install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(FILES "${SUNSHINE_ASSETS_DIR}/steam.png" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders" COMPONENT assets) @@ -524,6 +525,8 @@ if(APPLE) # TODO: test set(INSTALL_RUNTIME_DIR "${prefix}/MacOS") install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_mac.json" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${INSTALL_RUNTIME_DIR}") install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${INSTALL_RUNTIME_DIR}") install(TARGETS sunshine @@ -534,13 +537,18 @@ if(APPLE) # TODO: test set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") + + # Portfile + configure_file(Portfile.in Portfile @ONLY) endif() if(UNIX AND NOT APPLE) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") + install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(FILES "${SUNSHINE_ASSETS_DIR}/steam.png" DESTINATION "${SUNSHINE_CONFIG_DIR}") install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders") @@ -560,6 +568,9 @@ if(UNIX AND NOT APPLE) # Installation destination dir set(CPACK_SET_DESTDIR true) set(CMAKE_INSTALL_PREFIX "/etc/sunshine") + + # AppImage desktop file + configure_file(sunshine.desktop.in sunshine.desktop @ONLY) endif() -include(CPack) \ No newline at end of file +include(CPack) diff --git a/Portfile b/Portfile.in similarity index 76% rename from Portfile rename to Portfile.in index ea751ca8..6973ed40 100644 --- a/Portfile +++ b/Portfile.in @@ -5,25 +5,27 @@ PortGroup cmake 1.1 PortGroup github 1.0 PortGroup boost 1.0 -github.setup abusse sunshine macos-dev -version 20220224 +github.setup sunshinestream sunshine master +version @PROJECT_VERSION@ +revision 1 categories multimedia +license GPL-3 +maintainers {sunshinestream @SunshineStream} {outlook.com:anselm.busse} platforms darwin -license GPL-2 -maintainers {outlook.com:anselm.busse} fetch.type git post-fetch { system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive" } -description Sunshine is a Gamestream host for Moonlight -long_description Sunshine is a Gamestream host for Moonlight - +description Sunshine is a Gamestream host for Moonlight. +long_description {*}${description} homepage https://github.com/SunshineStream/Sunshine -depends_lib port:avahi port:ffmpeg port:libopus +depends_lib port:avahi \ + port:ffmpeg \ + port:libopus boost.version 1.76 diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 6634a714..d7e043a4 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -81,13 +81,19 @@ MacOS Disk Image File option: #. Download and install ``sunshine.dmg`` + .. Warning:: The Disk Image File is experimental. Limited support will be provided. + Portfile option: #. Install `MacPorts `_ - #. Download the `Portfile `_ from this repository - to ``/tmp`` + #. Download the ``Portfile`` to ``/tmp`` #. In a terminal run ``cd /tmp && sudo port install`` #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. +Standalone option: + #. Download and extract ``sunshine-macos.zip`` + + .. Warning:: The Standalone package is experimental. Limited support will be provided. + Windows ------- .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:windows:10?logo=github&style=for-the-badge From 8b86abfcebbddb7963eca3abbb748ccbe3ed3283 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 May 2022 22:17:07 -0400 Subject: [PATCH 19/47] Reorganize assets --- .github/workflows/CI.yml | 35 +++++---- CMakeLists.txt | 38 ++++------ assets/{ => assets_common}/box.png | Bin assets/{ => assets_common}/steam.png | Bin assets/{ => assets_common}/sunshine.conf | 2 +- assets/{ => assets_common}/web/apps.html | 0 assets/{ => assets_common}/web/clients.html | 0 assets/{ => assets_common}/web/config.html | 0 .../fonts/fontawesome-free-web/LICENSE.txt | 0 .../fonts/fontawesome-free-web/attribution.js | 0 .../fontawesome-free-web/css/all.min.css | 0 .../fontawesome-free-web/css/brands.min.css | 0 .../css/fontawesome.min.css | 0 .../fontawesome-free-web/css/regular.min.css | 0 .../fontawesome-free-web/css/solid.min.css | 0 .../css/svg-with-js.min.css | 0 .../fontawesome-free-web/css/v4-shims.min.css | 0 .../webfonts/fa-brands-400.eot | Bin .../webfonts/fa-brands-400.svg | 0 .../webfonts/fa-brands-400.ttf | Bin .../webfonts/fa-brands-400.woff | Bin .../webfonts/fa-brands-400.woff2 | Bin .../webfonts/fa-regular-400.eot | Bin .../webfonts/fa-regular-400.svg | 0 .../webfonts/fa-regular-400.ttf | Bin .../webfonts/fa-regular-400.woff | Bin .../webfonts/fa-regular-400.woff2 | Bin .../webfonts/fa-solid-900.eot | Bin .../webfonts/fa-solid-900.svg | 0 .../webfonts/fa-solid-900.ttf | Bin .../webfonts/fa-solid-900.woff | Bin .../webfonts/fa-solid-900.woff2 | Bin .../web/header-no-nav.html | 0 assets/{ => assets_common}/web/header.html | 0 .../web/images/favicon.ico | Bin .../web/images/logo-sunshine-45.png | Bin assets/{ => assets_common}/web/index.html | 0 assets/{ => assets_common}/web/password.html | 0 assets/{ => assets_common}/web/pin.html | 0 .../web/third_party/bootstrap.bundle.min.js | 0 .../web/third_party/bootstrap.min.css | 0 .../web/third_party/vue.js | 0 .../web/troubleshooting.html | 0 assets/{ => assets_common}/web/welcome.html | 0 .../apps.json} | 0 .../shaders/opengl/ConvertUV.frag | 68 +++++++++--------- .../shaders/opengl/ConvertUV.vert | 52 +++++++------- .../shaders/opengl/ConvertY.frag | 50 ++++++------- .../shaders/opengl/Scene.frag | 26 +++---- .../shaders/opengl/Scene.vert | 42 +++++------ assets/{info.plist => assets_mac/Info.plist} | 0 .../{apps_mac.json => assets_mac/apps.json} | 0 .../apps.json} | 0 .../shaders/directx/ConvertUVPS.hlsl | 64 ++++++++--------- .../shaders/directx/ConvertUVVS.hlsl | 56 +++++++-------- .../shaders/directx/ConvertYPS.hlsl | 48 ++++++------- .../shaders/directx/ScenePS.hlsl | 26 +++---- .../shaders/directx/SceneVS.hlsl | 42 +++++------ .../{ => linux-misc}/85-sunshine-rules.rules | 0 59 files changed, 271 insertions(+), 278 deletions(-) rename assets/{ => assets_common}/box.png (100%) rename assets/{ => assets_common}/steam.png (100%) rename assets/{ => assets_common}/sunshine.conf (99%) rename assets/{ => assets_common}/web/apps.html (100%) rename assets/{ => assets_common}/web/clients.html (100%) rename assets/{ => assets_common}/web/config.html (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/LICENSE.txt (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/attribution.js (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/all.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/brands.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/fontawesome.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/regular.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/solid.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/svg-with-js.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/css/v4-shims.min.css (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff (100%) rename assets/{ => assets_common}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 (100%) rename assets/{ => assets_common}/web/header-no-nav.html (100%) rename assets/{ => assets_common}/web/header.html (100%) rename assets/{ => assets_common}/web/images/favicon.ico (100%) rename assets/{ => assets_common}/web/images/logo-sunshine-45.png (100%) rename assets/{ => assets_common}/web/index.html (100%) rename assets/{ => assets_common}/web/password.html (100%) rename assets/{ => assets_common}/web/pin.html (100%) rename assets/{ => assets_common}/web/third_party/bootstrap.bundle.min.js (100%) rename assets/{ => assets_common}/web/third_party/bootstrap.min.css (100%) rename assets/{ => assets_common}/web/third_party/vue.js (100%) rename assets/{ => assets_common}/web/troubleshooting.html (100%) rename assets/{ => assets_common}/web/welcome.html (100%) rename assets/{apps_linux.json => assets_linux/apps.json} (100%) rename assets/{ => assets_linux}/shaders/opengl/ConvertUV.frag (96%) rename assets/{ => assets_linux}/shaders/opengl/ConvertUV.vert (95%) rename assets/{ => assets_linux}/shaders/opengl/ConvertY.frag (94%) rename assets/{ => assets_linux}/shaders/opengl/Scene.frag (93%) rename assets/{ => assets_linux}/shaders/opengl/Scene.vert (94%) rename assets/{info.plist => assets_mac/Info.plist} (100%) rename assets/{apps_mac.json => assets_mac/apps.json} (100%) rename assets/{apps_windows.json => assets_windows/apps.json} (100%) rename assets/{ => assets_windows}/shaders/directx/ConvertUVPS.hlsl (96%) rename assets/{ => assets_windows}/shaders/directx/ConvertUVVS.hlsl (96%) rename assets/{ => assets_windows}/shaders/directx/ConvertYPS.hlsl (95%) rename assets/{ => assets_windows}/shaders/directx/ScenePS.hlsl (95%) rename assets/{ => assets_windows}/shaders/directx/SceneVS.hlsl (95%) rename assets/{ => linux-misc}/85-sunshine-rules.rules (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0e71e2de..504e706f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -107,29 +107,34 @@ jobs: DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" ICON_FILE="${ICON_FILE:-sunshine.png}" - CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" - HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" + # CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" + # HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../appimage-build/$DESKTOP_FILE" --output appimage - mv sunshine*.AppImage sunshine.AppImage - mkdir sunshine && mv sunshine.AppImage sunshine/ - ./sunshine/sunshine.AppImage --appimage-portable-config - ./sunshine/sunshine.AppImage --appimage-portable-home - cp -r ../assets/* "$CONFIG_DIR" - rm -f "$CONFIG_DIR"/apps_windows.json - mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" - cp ./"$CONFIG_DIR"/apps_linux.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" - zip -r ./sunshine-appimage.zip ./sunshine/* + # mv sunshine*.AppImage sunshine.AppImage + # mkdir sunshine && mv sunshine.AppImage sunshine/ + # ./sunshine/sunshine.AppImage --appimage-portable-config + # ./sunshine/sunshine.AppImage --appimage-portable-home + # cp -r ../assets/assets_common/* "$CONFIG_DIR" + # cp -r ../assets/assets_linux/* "$CONFIG_DIR" - mv sunshine-appimage.zip ../artifacts/ + # mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" + # cp ./"$CONFIG_DIR"/apps.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" + # zip -r ./sunshine-appimage.zip ./sunshine/* + + # mv sunshine-appimage.zip ../artifacts/ + + mv sunshine*.AppImage ../artifacts/sunshine.AppImage + + # if testing succeeds, can remove commented lines - name: Verify AppImage run: | - cd appimage_temp - wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./sunshine/sunshine.AppImage + # cd appimage_temp + wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -318,7 +323,7 @@ jobs: cd build # package - cpack -G NSIS + cpack -G NSIS cpack -G ZIP # move diff --git a/CMakeLists.txt b/CMakeLists.txt index 675a5725..ec31a2a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,8 +66,6 @@ if(WIN32) add_compile_definitions(SUNSHINE_PLATFORM="windows") add_subdirectory(tools) #This is temporary, only tools for Windows are needed, for now - list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_windows.json") - include_directories(third-party/ViGEmClient/include) if(NOT DEFINED SUNSHINE_ICON_PATH) @@ -126,7 +124,6 @@ if(WIN32) set_source_files_properties(third-party/ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-misleading-indentation -Wno-class-memaccess") elseif(APPLE) add_compile_definitions(SUNSHINE_PLATFORM="macos") - list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_mac.json") link_directories(/opt/local/lib) link_directories(/usr/local/lib) ADD_DEFINITIONS(-DBOOST_LOG_DYN_LINK) @@ -163,10 +160,9 @@ elseif(APPLE) sunshine/platform/macos/publish.cpp sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.c sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.h - ${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist) + ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) else() add_compile_definitions(SUNSHINE_PLATFORM="linux") - list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_linux.json") option(SUNSHINE_ENABLE_DRM "Enable KMS grab if available" ON) option(SUNSHINE_ENABLE_X11 "Enable X11 grab if available" ON) @@ -423,6 +419,7 @@ endif() list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_DEFAULT_DIR="${SUNSHINE_DEFAULT_DIR}") +list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps.json") add_executable(sunshine ${SUNSHINE_TARGET_FILES}) target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS}) target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS}) @@ -437,7 +434,7 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD) endif() if(APPLE) - target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist) + target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) endif() foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) @@ -471,12 +468,8 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio) install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT web) - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_windows.json" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - install(FILES "${SUNSHINE_ASSETS_DIR}/steam.png" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/directx" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders" COMPONENT assets) + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_windows/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") @@ -517,17 +510,15 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_AUDIO_GROUP "Extra Tools") set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Extra Tools") - set(CPACK_COMPONENT_APPLICATION_DEPENDS web assets) + set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) endif() if(APPLE) # TODO: test set(prefix "${CMAKE_PROJECT_NAME}.app/Contents") set(INSTALL_RUNTIME_DIR "${prefix}/MacOS") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${INSTALL_RUNTIME_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_mac.json" DESTINATION "${INSTALL_RUNTIME_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${INSTALL_RUNTIME_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_mac/" DESTINATION "${INSTALL_RUNTIME_DIR}") install(TARGETS sunshine BUNDLE DESTINATION . COMPONENT Runtime @@ -535,23 +526,20 @@ if(APPLE) # TODO: test # TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") - set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets/Info.plist") + set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets_mac/Info.plist") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") # Portfile configure_file(Portfile.in Portfile @ONLY) endif() if(UNIX AND NOT APPLE) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/web" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") - install(FILES "${SUNSHINE_ASSETS_DIR}/apps_linux.json" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/box.png" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/steam.png" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/sunshine.conf" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_linux/" DESTINATION "${SUNSHINE_CONFIG_DIR}") + + install(FILES "${SUNSHINE_ASSETS_DIR}/linux-misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/shaders/opengl" DESTINATION "${SUNSHINE_CONFIG_DIR}/shaders") # Pre and post install set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA diff --git a/assets/box.png b/assets/assets_common/box.png similarity index 100% rename from assets/box.png rename to assets/assets_common/box.png diff --git a/assets/steam.png b/assets/assets_common/steam.png similarity index 100% rename from assets/steam.png rename to assets/assets_common/steam.png diff --git a/assets/sunshine.conf b/assets/assets_common/sunshine.conf similarity index 99% rename from assets/sunshine.conf rename to assets/assets_common/sunshine.conf index 509ff52a..04d51c2a 100644 --- a/assets/sunshine.conf +++ b/assets/assets_common/sunshine.conf @@ -1 +1 @@ -# See our documentation at https://sunshinestream.readthedocs.io/en/latest/about/advanced_usage.html +# See our documentation at https://sunshinestream.readthedocs.io/en/latest/about/advanced_usage.html diff --git a/assets/web/apps.html b/assets/assets_common/web/apps.html similarity index 100% rename from assets/web/apps.html rename to assets/assets_common/web/apps.html diff --git a/assets/web/clients.html b/assets/assets_common/web/clients.html similarity index 100% rename from assets/web/clients.html rename to assets/assets_common/web/clients.html diff --git a/assets/web/config.html b/assets/assets_common/web/config.html similarity index 100% rename from assets/web/config.html rename to assets/assets_common/web/config.html diff --git a/assets/web/fonts/fontawesome-free-web/LICENSE.txt b/assets/assets_common/web/fonts/fontawesome-free-web/LICENSE.txt similarity index 100% rename from assets/web/fonts/fontawesome-free-web/LICENSE.txt rename to assets/assets_common/web/fonts/fontawesome-free-web/LICENSE.txt diff --git a/assets/web/fonts/fontawesome-free-web/attribution.js b/assets/assets_common/web/fonts/fontawesome-free-web/attribution.js similarity index 100% rename from assets/web/fonts/fontawesome-free-web/attribution.js rename to assets/assets_common/web/fonts/fontawesome-free-web/attribution.js diff --git a/assets/web/fonts/fontawesome-free-web/css/all.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/all.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/all.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/all.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/brands.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/brands.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/brands.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/brands.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/fontawesome.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/fontawesome.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/fontawesome.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/fontawesome.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/regular.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/regular.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/regular.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/regular.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/solid.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/solid.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/solid.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/solid.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/svg-with-js.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/svg-with-js.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/svg-with-js.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/svg-with-js.min.css diff --git a/assets/web/fonts/fontawesome-free-web/css/v4-shims.min.css b/assets/assets_common/web/fonts/fontawesome-free-web/css/v4-shims.min.css similarity index 100% rename from assets/web/fonts/fontawesome-free-web/css/v4-shims.min.css rename to assets/assets_common/web/fonts/fontawesome-free-web/css/v4-shims.min.css diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff diff --git a/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 b/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 similarity index 100% rename from assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 rename to assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 diff --git a/assets/web/header-no-nav.html b/assets/assets_common/web/header-no-nav.html similarity index 100% rename from assets/web/header-no-nav.html rename to assets/assets_common/web/header-no-nav.html diff --git a/assets/web/header.html b/assets/assets_common/web/header.html similarity index 100% rename from assets/web/header.html rename to assets/assets_common/web/header.html diff --git a/assets/web/images/favicon.ico b/assets/assets_common/web/images/favicon.ico similarity index 100% rename from assets/web/images/favicon.ico rename to assets/assets_common/web/images/favicon.ico diff --git a/assets/web/images/logo-sunshine-45.png b/assets/assets_common/web/images/logo-sunshine-45.png similarity index 100% rename from assets/web/images/logo-sunshine-45.png rename to assets/assets_common/web/images/logo-sunshine-45.png diff --git a/assets/web/index.html b/assets/assets_common/web/index.html similarity index 100% rename from assets/web/index.html rename to assets/assets_common/web/index.html diff --git a/assets/web/password.html b/assets/assets_common/web/password.html similarity index 100% rename from assets/web/password.html rename to assets/assets_common/web/password.html diff --git a/assets/web/pin.html b/assets/assets_common/web/pin.html similarity index 100% rename from assets/web/pin.html rename to assets/assets_common/web/pin.html diff --git a/assets/web/third_party/bootstrap.bundle.min.js b/assets/assets_common/web/third_party/bootstrap.bundle.min.js similarity index 100% rename from assets/web/third_party/bootstrap.bundle.min.js rename to assets/assets_common/web/third_party/bootstrap.bundle.min.js diff --git a/assets/web/third_party/bootstrap.min.css b/assets/assets_common/web/third_party/bootstrap.min.css similarity index 100% rename from assets/web/third_party/bootstrap.min.css rename to assets/assets_common/web/third_party/bootstrap.min.css diff --git a/assets/web/third_party/vue.js b/assets/assets_common/web/third_party/vue.js similarity index 100% rename from assets/web/third_party/vue.js rename to assets/assets_common/web/third_party/vue.js diff --git a/assets/web/troubleshooting.html b/assets/assets_common/web/troubleshooting.html similarity index 100% rename from assets/web/troubleshooting.html rename to assets/assets_common/web/troubleshooting.html diff --git a/assets/web/welcome.html b/assets/assets_common/web/welcome.html similarity index 100% rename from assets/web/welcome.html rename to assets/assets_common/web/welcome.html diff --git a/assets/apps_linux.json b/assets/assets_linux/apps.json similarity index 100% rename from assets/apps_linux.json rename to assets/assets_linux/apps.json diff --git a/assets/shaders/opengl/ConvertUV.frag b/assets/assets_linux/shaders/opengl/ConvertUV.frag similarity index 96% rename from assets/shaders/opengl/ConvertUV.frag rename to assets/assets_linux/shaders/opengl/ConvertUV.frag index 416e1e8b..4bd08287 100644 --- a/assets/shaders/opengl/ConvertUV.frag +++ b/assets/assets_linux/shaders/opengl/ConvertUV.frag @@ -1,35 +1,35 @@ -#version 300 es - -#ifdef GL_ES -precision lowp float; -#endif - -uniform sampler2D image; - -layout(shared) uniform ColorMatrix { - vec4 color_vec_y; - vec4 color_vec_u; - vec4 color_vec_v; - vec2 range_y; - vec2 range_uv; -}; - -in vec3 uuv; -layout(location = 0) out vec2 color; - -//-------------------------------------------------------------------------------------- -// Pixel Shader -//-------------------------------------------------------------------------------------- -void main() { - vec3 rgb_left = texture(image, uuv.xz).rgb; - vec3 rgb_right = texture(image, uuv.yz).rgb; - vec3 rgb = (rgb_left + rgb_right) * 0.5; - - float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; - float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; - - u = u * range_uv.x + range_uv.y; - v = v * range_uv.x + range_uv.y; - - color = vec2(u, v * 224.0f / 256.0f + 0.0625); +#version 300 es + +#ifdef GL_ES +precision lowp float; +#endif + +uniform sampler2D image; + +layout(shared) uniform ColorMatrix { + vec4 color_vec_y; + vec4 color_vec_u; + vec4 color_vec_v; + vec2 range_y; + vec2 range_uv; +}; + +in vec3 uuv; +layout(location = 0) out vec2 color; + +//-------------------------------------------------------------------------------------- +// Pixel Shader +//-------------------------------------------------------------------------------------- +void main() { + vec3 rgb_left = texture(image, uuv.xz).rgb; + vec3 rgb_right = texture(image, uuv.yz).rgb; + vec3 rgb = (rgb_left + rgb_right) * 0.5; + + float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; + float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; + + u = u * range_uv.x + range_uv.y; + v = v * range_uv.x + range_uv.y; + + color = vec2(u, v * 224.0f / 256.0f + 0.0625); } \ No newline at end of file diff --git a/assets/shaders/opengl/ConvertUV.vert b/assets/assets_linux/shaders/opengl/ConvertUV.vert similarity index 95% rename from assets/shaders/opengl/ConvertUV.vert rename to assets/assets_linux/shaders/opengl/ConvertUV.vert index a71fe58d..70c14f4c 100644 --- a/assets/shaders/opengl/ConvertUV.vert +++ b/assets/assets_linux/shaders/opengl/ConvertUV.vert @@ -1,27 +1,27 @@ -#version 300 es - -#ifdef GL_ES -precision mediump float; -#endif - -uniform float width_i; - -out vec3 uuv; -//-------------------------------------------------------------------------------------- -// Vertex Shader -//-------------------------------------------------------------------------------------- -void main() -{ - float idHigh = float(gl_VertexID >> 1); - float idLow = float(gl_VertexID & int(1)); - - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; - - float u_right = idHigh * 2.0; - float u_left = u_right - width_i; - float v = idLow * 2.0; - - uuv = vec3(u_left, u_right, v); - gl_Position = vec4(x, y, 0.0, 1.0); +#version 300 es + +#ifdef GL_ES +precision mediump float; +#endif + +uniform float width_i; + +out vec3 uuv; +//-------------------------------------------------------------------------------------- +// Vertex Shader +//-------------------------------------------------------------------------------------- +void main() +{ + float idHigh = float(gl_VertexID >> 1); + float idLow = float(gl_VertexID & int(1)); + + float x = idHigh * 4.0 - 1.0; + float y = idLow * 4.0 - 1.0; + + float u_right = idHigh * 2.0; + float u_left = u_right - width_i; + float v = idLow * 2.0; + + uuv = vec3(u_left, u_right, v); + gl_Position = vec4(x, y, 0.0, 1.0); } \ No newline at end of file diff --git a/assets/shaders/opengl/ConvertY.frag b/assets/assets_linux/shaders/opengl/ConvertY.frag similarity index 94% rename from assets/shaders/opengl/ConvertY.frag rename to assets/assets_linux/shaders/opengl/ConvertY.frag index 564fa25a..dfd5774e 100644 --- a/assets/shaders/opengl/ConvertY.frag +++ b/assets/assets_linux/shaders/opengl/ConvertY.frag @@ -1,26 +1,26 @@ -#version 300 es - -#ifdef GL_ES -precision lowp float; -#endif - -uniform sampler2D image; - -layout(shared) uniform ColorMatrix { - vec4 color_vec_y; - vec4 color_vec_u; - vec4 color_vec_v; - vec2 range_y; - vec2 range_uv; -}; - -in vec2 tex; -layout(location = 0) out float color; - -void main() -{ - vec3 rgb = texture(image, tex).rgb; - float y = dot(color_vec_y.xyz, rgb); - - color = y * range_y.x + range_y.y; +#version 300 es + +#ifdef GL_ES +precision lowp float; +#endif + +uniform sampler2D image; + +layout(shared) uniform ColorMatrix { + vec4 color_vec_y; + vec4 color_vec_u; + vec4 color_vec_v; + vec2 range_y; + vec2 range_uv; +}; + +in vec2 tex; +layout(location = 0) out float color; + +void main() +{ + vec3 rgb = texture(image, tex).rgb; + float y = dot(color_vec_y.xyz, rgb); + + color = y * range_y.x + range_y.y; } \ No newline at end of file diff --git a/assets/shaders/opengl/Scene.frag b/assets/assets_linux/shaders/opengl/Scene.frag similarity index 93% rename from assets/shaders/opengl/Scene.frag rename to assets/assets_linux/shaders/opengl/Scene.frag index 6375f1fd..ee4b36b9 100644 --- a/assets/shaders/opengl/Scene.frag +++ b/assets/assets_linux/shaders/opengl/Scene.frag @@ -1,14 +1,14 @@ -#version 300 es - -#ifdef GL_ES -precision lowp float; -#endif - -uniform sampler2D image; - -in vec2 tex; -layout(location = 0) out vec4 color; -void main() -{ - color = texture(image, tex); +#version 300 es + +#ifdef GL_ES +precision lowp float; +#endif + +uniform sampler2D image; + +in vec2 tex; +layout(location = 0) out vec4 color; +void main() +{ + color = texture(image, tex); } \ No newline at end of file diff --git a/assets/shaders/opengl/Scene.vert b/assets/assets_linux/shaders/opengl/Scene.vert similarity index 94% rename from assets/shaders/opengl/Scene.vert rename to assets/assets_linux/shaders/opengl/Scene.vert index 258878f4..24c16bef 100644 --- a/assets/shaders/opengl/Scene.vert +++ b/assets/assets_linux/shaders/opengl/Scene.vert @@ -1,22 +1,22 @@ -#version 300 es - -#ifdef GL_ES -precision mediump float; -#endif - -out vec2 tex; - -void main() -{ - float idHigh = float(gl_VertexID >> 1); - float idLow = float(gl_VertexID & int(1)); - - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; - - float u = idHigh * 2.0; - float v = idLow * 2.0; - - gl_Position = vec4(x, y, 0.0, 1.0); - tex = vec2(u, v); +#version 300 es + +#ifdef GL_ES +precision mediump float; +#endif + +out vec2 tex; + +void main() +{ + float idHigh = float(gl_VertexID >> 1); + float idLow = float(gl_VertexID & int(1)); + + float x = idHigh * 4.0 - 1.0; + float y = idLow * 4.0 - 1.0; + + float u = idHigh * 2.0; + float v = idLow * 2.0; + + gl_Position = vec4(x, y, 0.0, 1.0); + tex = vec2(u, v); } \ No newline at end of file diff --git a/assets/info.plist b/assets/assets_mac/Info.plist similarity index 100% rename from assets/info.plist rename to assets/assets_mac/Info.plist diff --git a/assets/apps_mac.json b/assets/assets_mac/apps.json similarity index 100% rename from assets/apps_mac.json rename to assets/assets_mac/apps.json diff --git a/assets/apps_windows.json b/assets/assets_windows/apps.json similarity index 100% rename from assets/apps_windows.json rename to assets/assets_windows/apps.json diff --git a/assets/shaders/directx/ConvertUVPS.hlsl b/assets/assets_windows/shaders/directx/ConvertUVPS.hlsl similarity index 96% rename from assets/shaders/directx/ConvertUVPS.hlsl rename to assets/assets_windows/shaders/directx/ConvertUVPS.hlsl index 2b72cddf..f9bf69df 100644 --- a/assets/shaders/directx/ConvertUVPS.hlsl +++ b/assets/assets_windows/shaders/directx/ConvertUVPS.hlsl @@ -1,33 +1,33 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct FragTexWide { - float3 uuv : TEXCOORD0; -}; - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -//-------------------------------------------------------------------------------------- -// Pixel Shader -//-------------------------------------------------------------------------------------- -float2 main_ps(FragTexWide input) : SV_Target -{ - float3 rgb_left = image.Sample(def_sampler, input.uuv.xz).rgb; - float3 rgb_right = image.Sample(def_sampler, input.uuv.yz).rgb; - float3 rgb = (rgb_left + rgb_right) * 0.5; - - float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; - float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; - - u = u * range_uv.x + range_uv.y; - v = v * range_uv.x + range_uv.y; - - return float2(u, v * 224.0f/256.0f + 0.0625); +Texture2D image : register(t0); + +SamplerState def_sampler : register(s0); + +struct FragTexWide { + float3 uuv : TEXCOORD0; +}; + +cbuffer ColorMatrix : register(b0) { + float4 color_vec_y; + float4 color_vec_u; + float4 color_vec_v; + float2 range_y; + float2 range_uv; +}; + +//-------------------------------------------------------------------------------------- +// Pixel Shader +//-------------------------------------------------------------------------------------- +float2 main_ps(FragTexWide input) : SV_Target +{ + float3 rgb_left = image.Sample(def_sampler, input.uuv.xz).rgb; + float3 rgb_right = image.Sample(def_sampler, input.uuv.yz).rgb; + float3 rgb = (rgb_left + rgb_right) * 0.5; + + float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w; + float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w; + + u = u * range_uv.x + range_uv.y; + v = v * range_uv.x + range_uv.y; + + return float2(u, v * 224.0f/256.0f + 0.0625); } \ No newline at end of file diff --git a/assets/shaders/directx/ConvertUVVS.hlsl b/assets/assets_windows/shaders/directx/ConvertUVVS.hlsl similarity index 96% rename from assets/shaders/directx/ConvertUVVS.hlsl rename to assets/assets_windows/shaders/directx/ConvertUVVS.hlsl index 66d97d43..77ff38d7 100644 --- a/assets/shaders/directx/ConvertUVVS.hlsl +++ b/assets/assets_windows/shaders/directx/ConvertUVVS.hlsl @@ -1,29 +1,29 @@ -struct VertTexPosWide { - float3 uuv : TEXCOORD; - float4 pos : SV_POSITION; -}; - -cbuffer info : register(b0) { - float width_i; -}; - -//-------------------------------------------------------------------------------------- -// Vertex Shader -//-------------------------------------------------------------------------------------- -VertTexPosWide main_vs(uint vI : SV_VERTEXID) -{ - float idHigh = float(vI >> 1); - float idLow = float(vI & uint(1)); - - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; - - float u_right = idHigh * 2.0; - float u_left = u_right - width_i; - float v = 1.0 - idLow * 2.0; - - VertTexPosWide vert_out; - vert_out.uuv = float3(u_left, u_right, v); - vert_out.pos = float4(x, y, 0.0, 1.0); - return vert_out; +struct VertTexPosWide { + float3 uuv : TEXCOORD; + float4 pos : SV_POSITION; +}; + +cbuffer info : register(b0) { + float width_i; +}; + +//-------------------------------------------------------------------------------------- +// Vertex Shader +//-------------------------------------------------------------------------------------- +VertTexPosWide main_vs(uint vI : SV_VERTEXID) +{ + float idHigh = float(vI >> 1); + float idLow = float(vI & uint(1)); + + float x = idHigh * 4.0 - 1.0; + float y = idLow * 4.0 - 1.0; + + float u_right = idHigh * 2.0; + float u_left = u_right - width_i; + float v = 1.0 - idLow * 2.0; + + VertTexPosWide vert_out; + vert_out.uuv = float3(u_left, u_right, v); + vert_out.pos = float4(x, y, 0.0, 1.0); + return vert_out; } \ No newline at end of file diff --git a/assets/shaders/directx/ConvertYPS.hlsl b/assets/assets_windows/shaders/directx/ConvertYPS.hlsl similarity index 95% rename from assets/shaders/directx/ConvertYPS.hlsl rename to assets/assets_windows/shaders/directx/ConvertYPS.hlsl index 386133c8..c38d19c8 100644 --- a/assets/shaders/directx/ConvertYPS.hlsl +++ b/assets/assets_windows/shaders/directx/ConvertYPS.hlsl @@ -1,25 +1,25 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -cbuffer ColorMatrix : register(b0) { - float4 color_vec_y; - float4 color_vec_u; - float4 color_vec_v; - float2 range_y; - float2 range_uv; -}; - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -float main_ps(PS_INPUT frag_in) : SV_Target -{ - float3 rgb = image.Sample(def_sampler, frag_in.tex, 0).rgb; - float y = dot(color_vec_y.xyz, rgb); - - return y * range_y.x + range_y.y; +Texture2D image : register(t0); + +SamplerState def_sampler : register(s0); + +cbuffer ColorMatrix : register(b0) { + float4 color_vec_y; + float4 color_vec_u; + float4 color_vec_v; + float2 range_y; + float2 range_uv; +}; + +struct PS_INPUT +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD; +}; + +float main_ps(PS_INPUT frag_in) : SV_Target +{ + float3 rgb = image.Sample(def_sampler, frag_in.tex, 0).rgb; + float y = dot(color_vec_y.xyz, rgb); + + return y * range_y.x + range_y.y; } \ No newline at end of file diff --git a/assets/shaders/directx/ScenePS.hlsl b/assets/assets_windows/shaders/directx/ScenePS.hlsl similarity index 95% rename from assets/shaders/directx/ScenePS.hlsl rename to assets/assets_windows/shaders/directx/ScenePS.hlsl index aa601231..53a9bc8d 100644 --- a/assets/shaders/directx/ScenePS.hlsl +++ b/assets/assets_windows/shaders/directx/ScenePS.hlsl @@ -1,14 +1,14 @@ -Texture2D image : register(t0); - -SamplerState def_sampler : register(s0); - -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -float4 main_ps(PS_INPUT frag_in) : SV_Target -{ - return image.Sample(def_sampler, frag_in.tex, 0); +Texture2D image : register(t0); + +SamplerState def_sampler : register(s0); + +struct PS_INPUT +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD; +}; + +float4 main_ps(PS_INPUT frag_in) : SV_Target +{ + return image.Sample(def_sampler, frag_in.tex, 0); } \ No newline at end of file diff --git a/assets/shaders/directx/SceneVS.hlsl b/assets/assets_windows/shaders/directx/SceneVS.hlsl similarity index 95% rename from assets/shaders/directx/SceneVS.hlsl rename to assets/assets_windows/shaders/directx/SceneVS.hlsl index 51319ddb..3afaffc6 100644 --- a/assets/shaders/directx/SceneVS.hlsl +++ b/assets/assets_windows/shaders/directx/SceneVS.hlsl @@ -1,22 +1,22 @@ -struct PS_INPUT -{ - float4 pos : SV_POSITION; - float2 tex : TEXCOORD; -}; - -PS_INPUT main_vs(uint vI : SV_VERTEXID) -{ - float idHigh = float(vI >> 1); - float idLow = float(vI & uint(1)); - - float x = idHigh * 4.0 - 1.0; - float y = idLow * 4.0 - 1.0; - - float u = idHigh * 2.0; - float v = 1.0 - idLow * 2.0; - - PS_INPUT vert_out; - vert_out.pos = float4(x, y, 0.0, 1.0); - vert_out.tex = float2(u, v); - return vert_out; +struct PS_INPUT +{ + float4 pos : SV_POSITION; + float2 tex : TEXCOORD; +}; + +PS_INPUT main_vs(uint vI : SV_VERTEXID) +{ + float idHigh = float(vI >> 1); + float idLow = float(vI & uint(1)); + + float x = idHigh * 4.0 - 1.0; + float y = idLow * 4.0 - 1.0; + + float u = idHigh * 2.0; + float v = 1.0 - idLow * 2.0; + + PS_INPUT vert_out; + vert_out.pos = float4(x, y, 0.0, 1.0); + vert_out.tex = float2(u, v); + return vert_out; } \ No newline at end of file diff --git a/assets/85-sunshine-rules.rules b/assets/linux-misc/85-sunshine-rules.rules similarity index 100% rename from assets/85-sunshine-rules.rules rename to assets/linux-misc/85-sunshine-rules.rules From ca6f02c953768520786f2d4221efe1919a16618d Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 5 May 2022 23:58:08 -0400 Subject: [PATCH 20/47] Modify windows installer --- CMakeLists.txt | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec31a2a9..93ff2307 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -471,8 +471,9 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_windows/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") - set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") + set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") + set(CPACK_NSIS_MUI_HEADERIMAGE "${CPACK_PACKAGE_ICON}") # Header image for installer set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/ string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here @@ -483,7 +484,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h ") # Adding an option for the start menu and PATH - set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but then it seems I can't just run it from powershell + set(CPACK_NSIS_MODIFY_PATH "ON") # TODO: it asks to add it to the PATH but then it seems I can't just run it from powershell set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe") set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings @@ -493,22 +494,33 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h # set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") # TODO: doesn't work on my machine when Sunshine is already installed # Setting components groups and dependencies + # sunshine binary set(CPACK_COMPONENT_APPLICATION_DISPLAY_NAME "${CMAKE_PROJECT_NAME}") - set(CPACK_COMPONENT_WEB_DISPLAY_NAME "Web interface") - set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Extra assets files") - set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") + set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "The main application.") + set(CPACK_COMPONENT_APPLICATION_GROUP "${CMAKE_PROJECT_NAME}") + set(CPACK_COMPONENT_APPLICATION_REQUIRED true) - set(CPACK_COMPONENT_APPLICATION_GROUP "Runtime") - set(CPACK_COMPONENT_WEB_GROUP "Runtime") - set(CPACK_COMPONENT_ASSETS_GROUP "Runtime") + # assets + set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets") + set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Assets include the apps and configurations, shaders, default box art, and web ui.") + set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}") + set(CPACK_COMPONENT_ASSETS_DEPENDS "${CMAKE_PROJECT_NAME}") + set(CPACK_COMPONENT_ASSETS_REQUIRED true) - set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info.exe") + # audio tool set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe") - set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc.exe") + set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool that allows you to get information about sound devices.") + set(CPACK_COMPONENT_AUDIO_GROUP "Tools") - set(CPACK_COMPONENT_DXGI_GROUP "Extra Tools") - set(CPACK_COMPONENT_AUDIO_GROUP "Extra Tools") - set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Extra Tools") + # display tool + set(CPACK_COMPONENT_DXGI_DISPLAY_NAME "dxgi-info.exe") + set(CPACK_COMPONENT_DXGI_DESCRIPTION "CLI tool that allows you to get information about graphics cards and displays.") + set(CPACK_COMPONENT_DXGI_GROUP "Tools") + + # service tool + set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc.exe") + set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.") + set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) endif() From 0d0496adf331670f6ea4f050af2c76b79d74b902 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 10:04:29 -0400 Subject: [PATCH 21/47] Remove CPACK_NSIS_MUI_HEADERIMAGE --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93ff2307..2c09a1cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -471,9 +471,11 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_windows/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + + # set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp + set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\sunshine.ico") set(CPACK_NSIS_INSTALLED_ICON_NAME "${PROJECT__DIR}\\\\${PROJECT_EXE}") - set(CPACK_NSIS_MUI_HEADERIMAGE "${CPACK_PACKAGE_ICON}") # Header image for installer set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}") # The name of the directory that will be created in C:/Program files/ string(APPEND CPACK_NSIS_DEFINES "\n RequestExecutionLevel admin") # TODO: Not sure if this is needed but it took me a while to figure out where to put this option so I'm leaving it here From c4441db606d37c34a69d6dc5299a9955155156c0 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 10:16:59 -0400 Subject: [PATCH 22/47] Remove CPACK_COMPONENT_APPLICATION_DEPENDS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c09a1cd..c12957b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -524,7 +524,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.") set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") - set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) + # set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) endif() if(APPLE) # TODO: test From c409022df53d273c03e9f1812d6e1a4e6780e78f Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 12:55:43 -0400 Subject: [PATCH 23/47] Combine AppImage and Linux build --- .github/workflows/CI.yml | 155 +++++++++------------------------------ CMakeLists.txt | 9 +-- 2 files changed, 39 insertions(+), 125 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 504e706f..e9d2a4bc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,106 +52,6 @@ jobs: echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})" exit 1 - build_appimage: - name: AppImage - runs-on: ubuntu-20.04 - needs: check_changelog - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Setup Dependencies AppImage - run: | - sudo apt-get update -y && \ - sudo apt-get --reinstall install -y \ - git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 - sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run - sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run - sudo add-apt-repository ppa:savoury1/graphics -y - sudo add-apt-repository ppa:savoury1/multimedia -y - sudo add-apt-repository ppa:savoury1/ffmpeg4 -y - sudo apt-get update -y - sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y - sudo apt-get install ffmpeg -y - - - name: Build AppImage - run: | - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" - SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" - SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR:-sunshine.AppImage.config}" - - SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} - SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} - SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} - SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} - - mkdir -p appimage-build && cd appimage-build - - cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr - make -j ${nproc} DESTDIR=AppDir - - - name: Set AppImage Version - if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} - run: | - version=${{ needs.check_changelog.outputs.next_version_bare }} - echo "VERSION=${version}" >> $GITHUB_ENV - - - name: Package AppImage - # https://docs.appimage.org/packaging-guide/index.html - run: | - mkdir -p artifacts - mkdir -p appimage_temp && cd appimage_temp - - DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" - ICON_FILE="${ICON_FILE:-sunshine.png}" - # CONFIG_DIR="${CONFIG_DIR:-sunshine/sunshine.AppImage.config/}" - # HOME_DIR="${HOME_DIR:-sunshine/sunshine.AppImage.home/}" - - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage - - ./linuxdeploy-x86_64.AppImage --appdir ../AppDir -e ../appimage-build/sunshine -i "../$ICON_FILE" -d "../appimage-build/$DESKTOP_FILE" --output appimage - - # mv sunshine*.AppImage sunshine.AppImage - # mkdir sunshine && mv sunshine.AppImage sunshine/ - # ./sunshine/sunshine.AppImage --appimage-portable-config - # ./sunshine/sunshine.AppImage --appimage-portable-home - # cp -r ../assets/assets_common/* "$CONFIG_DIR" - # cp -r ../assets/assets_linux/* "$CONFIG_DIR" - - # mkdir -p ./"$HOME_DIR"/.config/"$CONFIG_DIR" - # cp ./"$CONFIG_DIR"/apps.json ./"$HOME_DIR"/.config/"$CONFIG_DIR" - # zip -r ./sunshine-appimage.zip ./sunshine/* - - # mv sunshine-appimage.zip ../artifacts/ - - mv sunshine*.AppImage ../artifacts/sunshine.AppImage - - # if testing succeeds, can remove commented lines - - - name: Verify AppImage - run: | - # cd appimage_temp - wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage && chmod +x appimagelint-x86_64.AppImage && ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - - - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} - uses: actions/upload-artifact@v3 - with: - name: sunshine-appimage - path: artifacts/ - - - name: Create Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: SunshineStream/actions/create_release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - next_version: ${{ needs.check_changelog.outputs.next_version }} - last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} - build_linux: name: Linux runs-on: ubuntu-20.04 @@ -163,7 +63,6 @@ jobs: submodules: recursive - name: Setup Dependencies Linux run: | - mkdir -p artifacts sudo apt-get update -y && \ sudo apt-get --reinstall install -y \ git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev @@ -179,31 +78,47 @@ jobs: - name: Build Linux run: | - CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" - SUNSHINE_EXECUTABLE_PATH="${SUNSHINE_EXECUTABLE_PATH:-/usr/bin/sunshine}" - SUNSHINE_ENABLE_WAYLAND=${SUNSHINE_ENABLE_WAYLAND:-ON} - SUNSHINE_ENABLE_X11=${SUNSHINE_ENABLE_X11:-ON} - SUNSHINE_ENABLE_DRM=${SUNSHINE_ENABLE_DRM:-ON} - SUNSHINE_ENABLE_CUDA=${SUNSHINE_ENABLE_CUDA:-ON} - SUNSHINE_CONFIG_DIR=${SUNSHINE_CONFIG_DIR:-.} - - mkdir -p build - mkdir -p artifacts + mkdir -p build cd build - cmake "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE" "-DSUNSHINE_CONFIG_DIR=$SUNSHINE_CONFIG_DIR" "-DSUNSHINE_EXECUTABLE_PATH=$SUNSHINE_EXECUTABLE_PATH" "-DSUNSHINE_ASSETS_DIR=$SUNSHINE_ASSETS_DIR" "-DSUNSHINE_ENABLE_WAYLAND=$SUNSHINE_ENABLE_WAYLAND" "-DSUNSHINE_ENABLE_X11=$SUNSHINE_ENABLE_X11" "-DSUNSHINE_ENABLE_DRM=$SUNSHINE_ENABLE_DRM" "-DSUNSHINE_ENABLE_CUDA=$SUNSHINE_ENABLE_CUDA" "../" -DCMAKE_INSTALL_PREFIX=/usr + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../" + make -j ${nproc} + + - name: Set AppImage Version + if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} + run: | + version=${{ needs.check_changelog.outputs.next_version_bare }} + echo "VERSION=${version}" >> $GITHUB_ENV - name: Package Linux run: | + mkdir -p artifacts cd build + + # variables + DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" + ICON_FILE="${ICON_FILE:-sunshine.png}" + + # AppImage + # https://docs.appimage.org/packaging-guide/index.html + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir . -e ./sunshine -i "../$ICON_FILE" -d "./$DESKTOP_FILE" --output appimage # package cpack -G DEB cpack -G RPM # move - mv Sunshine.deb ../artifacts/sunshine.deb - mv Sunshine.rpm ../artifacts/sunshine.rpm + mv sunshine*.AppImage ../artifacts/sunshine.AppImage + mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine.deb + mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm + + - name: Verify AppImage + run: | + wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage + chmod +x appimagelint-x86_64.AppImage + + ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -244,7 +159,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets .. + cmake -DCMAKE_BUILD_TYPE=Release .. make -j ${nproc} - name: Package MacOS @@ -257,9 +172,9 @@ jobs: cpack -G ZIP # move - mv Sunshine.dmg ../artifacts/sunshine-macos.dmg - mv Sunshine.zip ../artifacts/sunshine-macos.zip mv Portfile ../artifacts/Portfile + mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos.dmg + mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos.zip - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -313,7 +228,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. + cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" .. mingw32-make -j2 - name: Package Windows @@ -327,8 +242,8 @@ jobs: cpack -G ZIP # move - mv Sunshine.exe ../artifacts/sunshine-windows.exe - mv Sunshine.zip ../artifacts/sunshine-windows.zip + mv ./cpack_artifacts/Sunshine.exe ../artifacts/sunshine-windows.exe + mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows.zip - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index c12957b3..0640625a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,7 +449,8 @@ target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COM # Common options set(CPACK_PACKAGE_NAME "SunshineStream") -set(CPACK_PACKAGE_VENDOR "CMake.org") +set(CPACK_PACKAGE_VENDOR "SunshineStream") +set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts) set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") @@ -486,7 +487,7 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h ") # Adding an option for the start menu and PATH - set(CPACK_NSIS_MODIFY_PATH "ON") # TODO: it asks to add it to the PATH but then it seems I can't just run it from powershell + set(CPACK_NSIS_MODIFY_PATH "OFF") # TODO: it asks to add it to the PATH but is not working https://gitlab.kitware.com/cmake/cmake/-/issues/15635 set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${CMAKE_PROJECT_NAME}.exe") set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_PROJECT_NAME}.exe") # This will be shown on the installed apps Windows settings @@ -501,12 +502,12 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_APPLICATION_DESCRIPTION "The main application.") set(CPACK_COMPONENT_APPLICATION_GROUP "${CMAKE_PROJECT_NAME}") set(CPACK_COMPONENT_APPLICATION_REQUIRED true) + set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) # assets set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets") set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Assets include the apps and configurations, shaders, default box art, and web ui.") set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}") - set(CPACK_COMPONENT_ASSETS_DEPENDS "${CMAKE_PROJECT_NAME}") set(CPACK_COMPONENT_ASSETS_REQUIRED true) # audio tool @@ -523,8 +524,6 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_SUNSHINESVC_DISPLAY_NAME "sunshinesvc.exe") set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.") set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") - - # set(CPACK_COMPONENT_APPLICATION_DEPENDS assets) endif() if(APPLE) # TODO: test From 93aebf461a0b6e2c71b0f5efa292c22fde559e54 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 13:21:47 -0400 Subject: [PATCH 24/47] Set assets dir for Windows --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e9d2a4bc..fe279f59 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -228,7 +228,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -G "MinGW Makefiles" .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. mingw32-make -j2 - name: Package Windows From 49bfd2ba1f1bc3d47b5935dbcf36e57febbc0087 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 14:24:39 -0400 Subject: [PATCH 25/47] Rename apps.json files throughout project - Remove `appveyor.yml` - Add project description to CMakeLists.txt - Add project homepage url to CMakeLists.txt --- .github/workflows/CI.yml | 4 ++-- CMakeLists.txt | 9 +++++--- Portfile.in | 14 ++++++------ appveyor.yml | 44 -------------------------------------- assets/linux-deb/conffiles | 2 +- assets/linux-deb/postinst | 12 +++++------ assets/linux-deb/preinst | 4 ++-- docs/source/conf.py | 2 +- sunshine.desktop.in | 4 ++-- sunshine.service.in | 2 +- 10 files changed, 28 insertions(+), 69 deletions(-) delete mode 100644 appveyor.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fe279f59..5e854683 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: - name: Check CMakeLists.txt Version run: | - version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+\)' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') + version=$(grep -o -E '^project\(Sunshine \[VERSION [0-9]+\.[0-9]+\.[0-9]+\]' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') echo "cmakelists_version=${version}" >> $GITHUB_ENV - name: Compare CMakeList.txt Version @@ -49,7 +49,7 @@ jobs: run: | echo CMakeLists version: "$cmakelists_version" echo Changelog version: "${{ needs.check_changelog.outputs.next_version_bare }}" - echo Within 'CMakeLists.txt' change "project(Sunshine VERSION $cmakelists_version)" to "project(Sunshine VERSION ${{ needs.check_changelog.outputs.next_version_bare }})" + echo Within 'CMakeLists.txt' change "project(Sunshine [VERSION $cmakelists_version]" to "project(Sunshine [VERSION ${{ needs.check_changelog.outputs.next_version_bare }}]" exit 1 build_linux: diff --git a/CMakeLists.txt b/CMakeLists.txt index 0640625a..8d9584d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 3.0) -project(Sunshine VERSION 0.13.0) +project(Sunshine [VERSION 0.13.0] + [DESCRIPTION Sunshine is a Gamestream host for Moonlight.] + [HOMEPAGE_URL https://sunshinestream.github.io] + ) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) @@ -453,8 +456,8 @@ set(CPACK_PACKAGE_VENDOR "SunshineStream") set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpack_artifacts) set(CPACK_PACKAGE_CONTACT "https://github.com/SunshineStream/Sunshine") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "https://github.com/SunshineStream/Sunshine") -set(CPACK_PACKAGE_DESCRIPTION "Gamestream host for Moonlight") -set(CPACK_PACKAGE_HOMEPAGE_URL "https://sunshinestream.github.io") +set(CPACK_PACKAGE_DESCRIPTION ${CMAKE_PROJECT_DESCRIPTION}) +set(CPACK_PACKAGE_HOMEPAGE_URL ${CMAKE_PROJECT_HOMEPAGE_URL}) set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE) set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/sunshine.png) set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}") diff --git a/Portfile.in b/Portfile.in index 6973ed40..60940cb4 100644 --- a/Portfile.in +++ b/Portfile.in @@ -19,9 +19,9 @@ post-fetch { system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive" } -description Sunshine is a Gamestream host for Moonlight. +description @PROJECT_DESCRIPTION@ long_description {*}${description} -homepage https://github.com/SunshineStream/Sunshine +homepage @PROJECT_HOMEPAGE_URL@ depends_lib port:avahi \ port:ffmpeg \ @@ -37,14 +37,14 @@ cmake.out_of_source yes destroot { xinstall -d -m 755 ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/apps_mac.json ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/box.png ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/sunshine.conf ${destroot}${prefix}/etc/${name} + xinstall ${worksrcpath}/assets/assets_mac/apps.json ${destroot}${prefix}/etc/${name} + xinstall ${worksrcpath}/assets/assets_common/box.png ${destroot}${prefix}/etc/${name} + xinstall ${worksrcpath}/assets/assets_common/sunshine.conf ${destroot}${prefix}/etc/${name} xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web - xinstall {*}[glob ${worksrcpath}/assets/web/*.html] ${destroot}${prefix}/etc/${name}/web + xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/*.html] ${destroot}${prefix}/etc/${name}/web xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web/third_party - xinstall {*}[glob ${worksrcpath}/assets/web/third_party/*] ${destroot}${prefix}/etc/${name}/web/third_party + xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/third_party/*] ${destroot}${prefix}/etc/${name}/web/third_party xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin } diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 7fb08089..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -services: - - docker - -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 - DOCKERFILE: Dockerfile-ubuntu_20_04 - - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 - DOCKERFILE: Dockerfile-ubuntu_21_04 - - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004 - DOCKERFILE: Dockerfile-debian - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - BUILD_TYPE: Release - -install: - - cmd: C:\msys64\usr\bin\bash -lc "pacman --needed --noconfirm -S mingw-w64-x86_64-binutils mingw-w64-x86_64-openssl mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-opus mingw-w64-x86_64-x265 mingw-w64-x86_64-boost git yasm nasm diffutils make" - -before_build: - - cmd: git submodule update --init --recursive - - cmd: mkdir build - - cmd: cd build - - sh: cd scripts - - sh: ./build-container.sh -f $DOCKERFILE - -build_script: - - cmd: set OLDPATH=%PATH% - - cmd: set PATH=C:\msys64\mingw64\bin - - cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. - - cmd: mingw32-make -j2 - - cmd: set PATH=%OLDPATH% - - sh: ./build-sunshine.sh -pu - -after_build: - - cmd: Del ..\assets\apps_linux.json - - cmd: 7z a Sunshine-Windows.zip ..\assets - - cmd: 7z a Sunshine-Windows.zip sunshine.exe - - cmd: 7z a Sunshine-Windows.zip tools\dxgi-info.exe - - cmd: 7z a Sunshine-Windows.zip tools\audio-info.exe - - cmd: 7z a Sunshine-Windows.zip tools\sunshinesvc.exe - - cmd: 7z a Sunshine-Windows.zip ..\tools\install-service.bat - - cmd: 7z a Sunshine-Windows.zip ..\tools\uninstall-service.bat - - cmd: appveyor PushArtifact Sunshine-Windows.zip - - sh: appveyor PushArtifact sunshine-build/sunshine.deb - diff --git a/assets/linux-deb/conffiles b/assets/linux-deb/conffiles index 78176a81..cf2d2444 100644 --- a/assets/linux-deb/conffiles +++ b/assets/linux-deb/conffiles @@ -1,2 +1,2 @@ /etc/sunshine/sunshine.conf -/etc/sunshine/apps_linux.json +/etc/sunshine/apps.json diff --git a/assets/linux-deb/postinst b/assets/linux-deb/postinst index cf66231f..d3195c6a 100644 --- a/assets/linux-deb/postinst +++ b/assets/linux-deb/postinst @@ -17,15 +17,15 @@ if [ -f /etc/sunshine/sunshine.conf.old ]; then mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf fi -if [ -f /etc/sunshine/apps_linux.json.old ]; then - echo "Restoring old apps_linux.json" - mv /etc/sunshine/apps_linux.json.old /etc/sunshine/apps_linux.json +if [ -f /etc/sunshine/apps.json.old ]; then + echo "Restoring old apps.json" + mv /etc/sunshine/apps.json.old /etc/sunshine/apps.json fi # Update permissions on config files for Web Manager -if [ -f /etc/sunshine/apps_linux.json ]; then - echo "chmod 666 /etc/sunshine/apps_linux.json" - chmod 666 /etc/sunshine/apps_linux.json +if [ -f /etc/sunshine/apps.json ]; then + echo "chmod 666 /etc/sunshine/apps.json" + chmod 666 /etc/sunshine/apps.json fi if [ -f /etc/sunshine/sunshine.conf ]; then diff --git a/assets/linux-deb/preinst b/assets/linux-deb/preinst index 515d1a34..ec56e883 100644 --- a/assets/linux-deb/preinst +++ b/assets/linux-deb/preinst @@ -4,6 +4,6 @@ if [ -f /etc/sunshine/sunshine.conf ]; then cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old fi -if [ -f /etc/sunshine/apps_linux.json ]; then - cp /etc/sunshine/apps_linux.json /etc/sunshine/apps_linux.json.old +if [ -f /etc/sunshine/apps.json ]; then + cp /etc/sunshine/apps.json /etc/sunshine/apps.json.old fi diff --git a/docs/source/conf.py b/docs/source/conf.py index 86b7b805..360db8f6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -27,7 +27,7 @@ author = 'ReenigneArcher' # The full version, including alpha/beta/rc tags with open(os.path.join(root_dir, 'CMakeLists.txt'), 'r') as f: - version = re.search(r"project\(Sunshine VERSION ((\d+)\.(\d+)\.(\d+))\)", str(f.read())).group(1) + version = re.search(r"project\(Sunshine \[VERSION ((\d+)\.(\d+)\.(\d+))\]", str(f.read())).group(1) """ To use cmake method for obtaining version instead of regex, 1. Within CMakeLists.txt add the following line without backticks: diff --git a/sunshine.desktop.in b/sunshine.desktop.in index 195bade3..a345e5dc 100644 --- a/sunshine.desktop.in +++ b/sunshine.desktop.in @@ -1,9 +1,9 @@ [Desktop Entry] Type=Application -Name=sunshine +Name=@PROJECT_NAME@ Exec=sunshine Version=1.0 -Comment=Host for Moonlight Streaming Client +Comment=@PROJECT_DESCRIPTION@ Icon=sunshine Categories=Utility; Terminal=true diff --git a/sunshine.service.in b/sunshine.service.in index c0c38289..157b3a4d 100644 --- a/sunshine.service.in +++ b/sunshine.service.in @@ -1,5 +1,5 @@ [Unit] -Description=Sunshine Gamestream Server for Moonlight +Description=@PROJECT_DESCRIPTION@ [Service] ExecStart=@SUNSHINE_EXECUTABLE_PATH@ From a3e3da3136d4007ecb15bc66f66d735fc4d7314d Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 14:39:26 -0400 Subject: [PATCH 26/47] Fix cmake project parameters --- .github/workflows/CI.yml | 2 +- CMakeLists.txt | 6 +++--- docs/source/conf.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5e854683..97d90219 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: - name: Check CMakeLists.txt Version run: | - version=$(grep -o -E '^project\(Sunshine \[VERSION [0-9]+\.[0-9]+\.[0-9]+\]' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') + version=$(grep -o -E '^project\(Sunshine VERSION [0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') echo "cmakelists_version=${version}" >> $GITHUB_ENV - name: Compare CMakeList.txt Version diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d9584d0..b5c38886 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.0) -project(Sunshine [VERSION 0.13.0] - [DESCRIPTION Sunshine is a Gamestream host for Moonlight.] - [HOMEPAGE_URL https://sunshinestream.github.io] +project(Sunshine VERSION 0.13.0 + DESCRIPTION "Sunshine is a Gamestream host for Moonlight." + HOMEPAGE_URL "https://sunshinestream.github.io" ) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/docs/source/conf.py b/docs/source/conf.py index 360db8f6..f609783c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -27,7 +27,7 @@ author = 'ReenigneArcher' # The full version, including alpha/beta/rc tags with open(os.path.join(root_dir, 'CMakeLists.txt'), 'r') as f: - version = re.search(r"project\(Sunshine \[VERSION ((\d+)\.(\d+)\.(\d+))\]", str(f.read())).group(1) + version = re.search(r"project\(Sunshine VERSION ((\d+)\.(\d+)\.(\d+))", str(f.read())).group(1) """ To use cmake method for obtaining version instead of regex, 1. Within CMakeLists.txt add the following line without backticks: From fff419a7ff19c11b029054181db35f578aced4f1 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 6 May 2022 15:19:11 -0400 Subject: [PATCH 27/47] Fix AppImage source filename --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 97d90219..3f8e04e6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -109,7 +109,7 @@ jobs: cpack -G RPM # move - mv sunshine*.AppImage ../artifacts/sunshine.AppImage + mv Sunshine*.AppImage ../artifacts/sunshine.AppImage mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine.deb mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm From 6c04065ba780b2d34633eb5e5493d209ca3bbb98 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 8 May 2022 21:39:10 -0400 Subject: [PATCH 28/47] Set DEFAULT_SUNSHINE_DIR for CI builds - Add libssl3.0 as CPACK_DEBIAN_PACKAGE_DEPENDS --- .github/workflows/CI.yml | 4 ++-- CMakeLists.txt | 2 +- Portfile.in | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3f8e04e6..3aed4d1e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -81,7 +81,7 @@ jobs: mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../" + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_DEFAULT_DIR=/etc/sunshine -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../" make -j ${nproc} - name: Set AppImage Version @@ -159,7 +159,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_DEFAULT_DIR=/etc/sunshine .. make -j ${nproc} - name: Package MacOS diff --git a/CMakeLists.txt b/CMakeLists.txt index b5c38886..f58e0439 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -565,7 +565,7 @@ if(UNIX AND NOT APPLE) # Dependencies set(CPACK_DEB_COMPONENT_INSTALL ON) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 | libssl3.0, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config diff --git a/Portfile.in b/Portfile.in index 60940cb4..c784c3b0 100644 --- a/Portfile.in +++ b/Portfile.in @@ -31,7 +31,8 @@ depends_lib port:avahi \ boost.version 1.76 configure.args -DBOOST_ROOT=[boost::install_area] \ - -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine + -DSUNSHINE_ASSETS_DIR=${worksrcpath}/assets + -DSUNSHINE_DEFAULT_DIR=${prefix}/etc/sunshine cmake.out_of_source yes From c2752262e5635f138ce1758c136ba27fef2e7a18 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 10 May 2022 18:54:50 -0400 Subject: [PATCH 29/47] Add missing AppImage libraries --- .github/workflows/CI.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3aed4d1e..6f44197c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -101,8 +101,17 @@ jobs: # AppImage # https://docs.appimage.org/packaging-guide/index.html - wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && chmod +x linuxdeploy-x86_64.AppImage - ./linuxdeploy-x86_64.AppImage --appdir . -e ./sunshine -i "../$ICON_FILE" -d "./$DESKTOP_FILE" --output appimage + wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage + chmod +x linuxdeploy-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage \ + --appdir . \ + -e ./sunshine \ + -i "../$ICON_FILE" \ + -d "./$DESKTOP_FILE" \ + -l /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \ + -l /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ + -l /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ + --output appimage # package cpack -G DEB From 88925c705f38b14ad4018589968c05d176ccb137 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 10 May 2022 19:19:16 -0400 Subject: [PATCH 30/47] Add gtk plugin for linuxdeploy / AppImage --- .github/workflows/CI.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6f44197c..2e2b72a2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -103,14 +103,22 @@ jobs: # https://docs.appimage.org/packaging-guide/index.html wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage + + # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk + sudo apt-get install libgtk-3-dev librsvg2-dev -y + wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh + chmod +x linuxdeploy-plugin-gtk.sh + export DEPLOY_GTK_VERSION=3 + ./linuxdeploy-x86_64.AppImage \ --appdir . \ - -e ./sunshine \ - -i "../$ICON_FILE" \ - -d "./$DESKTOP_FILE" \ - -l /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \ - -l /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ - -l /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ + --plugin gtk \ + --executable ./sunshine \ + --icon-file "../$ICON_FILE" \ + --desktop-file "./$DESKTOP_FILE" \ + --library /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 \ + --library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ + --library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ --output appimage # package From ca00949851dba872373b8bebde42d16a2f315930 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 10 May 2022 21:18:37 -0400 Subject: [PATCH 31/47] Refactor build_linux job --- .github/workflows/CI.yml | 84 ++++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2e2b72a2..a1b091b9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -63,18 +63,67 @@ jobs: submodules: recursive - name: Setup Dependencies Linux run: | - sudo apt-get update -y && \ - sudo apt-get --reinstall install -y \ - git wget gcc-10 g++-10 build-essential cmake libssl-dev libavdevice-dev libboost-thread-dev libboost-filesystem-dev libboost-log-dev libpulse-dev libopus-dev libxtst-dev libx11-dev libxrandr-dev libxfixes-dev libevdev-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev libdrm-dev libcap-dev libwayland-dev - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 - sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run && sudo chmod a+x /root/cuda.run - sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm && sudo rm /root/cuda.run - sudo add-apt-repository ppa:savoury1/graphics -y - sudo add-apt-repository ppa:savoury1/multimedia -y sudo add-apt-repository ppa:savoury1/ffmpeg4 -y + # sudo add-apt-repository ppa:savoury1/boost-defaults-1.71 -y + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update -y - sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y - sudo apt-get install ffmpeg -y + sudo apt-get install -y \ + build-essential \ + cmake \ + gcc-10 \ + git \ + g++-10 \ + libavdevice-dev \ + libboost-filesystem-dev \ + libboost-log-dev \ + libboost-thread-dev \ + libcap-dev \ + libdrm-dev \ + libevdev-dev \ + libpulse-dev \ + libopus-dev \ + libssl-dev \ + libwayland-dev \ + libx11-dev \ + libxcb-shm0-dev \ + libxcb-xfixes0-dev \ + libxcb1-dev \ + libxfixes-dev \ + libxrandr-dev \ + libxtst-dev \ + wget + # # Ubuntu 20.04+ packages + # libboost-filesystem-dev + # libboost-log-dev + # libboost-thread-dev + + # # Ubuntu 18.04 packages + # libboost-filesystem1.71-dev \ + # libboost-log1.71-dev \ + # libboost-regex1.71-dev \ + # libboost-thread1.71-dev \ + + # clean apt cache + sudo apt-get clean + sudo rm -rf /var/lib/apt/lists/* + + # Update gcc alias + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 + + # Install CuDA + sudo wget https://developer.download.nvidia.com/compute/cuda/11.4.2/local_installers/cuda_11.4.2_470.57.02_linux.run --progress=bar:force:noscroll -q --show-progress -O /root/cuda.run + sudo chmod a+x /root/cuda.run + sudo /root/cuda.run --silent --toolkit --toolkitpath=/usr --no-opengl-libs --no-man-page --no-drm + sudo rm /root/cuda.run + + # # Install cmake (necessary for 18.04) + # wget https://cmake.org/files/v3.22/cmake-3.22.2-linux-x86_64.sh + # chmod +x cmake-3.22.2-linux-x86_64.sh + # mkdir /opt/cmake + # ./cmake-3.22.2-linux-x86_64.sh --prefix=/opt/cmake --skip-license + # ln --force --symbolic /opt/cmake/bin/cmake /usr/local/bin/cmake + # cmake --version - name: Build Linux run: | @@ -104,15 +153,14 @@ jobs: wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage - # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk - sudo apt-get install libgtk-3-dev librsvg2-dev -y - wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh - chmod +x linuxdeploy-plugin-gtk.sh - export DEPLOY_GTK_VERSION=3 + # # https://github.com/linuxdeploy/linuxdeploy-plugin-gtk + # sudo apt-get install libgtk-3-dev librsvg2-dev -y + # wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh + # chmod +x linuxdeploy-plugin-gtk.sh + # export DEPLOY_GTK_VERSION=3 ./linuxdeploy-x86_64.AppImage \ --appdir . \ - --plugin gtk \ --executable ./sunshine \ --icon-file "../$ICON_FILE" \ --desktop-file "./$DESKTOP_FILE" \ @@ -120,6 +168,8 @@ jobs: --library /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 \ --library /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 \ --output appimage + # # add this argument back if using gtk plugin + # --plugin gtk \ # package cpack -G DEB @@ -135,6 +185,8 @@ jobs: wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage chmod +x appimagelint-x86_64.AppImage + # rm -rf ~/.cache/appimagelint/ + ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage - name: Upload Artifacts From 68ba1db24ab66df63fd525d15f95b95bc958beac Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 11 May 2022 21:31:31 -0400 Subject: [PATCH 32/47] Refactor assets and config directory --- .github/workflows/CI.yml | 6 +- .gitignore | 16 ++--- CMakeLists.txt | 65 +++++++++++------- Portfile.in | 18 +++-- assets/linux-deb/conffiles | 2 - assets/linux-deb/preinst | 9 --- docs/source/about/advanced_usage.rst | 12 ++-- docs/source/about/installation.rst | 2 +- .../common/assets}/box.png | Bin .../common/assets}/steam.png | Bin .../common/assets}/web/apps.html | 0 .../common/assets}/web/clients.html | 0 .../common/assets}/web/config.html | 0 .../fonts/fontawesome-free-web/LICENSE.txt | 0 .../fonts/fontawesome-free-web/attribution.js | 0 .../fontawesome-free-web/css/all.min.css | 0 .../fontawesome-free-web/css/brands.min.css | 0 .../css/fontawesome.min.css | 0 .../fontawesome-free-web/css/regular.min.css | 0 .../fontawesome-free-web/css/solid.min.css | 0 .../css/svg-with-js.min.css | 0 .../fontawesome-free-web/css/v4-shims.min.css | 0 .../webfonts/fa-brands-400.eot | Bin .../webfonts/fa-brands-400.svg | 0 .../webfonts/fa-brands-400.ttf | Bin .../webfonts/fa-brands-400.woff | Bin .../webfonts/fa-brands-400.woff2 | Bin .../webfonts/fa-regular-400.eot | Bin .../webfonts/fa-regular-400.svg | 0 .../webfonts/fa-regular-400.ttf | Bin .../webfonts/fa-regular-400.woff | Bin .../webfonts/fa-regular-400.woff2 | Bin .../webfonts/fa-solid-900.eot | Bin .../webfonts/fa-solid-900.svg | 0 .../webfonts/fa-solid-900.ttf | Bin .../webfonts/fa-solid-900.woff | Bin .../webfonts/fa-solid-900.woff2 | Bin .../common/assets}/web/header-no-nav.html | 0 .../common/assets}/web/header.html | 0 .../common/assets}/web/images/favicon.ico | Bin .../assets}/web/images/logo-sunshine-45.png | Bin .../common/assets}/web/index.html | 0 .../common/assets}/web/password.html | 0 .../common/assets}/web/pin.html | 0 .../web/third_party/bootstrap.bundle.min.js | 0 .../assets}/web/third_party/bootstrap.min.css | 0 .../common/assets}/web/third_party/vue.js | 0 .../common/assets}/web/troubleshooting.html | 0 .../common/assets}/web/welcome.html | 0 .../common/config}/sunshine.conf | 0 .../assets}/shaders/opengl/ConvertUV.frag | 0 .../assets}/shaders/opengl/ConvertUV.vert | 0 .../assets}/shaders/opengl/ConvertY.frag | 0 .../linux/assets}/shaders/opengl/Scene.frag | 0 .../linux/assets}/shaders/opengl/Scene.vert | 0 .../linux/config}/apps.json | 0 src_assets/linux/deb/conffiles | 2 + .../linux/deb}/postinst | 16 ++--- src_assets/linux/deb/preinst | 9 +++ .../linux/misc}/85-sunshine-rules.rules | 0 .../macos/assets}/Info.plist | 0 .../macos/config}/apps.json | 0 .../assets}/shaders/directx/ConvertUVPS.hlsl | 0 .../assets}/shaders/directx/ConvertUVVS.hlsl | 0 .../assets}/shaders/directx/ConvertYPS.hlsl | 0 .../assets}/shaders/directx/ScenePS.hlsl | 0 .../assets}/shaders/directx/SceneVS.hlsl | 0 .../windows/config}/apps.json | 0 sunshine/config.cpp | 6 +- 69 files changed, 89 insertions(+), 74 deletions(-) delete mode 100644 assets/linux-deb/conffiles delete mode 100644 assets/linux-deb/preinst rename {assets/assets_common => src_assets/common/assets}/box.png (100%) rename {assets/assets_common => src_assets/common/assets}/steam.png (100%) rename {assets/assets_common => src_assets/common/assets}/web/apps.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/clients.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/config.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/LICENSE.txt (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/attribution.js (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/all.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/brands.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/fontawesome.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/regular.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/solid.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/svg-with-js.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/css/v4-shims.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff (100%) rename {assets/assets_common => src_assets/common/assets}/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 (100%) rename {assets/assets_common => src_assets/common/assets}/web/header-no-nav.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/header.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/images/favicon.ico (100%) rename {assets/assets_common => src_assets/common/assets}/web/images/logo-sunshine-45.png (100%) rename {assets/assets_common => src_assets/common/assets}/web/index.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/password.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/pin.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/third_party/bootstrap.bundle.min.js (100%) rename {assets/assets_common => src_assets/common/assets}/web/third_party/bootstrap.min.css (100%) rename {assets/assets_common => src_assets/common/assets}/web/third_party/vue.js (100%) rename {assets/assets_common => src_assets/common/assets}/web/troubleshooting.html (100%) rename {assets/assets_common => src_assets/common/assets}/web/welcome.html (100%) rename {assets/assets_common => src_assets/common/config}/sunshine.conf (100%) rename {assets/assets_linux => src_assets/linux/assets}/shaders/opengl/ConvertUV.frag (100%) rename {assets/assets_linux => src_assets/linux/assets}/shaders/opengl/ConvertUV.vert (100%) rename {assets/assets_linux => src_assets/linux/assets}/shaders/opengl/ConvertY.frag (100%) rename {assets/assets_linux => src_assets/linux/assets}/shaders/opengl/Scene.frag (100%) rename {assets/assets_linux => src_assets/linux/assets}/shaders/opengl/Scene.vert (100%) rename {assets/assets_linux => src_assets/linux/config}/apps.json (100%) create mode 100644 src_assets/linux/deb/conffiles rename {assets/linux-deb => src_assets/linux/deb}/postinst (59%) create mode 100644 src_assets/linux/deb/preinst rename {assets/linux-misc => src_assets/linux/misc}/85-sunshine-rules.rules (100%) rename {assets/assets_mac => src_assets/macos/assets}/Info.plist (100%) rename {assets/assets_mac => src_assets/macos/config}/apps.json (100%) rename {assets/assets_windows => src_assets/windows/assets}/shaders/directx/ConvertUVPS.hlsl (100%) rename {assets/assets_windows => src_assets/windows/assets}/shaders/directx/ConvertUVVS.hlsl (100%) rename {assets/assets_windows => src_assets/windows/assets}/shaders/directx/ConvertYPS.hlsl (100%) rename {assets/assets_windows => src_assets/windows/assets}/shaders/directx/ScenePS.hlsl (100%) rename {assets/assets_windows => src_assets/windows/assets}/shaders/directx/SceneVS.hlsl (100%) rename {assets/assets_windows => src_assets/windows/config}/apps.json (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a1b091b9..dac856ed 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -130,7 +130,7 @@ jobs: mkdir -p build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_CONFIG_DIR=. -DSUNSHINE_DEFAULT_DIR=/etc/sunshine -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON "../" + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON .. make -j ${nproc} - name: Set AppImage Version @@ -228,7 +228,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_DEFAULT_DIR=/etc/sunshine .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config .. make -j ${nproc} - name: Package MacOS @@ -297,7 +297,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -G "MinGW Makefiles" .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=assets -DSUNSHINE_CONFIG_DIR=config -G "MinGW Makefiles" .. mingw32-make -j2 - name: Package Windows diff --git a/.gitignore b/.gitignore index 39afd65a..6c44c5bc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,14 +10,14 @@ cmake-build* .idea # Extra FontAwesome files -/assets/web/fonts/fontawesome-free-web/css/*.css -!/assets/web/fonts/fontawesome-free-web/css/*min.css -/assets/web/fonts/fontawesome-free-web/js/ -/assets/web/fonts/fontawesome-free-web/less/ -/assets/web/fonts/fontawesome-free-web/metadata/ -/assets/web/fonts/fontawesome-free-web/scss/ -/assets/web/fonts/fontawesome-free-web/sprites/ -/assets/web/fonts/fontawesome-free-web/svgs/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*.css +!/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*min.css +/src_assets/common/assets/web/fonts/fontawesome-free-web/js/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/less/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/metadata/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/scss/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/sprites/ +/src_assets/common/assets/web/fonts/fontawesome-free-web/svgs/ # Translations *.mo diff --git a/CMakeLists.txt b/CMakeLists.txt index f58e0439..68035d54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(Sunshine VERSION 0.13.0 ) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +set(SUNSHINE_SOURCE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src_assets") if(WIN32) # Ugly hack to compile with #include @@ -147,6 +148,8 @@ elseif(APPLE) set(PLATFORM_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) + set(APPLE_PLIST_FILE ${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/Info.plist) + set(PLATFORM_TARGET_FILES sunshine/platform/macos/av_audio.h sunshine/platform/macos/av_audio.m @@ -163,7 +166,7 @@ elseif(APPLE) sunshine/platform/macos/publish.cpp sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.c sunshine/platform/macos/TPCircularBuffer/TPCircularBuffer.h - ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) + ${APPLE_PLIST_FILE}) else() add_compile_definitions(SUNSHINE_PLATFORM="linux") @@ -390,15 +393,11 @@ else() endif() if(NOT SUNSHINE_ASSETS_DIR) - set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/assets") + set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/.assets") endif() if(NOT SUNSHINE_CONFIG_DIR) - set(SUNSHINE_CONFIG_DIR "${SUNSHINE_ASSETS_DIR}") -endif() - -if(NOT SUNSHINE_DEFAULT_DIR) - set(SUNSHINE_DEFAULT_DIR "${SUNSHINE_ASSETS_DIR}") + set(SUNSHINE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/config") endif() list(APPEND CBS_EXTERNAL_LIBRARIES @@ -421,8 +420,6 @@ endif() list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_ASSETS_DIR="${SUNSHINE_ASSETS_DIR}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_CONFIG_DIR="${SUNSHINE_CONFIG_DIR}") -list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_DEFAULT_DIR="${SUNSHINE_DEFAULT_DIR}") -list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps.json") add_executable(sunshine ${SUNSHINE_TARGET_FILES}) target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS}) target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS}) @@ -437,7 +434,7 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD) endif() if(APPLE) - target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_mac/Info.plist) + target_link_options(sunshine PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,${APPLE_PLIST_FILE}) endif() foreach(flag IN LISTS SUNSHINE_COMPILE_OPTIONS) @@ -472,8 +469,11 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h install(TARGETS audio-info RUNTIME DESTINATION "tools" COMPONENT audio) install(TARGETS sunshinesvc RUNTIME DESTINATION "tools" COMPONENT sunshinesvc) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_windows/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT assets) + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets) + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}" COMPONENT assets) + + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config) + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/windows/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}" COMPONENT config) # set(CPACK_NSIS_MUI_HEADERIMAGE "") # TODO: image should be 150x57 bmp @@ -509,10 +509,16 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h # assets set(CPACK_COMPONENT_ASSETS_DISPLAY_NAME "Assets") - set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Assets include the apps and configurations, shaders, default box art, and web ui.") + set(CPACK_COMPONENT_ASSETS_DESCRIPTION "Shaders, default box art, and web ui.") set(CPACK_COMPONENT_ASSETS_GROUP "${CMAKE_PROJECT_NAME}") set(CPACK_COMPONENT_ASSETS_REQUIRED true) + # config + set(CPACK_COMPONENT_CONFIG_DISPLAY_NAME "Config") + set(CPACK_COMPONENT_CONFIG_DESCRIPTION "Default config and apps.json files.") + set(CPACK_COMPONENT_CONFIG_GROUP "${CMAKE_PROJECT_NAME}") + set(CPACK_COMPONENT_CONFIG_REQUIRED true) + # audio tool set(CPACK_COMPONENT_AUDIO_DISPLAY_NAME "audio-info.exe") set(CPACK_COMPONENT_AUDIO_DESCRIPTION "CLI tool that allows you to get information about sound devices.") @@ -528,13 +534,23 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_SUNSHINESVC_DESCRIPTION "CLI tool that allows you to enable/disable the Sunshine service.") set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") endif() +if(UNIX) + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") + + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}") + + # Installation destination dir + set(CPACK_SET_DESTDIR true) + set(CMAKE_INSTALL_PREFIX "/usr/local/sunshine/") +endif() if(APPLE) # TODO: test set(prefix "${CMAKE_PROJECT_NAME}.app/Contents") set(INSTALL_RUNTIME_DIR "${prefix}/MacOS") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${INSTALL_RUNTIME_DIR}") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_mac/" DESTINATION "${INSTALL_RUNTIME_DIR}") + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") + + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}") install(TARGETS sunshine BUNDLE DESTINATION . COMPONENT Runtime @@ -542,26 +558,27 @@ if(APPLE) # TODO: test # TODO: bundle doesn't produce a valid .app use cpack -G DragNDrop set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") - set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/assets_mac/Info.plist") + set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") # Portfile configure_file(Portfile.in Portfile @ONLY) endif() if(UNIX AND NOT APPLE) - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_common/" DESTINATION "${SUNSHINE_CONFIG_DIR}") - install(DIRECTORY "${SUNSHINE_ASSETS_DIR}/assets_linux/" DESTINATION "${SUNSHINE_CONFIG_DIR}") + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") - install(FILES "${SUNSHINE_ASSETS_DIR}/linux-misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}") + + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine-rules.rules" DESTINATION "/etc/udev/rules.d") install(TARGETS sunshine RUNTIME DESTINATION "/usr/bin") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" DESTINATION "/usr/lib/systemd/user") # Pre and post install set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA - "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst;${SUNSHINE_ASSETS_DIR}/linux-deb/postinst;${SUNSHINE_ASSETS_DIR}/linux-deb/conffiles") - set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/preinst") - set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_ASSETS_DIR}/linux-deb/postinst") + "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/conffiles") + set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst") + set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst") # Dependencies set(CPACK_DEB_COMPONENT_INSTALL ON) @@ -569,10 +586,6 @@ if(UNIX AND NOT APPLE) set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config - # Installation destination dir - set(CPACK_SET_DESTDIR true) - set(CMAKE_INSTALL_PREFIX "/etc/sunshine") - # AppImage desktop file configure_file(sunshine.desktop.in sunshine.desktop @ONLY) endif() diff --git a/Portfile.in b/Portfile.in index c784c3b0..2cb35466 100644 --- a/Portfile.in +++ b/Portfile.in @@ -31,21 +31,19 @@ depends_lib port:avahi \ boost.version 1.76 configure.args -DBOOST_ROOT=[boost::install_area] \ - -DSUNSHINE_ASSETS_DIR=${worksrcpath}/assets - -DSUNSHINE_DEFAULT_DIR=${prefix}/etc/sunshine + -DSUNSHINE_ASSETS_DIR=${prefix}/usr/local/sunshine/.assets + -DSUNSHINE_CONFIG_DIR=${prefix}/usr/local/sunshine/config cmake.out_of_source yes destroot { - xinstall -d -m 755 ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/assets_mac/apps.json ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/assets_common/box.png ${destroot}${prefix}/etc/${name} - xinstall ${worksrcpath}/assets/assets_common/sunshine.conf ${destroot}${prefix}/etc/${name} + xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/.assets + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets + xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets - xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web - xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/*.html] ${destroot}${prefix}/etc/${name}/web - xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/web/third_party - xinstall {*}[glob ${worksrcpath}/assets/assets_common/web/third_party/*] ${destroot}${prefix}/etc/${name}/web/third_party + xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/config + xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*] ${destroot}${prefix}/usr/local/${name}/config + xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*] ${destroot}${prefix}/usr/local/${name}/config xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin } diff --git a/assets/linux-deb/conffiles b/assets/linux-deb/conffiles deleted file mode 100644 index cf2d2444..00000000 --- a/assets/linux-deb/conffiles +++ /dev/null @@ -1,2 +0,0 @@ -/etc/sunshine/sunshine.conf -/etc/sunshine/apps.json diff --git a/assets/linux-deb/preinst b/assets/linux-deb/preinst deleted file mode 100644 index ec56e883..00000000 --- a/assets/linux-deb/preinst +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -#Store backup for old config files to prevent it from being overwritten -if [ -f /etc/sunshine/sunshine.conf ]; then - cp /etc/sunshine/sunshine.conf /etc/sunshine/sunshine.conf.old -fi - -if [ -f /etc/sunshine/apps.json ]; then - cp /etc/sunshine/apps.json /etc/sunshine/apps.json.old -fi diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index 4f427dcb..7699232c 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -6,9 +6,12 @@ Sunshine will work with the default settings for most users. In some cases you m Configuration ------------- -The default location for the configuration file is ``./assets/sunshine.conf``. You can use another location if you +The default location for the configuration file is listed below. You can use another location if you choose, by passing in the full configuration file path as the first argument when you start Sunshine. +The default location of the ``apps.json`` is the same as the configuration file. You can use a custom +location by modifying the configuration file. + **Default File Location** .. table:: @@ -17,9 +20,10 @@ choose, by passing in the full configuration file path as the first argument whe ======= =========== Value Description ======= =========== - Linux ./assets/sunshine.conf - MacOS /opt/local/etc/sunshine.conf - Windows ./assets/sunshine.conf + Docker /config/ + Linux /usr/local/sunshine/config/ + MacOS /usr/local/sunshine/config/ + Windows ./config/ ======= =========== Example diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index d7e043a4..40eecd20 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -27,7 +27,7 @@ AppImage .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:appimage?logo=github&style=for-the-badge :alt: GitHub issues by-label -The current compatibility of the AppImage is shown below. +The current known compatibility of the AppImage is shown below. - [✖] Debian oldstable (buster) - [✔] Debian stable (bullseye) diff --git a/assets/assets_common/box.png b/src_assets/common/assets/box.png similarity index 100% rename from assets/assets_common/box.png rename to src_assets/common/assets/box.png diff --git a/assets/assets_common/steam.png b/src_assets/common/assets/steam.png similarity index 100% rename from assets/assets_common/steam.png rename to src_assets/common/assets/steam.png diff --git a/assets/assets_common/web/apps.html b/src_assets/common/assets/web/apps.html similarity index 100% rename from assets/assets_common/web/apps.html rename to src_assets/common/assets/web/apps.html diff --git a/assets/assets_common/web/clients.html b/src_assets/common/assets/web/clients.html similarity index 100% rename from assets/assets_common/web/clients.html rename to src_assets/common/assets/web/clients.html diff --git a/assets/assets_common/web/config.html b/src_assets/common/assets/web/config.html similarity index 100% rename from assets/assets_common/web/config.html rename to src_assets/common/assets/web/config.html diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/LICENSE.txt b/src_assets/common/assets/web/fonts/fontawesome-free-web/LICENSE.txt similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/LICENSE.txt rename to src_assets/common/assets/web/fonts/fontawesome-free-web/LICENSE.txt diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/attribution.js b/src_assets/common/assets/web/fonts/fontawesome-free-web/attribution.js similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/attribution.js rename to src_assets/common/assets/web/fonts/fontawesome-free-web/attribution.js diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/all.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/all.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/all.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/all.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/brands.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/brands.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/brands.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/brands.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/fontawesome.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/fontawesome.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/fontawesome.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/fontawesome.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/regular.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/regular.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/regular.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/regular.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/solid.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/solid.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/solid.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/solid.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/svg-with-js.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/svg-with-js.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/svg-with-js.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/svg-with-js.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/css/v4-shims.min.css b/src_assets/common/assets/web/fonts/fontawesome-free-web/css/v4-shims.min.css similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/css/v4-shims.min.css rename to src_assets/common/assets/web/fonts/fontawesome-free-web/css/v4-shims.min.css diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.eot diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.svg diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.ttf diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-brands-400.woff2 diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.eot diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.svg diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.ttf diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-regular-400.woff2 diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.eot diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.svg diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.ttf diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff diff --git a/assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 b/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 similarity index 100% rename from assets/assets_common/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 rename to src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/fa-solid-900.woff2 diff --git a/assets/assets_common/web/header-no-nav.html b/src_assets/common/assets/web/header-no-nav.html similarity index 100% rename from assets/assets_common/web/header-no-nav.html rename to src_assets/common/assets/web/header-no-nav.html diff --git a/assets/assets_common/web/header.html b/src_assets/common/assets/web/header.html similarity index 100% rename from assets/assets_common/web/header.html rename to src_assets/common/assets/web/header.html diff --git a/assets/assets_common/web/images/favicon.ico b/src_assets/common/assets/web/images/favicon.ico similarity index 100% rename from assets/assets_common/web/images/favicon.ico rename to src_assets/common/assets/web/images/favicon.ico diff --git a/assets/assets_common/web/images/logo-sunshine-45.png b/src_assets/common/assets/web/images/logo-sunshine-45.png similarity index 100% rename from assets/assets_common/web/images/logo-sunshine-45.png rename to src_assets/common/assets/web/images/logo-sunshine-45.png diff --git a/assets/assets_common/web/index.html b/src_assets/common/assets/web/index.html similarity index 100% rename from assets/assets_common/web/index.html rename to src_assets/common/assets/web/index.html diff --git a/assets/assets_common/web/password.html b/src_assets/common/assets/web/password.html similarity index 100% rename from assets/assets_common/web/password.html rename to src_assets/common/assets/web/password.html diff --git a/assets/assets_common/web/pin.html b/src_assets/common/assets/web/pin.html similarity index 100% rename from assets/assets_common/web/pin.html rename to src_assets/common/assets/web/pin.html diff --git a/assets/assets_common/web/third_party/bootstrap.bundle.min.js b/src_assets/common/assets/web/third_party/bootstrap.bundle.min.js similarity index 100% rename from assets/assets_common/web/third_party/bootstrap.bundle.min.js rename to src_assets/common/assets/web/third_party/bootstrap.bundle.min.js diff --git a/assets/assets_common/web/third_party/bootstrap.min.css b/src_assets/common/assets/web/third_party/bootstrap.min.css similarity index 100% rename from assets/assets_common/web/third_party/bootstrap.min.css rename to src_assets/common/assets/web/third_party/bootstrap.min.css diff --git a/assets/assets_common/web/third_party/vue.js b/src_assets/common/assets/web/third_party/vue.js similarity index 100% rename from assets/assets_common/web/third_party/vue.js rename to src_assets/common/assets/web/third_party/vue.js diff --git a/assets/assets_common/web/troubleshooting.html b/src_assets/common/assets/web/troubleshooting.html similarity index 100% rename from assets/assets_common/web/troubleshooting.html rename to src_assets/common/assets/web/troubleshooting.html diff --git a/assets/assets_common/web/welcome.html b/src_assets/common/assets/web/welcome.html similarity index 100% rename from assets/assets_common/web/welcome.html rename to src_assets/common/assets/web/welcome.html diff --git a/assets/assets_common/sunshine.conf b/src_assets/common/config/sunshine.conf similarity index 100% rename from assets/assets_common/sunshine.conf rename to src_assets/common/config/sunshine.conf diff --git a/assets/assets_linux/shaders/opengl/ConvertUV.frag b/src_assets/linux/assets/shaders/opengl/ConvertUV.frag similarity index 100% rename from assets/assets_linux/shaders/opengl/ConvertUV.frag rename to src_assets/linux/assets/shaders/opengl/ConvertUV.frag diff --git a/assets/assets_linux/shaders/opengl/ConvertUV.vert b/src_assets/linux/assets/shaders/opengl/ConvertUV.vert similarity index 100% rename from assets/assets_linux/shaders/opengl/ConvertUV.vert rename to src_assets/linux/assets/shaders/opengl/ConvertUV.vert diff --git a/assets/assets_linux/shaders/opengl/ConvertY.frag b/src_assets/linux/assets/shaders/opengl/ConvertY.frag similarity index 100% rename from assets/assets_linux/shaders/opengl/ConvertY.frag rename to src_assets/linux/assets/shaders/opengl/ConvertY.frag diff --git a/assets/assets_linux/shaders/opengl/Scene.frag b/src_assets/linux/assets/shaders/opengl/Scene.frag similarity index 100% rename from assets/assets_linux/shaders/opengl/Scene.frag rename to src_assets/linux/assets/shaders/opengl/Scene.frag diff --git a/assets/assets_linux/shaders/opengl/Scene.vert b/src_assets/linux/assets/shaders/opengl/Scene.vert similarity index 100% rename from assets/assets_linux/shaders/opengl/Scene.vert rename to src_assets/linux/assets/shaders/opengl/Scene.vert diff --git a/assets/assets_linux/apps.json b/src_assets/linux/config/apps.json similarity index 100% rename from assets/assets_linux/apps.json rename to src_assets/linux/config/apps.json diff --git a/src_assets/linux/deb/conffiles b/src_assets/linux/deb/conffiles new file mode 100644 index 00000000..4a35822b --- /dev/null +++ b/src_assets/linux/deb/conffiles @@ -0,0 +1,2 @@ +/usr/local/sunshine/config/sunshine.conf +/usr/local/sunshine/config/apps.json diff --git a/assets/linux-deb/postinst b/src_assets/linux/deb/postinst similarity index 59% rename from assets/linux-deb/postinst rename to src_assets/linux/deb/postinst index d3195c6a..a42d3ca5 100644 --- a/assets/linux-deb/postinst +++ b/src_assets/linux/deb/postinst @@ -12,25 +12,25 @@ else echo "Warning: /etc/group not found" fi -if [ -f /etc/sunshine/sunshine.conf.old ]; then +if [ -f /usr/local/sunshine/config/sunshine.conf.old ]; then echo "Restoring old sunshine.conf" - mv /etc/sunshine/sunshine.conf.old /etc/sunshine/sunshine.conf + mv /usr/local/sunshine/config/sunshine.conf.old /usr/local/sunshine/config/sunshine.conf fi -if [ -f /etc/sunshine/apps.json.old ]; then +if [ -f /usr/local/sunshine/config/apps.json.old ]; then echo "Restoring old apps.json" - mv /etc/sunshine/apps.json.old /etc/sunshine/apps.json + mv /usr/local/sunshine/config/apps.json.old /usr/local/sunshine/config/apps.json fi # Update permissions on config files for Web Manager -if [ -f /etc/sunshine/apps.json ]; then +if [ -f /usr/local/sunshine/config/apps.json ]; then echo "chmod 666 /etc/sunshine/apps.json" - chmod 666 /etc/sunshine/apps.json + chmod 666 /usr/local/sunshine/config/apps.json fi -if [ -f /etc/sunshine/sunshine.conf ]; then +if [ -f /usr/local/sunshine/config/sunshine.conf ]; then echo "chmod 666 /etc/sunshine/sunshine.conf" - chmod 666 /etc/sunshine/sunshine.conf + chmod 666 /usr/local/sunshine/config/sunshine.conf fi # Ensure Sunshine can grab images from KMS diff --git a/src_assets/linux/deb/preinst b/src_assets/linux/deb/preinst new file mode 100644 index 00000000..0522b5d6 --- /dev/null +++ b/src_assets/linux/deb/preinst @@ -0,0 +1,9 @@ +#!/bin/sh +#Store backup for old config files to prevent it from being overwritten +if [ -f /usr/local/sunshine/config/sunshine.conf ]; then + cp /usr/local/sunshine/config/sunshine.conf /usr/local/sunshine/config/sunshine.conf.old +fi + +if [ -f /usr/local/sunshine/config/apps.json ]; then + cp /usr/local/sunshine/config/apps.json /usr/local/sunshine/config/apps.json.old +fi diff --git a/assets/linux-misc/85-sunshine-rules.rules b/src_assets/linux/misc/85-sunshine-rules.rules similarity index 100% rename from assets/linux-misc/85-sunshine-rules.rules rename to src_assets/linux/misc/85-sunshine-rules.rules diff --git a/assets/assets_mac/Info.plist b/src_assets/macos/assets/Info.plist similarity index 100% rename from assets/assets_mac/Info.plist rename to src_assets/macos/assets/Info.plist diff --git a/assets/assets_mac/apps.json b/src_assets/macos/config/apps.json similarity index 100% rename from assets/assets_mac/apps.json rename to src_assets/macos/config/apps.json diff --git a/assets/assets_windows/shaders/directx/ConvertUVPS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl similarity index 100% rename from assets/assets_windows/shaders/directx/ConvertUVPS.hlsl rename to src_assets/windows/assets/shaders/directx/ConvertUVPS.hlsl diff --git a/assets/assets_windows/shaders/directx/ConvertUVVS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl similarity index 100% rename from assets/assets_windows/shaders/directx/ConvertUVVS.hlsl rename to src_assets/windows/assets/shaders/directx/ConvertUVVS.hlsl diff --git a/assets/assets_windows/shaders/directx/ConvertYPS.hlsl b/src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl similarity index 100% rename from assets/assets_windows/shaders/directx/ConvertYPS.hlsl rename to src_assets/windows/assets/shaders/directx/ConvertYPS.hlsl diff --git a/assets/assets_windows/shaders/directx/ScenePS.hlsl b/src_assets/windows/assets/shaders/directx/ScenePS.hlsl similarity index 100% rename from assets/assets_windows/shaders/directx/ScenePS.hlsl rename to src_assets/windows/assets/shaders/directx/ScenePS.hlsl diff --git a/assets/assets_windows/shaders/directx/SceneVS.hlsl b/src_assets/windows/assets/shaders/directx/SceneVS.hlsl similarity index 100% rename from assets/assets_windows/shaders/directx/SceneVS.hlsl rename to src_assets/windows/assets/shaders/directx/SceneVS.hlsl diff --git a/assets/assets_windows/apps.json b/src_assets/windows/config/apps.json similarity index 100% rename from assets/assets_windows/apps.json rename to src_assets/windows/config/apps.json diff --git a/sunshine/config.cpp b/sunshine/config.cpp index 6aaeb305..6dd3c1b2 100644 --- a/sunshine/config.cpp +++ b/sunshine/config.cpp @@ -20,7 +20,7 @@ using namespace std::literals; #define PRIVATE_KEY_FILE CA_DIR "/cakey.pem" #define CERTIFICATE_FILE CA_DIR "/cacert.pem" -#define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/" APPS_JSON +#define APPS_JSON_PATH SUNSHINE_CONFIG_DIR "/apps.json" namespace config { namespace nv { @@ -695,7 +695,7 @@ int apply_flags(const char *line) { void apply_config(std::unordered_map &&vars) { if(!fs::exists(stream.file_apps.c_str())) { - fs::copy_file(SUNSHINE_DEFAULT_DIR "/" APPS_JSON, stream.file_apps); + fs::copy_file(SUNSHINE_CONFIG_DIR "/apps.json", stream.file_apps); } for(auto &[name, val] : vars) { @@ -906,7 +906,7 @@ int parse(int argc, char *argv[]) { } if(!fs::exists(sunshine.config_file)) { - fs::copy_file(SUNSHINE_DEFAULT_DIR "/sunshine.conf", sunshine.config_file); + fs::copy_file(SUNSHINE_CONFIG_DIR "/sunshine.conf", sunshine.config_file); } auto vars = parse_config(read_file(sunshine.config_file.c_str())); From 4f6b00148355ecac62ddfb1ea74e04d371524521 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 14 May 2022 08:43:58 -0400 Subject: [PATCH 33/47] Update paths and dependencies - Updates paths for Linux and MacOS builds - Strategy matrix build for Linux (CPACK/AppImage) - Fix dependencies for rpm package --- .github/workflows/CI.yml | 54 ++++++++++++++++++------ CMakeLists.txt | 20 +++++---- Portfile.in | 4 +- src_assets/linux/{deb => misc}/conffiles | 0 src_assets/linux/{deb => misc}/postinst | 0 src_assets/linux/{deb => misc}/preinst | 0 6 files changed, 53 insertions(+), 25 deletions(-) rename src_assets/linux/{deb => misc}/conffiles (100%) rename src_assets/linux/{deb => misc}/postinst (100%) rename src_assets/linux/{deb => misc}/preinst (100%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 285ef572..71abe96e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -56,6 +56,19 @@ jobs: name: Linux runs-on: ubuntu-20.04 needs: check_changelog + strategy: + fail-fast: false # false to test all, true to fail entire job if any fail + matrix: + include: # package these differently + - type: cpack + CMAKE_INSTALL_PREFIX: '/usr/local/sunshine' + SUNSHINE_ASSETS_DIR: 'assets' + SUNSHINE_CONFIG_DIR: 'config' + - type: appimage + CMAKE_INSTALL_PREFIX: '.' + SUNSHINE_ASSETS_DIR: 'usr/local/sunshine/assets' + SUNSHINE_CONFIG_DIR: 'usr/local/sunshine/config' + steps: - name: Checkout uses: actions/checkout@v3 @@ -128,21 +141,39 @@ jobs: - name: Build Linux run: | mkdir -p build + mkdir -p artifacts cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ matrix.CMAKE_INSTALL_PREFIX }} -DSUNSHINE_ASSETS_DIR=${{ matrix.SUNSHINE_ASSETS_DIR }} -DSUNSHINE_CONFIG_DIR=${{ matrix.SUNSHINE_CONFIG_DIR }} -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine -DSUNSHINE_ENABLE_WAYLAND=ON -DSUNSHINE_ENABLE_X11=ON -DSUNSHINE_ENABLE_DRM=ON -DSUNSHINE_ENABLE_CUDA=ON .. make -j ${nproc} + - name: Package Linux - CPACK + if: ${{ matrix.type == 'cpack' }} + working-directory: build + run: | + # package + cpack -G DEB + cpack -G RPM + + # move + mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine.deb + mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm + - name: Set AppImage Version - if: ${{ needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version }} + if: ${{ matrix.type == 'appimage' && ( needs.check_changelog.outputs.next_version_bare != needs.check_changelog.outputs.latest_version ) }} run: | version=${{ needs.check_changelog.outputs.next_version_bare }} echo "VERSION=${version}" >> $GITHUB_ENV - - name: Package Linux + - name: Package Linux - AppImage + if: ${{ matrix.type == 'appimage' }} + working-directory: build run: | - mkdir -p artifacts - cd build + # install sunshine to the DESTDIR + make install DESTDIR=AppDir + + # testing only + ls AppDir # variables DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" @@ -160,7 +191,7 @@ jobs: # export DEPLOY_GTK_VERSION=3 ./linuxdeploy-x86_64.AppImage \ - --appdir . \ + --appdir ./AppDir \ --executable ./sunshine \ --icon-file "../$ICON_FILE" \ --desktop-file "./$DESKTOP_FILE" \ @@ -171,16 +202,11 @@ jobs: # # add this argument back if using gtk plugin # --plugin gtk \ - # package - cpack -G DEB - cpack -G RPM - # move mv Sunshine*.AppImage ../artifacts/sunshine.AppImage - mv ./cpack_artifacts/Sunshine.deb ../artifacts/sunshine.deb - mv ./cpack_artifacts/Sunshine.rpm ../artifacts/sunshine.rpm - name: Verify 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 @@ -193,7 +219,7 @@ jobs: if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-linux + name: sunshine-linux-${{ matrix.type }} path: artifacts/ - name: Create Release @@ -229,7 +255,7 @@ jobs: run: | mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/.assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config .. make -j ${nproc} - name: Package MacOS diff --git a/CMakeLists.txt b/CMakeLists.txt index 68035d54..53358f35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -393,7 +393,7 @@ else() endif() if(NOT SUNSHINE_ASSETS_DIR) - set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/.assets") + set(SUNSHINE_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/assets") endif() if(NOT SUNSHINE_CONFIG_DIR) @@ -535,13 +535,15 @@ if(WIN32) # see options at: https://cmake.org/cmake/help/latest/cpack_gen/nsis.h set(CPACK_COMPONENT_SUNSHINESVC_GROUP "Tools") endif() if(UNIX) + # Installation destination dir + set(CPACK_SET_DESTDIR true) + if(NOT CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local/sunshine") + endif() + install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}") install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/common/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}") - - # Installation destination dir - set(CPACK_SET_DESTDIR true) - set(CMAKE_INSTALL_PREFIX "/usr/local/sunshine/") endif() if(APPLE) # TODO: test @@ -576,14 +578,14 @@ if(UNIX AND NOT APPLE) # Pre and post install set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA - "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/conffiles") - set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/preinst") - set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/deb/postinst") + "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/preinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst;${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/conffiles") + set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/preinst") + set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/postinst") # Dependencies set(CPACK_DEB_COMPONENT_INSTALL ON) set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 | libssl3.0, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") - set(CPACK_RPM_PACKAGE_REQUIRES "libssl==1.1, libavdevice>=58, libboost-thread>=1.67.0, libboost-filesystem>=1.67.0, libboost-log>=1.67.0, libpulse>=0, libopus>=0, libxcb-shm>=0, libxcb-xfixes>=0, libxtst>=0, libevdev>=2.0, libdrm>=2.0, libcap>=2.0") + set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config # AppImage desktop file diff --git a/Portfile.in b/Portfile.in index 2cb35466..3ab6b0ff 100644 --- a/Portfile.in +++ b/Portfile.in @@ -31,8 +31,8 @@ depends_lib port:avahi \ boost.version 1.76 configure.args -DBOOST_ROOT=[boost::install_area] \ - -DSUNSHINE_ASSETS_DIR=${prefix}/usr/local/sunshine/.assets - -DSUNSHINE_CONFIG_DIR=${prefix}/usr/local/sunshine/config + -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine/assets + -DSUNSHINE_CONFIG_DIR=${prefix}/etc/sunshine/config cmake.out_of_source yes diff --git a/src_assets/linux/deb/conffiles b/src_assets/linux/misc/conffiles similarity index 100% rename from src_assets/linux/deb/conffiles rename to src_assets/linux/misc/conffiles diff --git a/src_assets/linux/deb/postinst b/src_assets/linux/misc/postinst similarity index 100% rename from src_assets/linux/deb/postinst rename to src_assets/linux/misc/postinst diff --git a/src_assets/linux/deb/preinst b/src_assets/linux/misc/preinst similarity index 100% rename from src_assets/linux/deb/preinst rename to src_assets/linux/misc/preinst From 0f3eaf0f8406632a678a579e417d72d43bd405dc Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:32:09 -0400 Subject: [PATCH 34/47] Add pip for dependabot --- .github/dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 60b85432..32fce3f3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,3 +6,10 @@ updates: interval: "daily" target-branch: "nightly" open-pull-requests-limit: 20 + + - package-ecosystem: "pip" + directory: "/scripts" + schedule: + interval: "daily" + target-branch: "nightly" + open-pull-requests-limit: 10 From e7ec6050d9a820549d556bf80e6dcb17460ee996 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:32:28 -0400 Subject: [PATCH 35/47] Use portable config directory for AppImage --- .github/workflows/CI.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71abe96e..49436c28 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -65,9 +65,9 @@ jobs: SUNSHINE_ASSETS_DIR: 'assets' SUNSHINE_CONFIG_DIR: 'config' - type: appimage - CMAKE_INSTALL_PREFIX: '.' - SUNSHINE_ASSETS_DIR: 'usr/local/sunshine/assets' - SUNSHINE_CONFIG_DIR: 'usr/local/sunshine/config' + CMAKE_INSTALL_PREFIX: '/usr' + SUNSHINE_ASSETS_DIR: 'sunshine.AppImage.config' + SUNSHINE_CONFIG_DIR: 'sunshine.AppImage.home' steps: - name: Checkout @@ -172,8 +172,11 @@ jobs: # install sunshine to the DESTDIR make install DESTDIR=AppDir - # testing only - ls AppDir + # portable home and config + # todo - this is ugly... we should use a custom AppRun script to take care of this + mv ./AppDir${{ matrix.CMAKE_INSTALL_PREFIX }}/sunshine.AppImage.* ../artifacts/ + mkdir -p ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }} + cp ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/apps.json ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }}/ # variables DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" @@ -204,6 +207,9 @@ jobs: # move mv Sunshine*.AppImage ../artifacts/sunshine.AppImage + + # permissions + chmod +x ../artifacts/sunshine.AppImage - name: Verify AppImage if: ${{ matrix.type == 'appimage' }} @@ -215,6 +221,17 @@ jobs: ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage + - name: Archive AppImage + if: ${{ matrix.type == 'appimage' }} + working-directory: artifacts + run: | + chmod +x ./sunshine.AppImage + + zip --recurse-paths --move --test ./sunshine-appimage.zip ./* + + # testing + ls + - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 From 91cf3bcdcc30d2af4eee6f086d18b64bc34ac2b6 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Tue, 7 Jun 2022 18:32:28 -0400 Subject: [PATCH 36/47] Use portable config directory for AppImage --- .github/workflows/CI.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71abe96e..6fa2d004 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -65,9 +65,9 @@ jobs: SUNSHINE_ASSETS_DIR: 'assets' SUNSHINE_CONFIG_DIR: 'config' - type: appimage - CMAKE_INSTALL_PREFIX: '.' - SUNSHINE_ASSETS_DIR: 'usr/local/sunshine/assets' - SUNSHINE_CONFIG_DIR: 'usr/local/sunshine/config' + CMAKE_INSTALL_PREFIX: '/usr' + SUNSHINE_ASSETS_DIR: 'sunshine.AppImage.config' + SUNSHINE_CONFIG_DIR: 'sunshine.AppImage.home' steps: - name: Checkout @@ -172,8 +172,11 @@ jobs: # install sunshine to the DESTDIR make install DESTDIR=AppDir - # testing only - ls AppDir + # portable home and config + # todo - this is ugly... we should use a custom AppRun script to take care of this + mv ./AppDir${{ matrix.CMAKE_INSTALL_PREFIX }}/sunshine.AppImage.* ../artifacts/ + mkdir -p ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }} + cp ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/apps.json ../artifacts/${{ matrix.SUNSHINE_CONFIG_DIR }}/.config/sunshine/${{ matrix.SUNSHINE_CONFIG_DIR }}/ # variables DESKTOP_FILE="${DESKTOP_FILE:-sunshine.desktop}" @@ -204,6 +207,9 @@ jobs: # move mv Sunshine*.AppImage ../artifacts/sunshine.AppImage + + # permissions + chmod +x ../artifacts/sunshine.AppImage - name: Verify AppImage if: ${{ matrix.type == 'appimage' }} @@ -215,6 +221,14 @@ jobs: ./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage + - name: Archive AppImage + if: ${{ matrix.type == 'appimage' }} + working-directory: artifacts + run: | + chmod +x ./sunshine.AppImage + + zip --recurse-paths --move --test ./sunshine-appimage.zip ./* + - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 From 34f1e89366bf716aadc40c1e287b303627cc5c58 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 8 Jun 2022 21:01:34 -0400 Subject: [PATCH 37/47] Update linux installation instructions --- docs/source/about/installation.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 40eecd20..4fab6e68 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -43,22 +43,24 @@ The current known compatibility of the AppImage is shown below. #. Download and extract `sunshine-appimage.zip` +#. Edit ``/etc/udev/rules.d/85-sunshine-rules.rules`` and add + ``KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"`` Debian Packages ^^^^^^^^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:linux:debian?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Download the corresponding `.deb` file, e.g. ``sunshine-ubuntu_20_04.deb`` -#. ``sudo apt install -f ``, e.g. ``sudo apt install -f ./sunshine-ubuntu_20_04.deb`` +#. Download ``sunshine.deb`` +#. ``sudo apt install -f ./sunshine.deb`` Red Hat Packages ^^^^^^^^^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:linux:fedora?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Download the corresponding `.rpm` file, e.g. ``sunshine-fedora_35.rpm`` -#. ``sudo dnf install ``, e.g. ``sudo dnf install ./sunshine-fedora_35.rpm`` +#. Download ``sunshine.rpm`` +#. ``sudo dnf install ./sunshine.rpm`` .. Hint:: If this is the first time installing. From 4a65d2cafcbd9baf0867168bf47824190e98bce8 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 8 Jun 2022 21:02:28 -0400 Subject: [PATCH 38/47] Fix libssl3 dependency for Ubuntu 22.04 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53358f35..6081f8d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,7 @@ if(UNIX AND NOT APPLE) # Dependencies set(CPACK_DEB_COMPONENT_INSTALL ON) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 | libssl3.0, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 | libssl3, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config From 7cb0286414d6f60dc3f9256588fab0c7f926cf61 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 8 Jun 2022 21:27:41 -0400 Subject: [PATCH 39/47] Fix paths for linux cpack build --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6fa2d004..beea51ec 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -61,9 +61,9 @@ jobs: matrix: include: # package these differently - type: cpack - CMAKE_INSTALL_PREFIX: '/usr/local/sunshine' - SUNSHINE_ASSETS_DIR: 'assets' - SUNSHINE_CONFIG_DIR: 'config' + CMAKE_INSTALL_PREFIX: '' + SUNSHINE_ASSETS_DIR: '/usr/local/sunshine/assets' + SUNSHINE_CONFIG_DIR: '/usr/local/sunshine/config' - type: appimage CMAKE_INSTALL_PREFIX: '/usr' SUNSHINE_ASSETS_DIR: 'sunshine.AppImage.config' From 9b4fc8a2708bc2ed9aee6baa92bbff32cb813b6f Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 8 Jun 2022 23:00:18 -0400 Subject: [PATCH 40/47] Fix udev rules - Adds to permission to create "Sunshine Mouse" --- src_assets/linux/misc/85-sunshine-rules.rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_assets/linux/misc/85-sunshine-rules.rules b/src_assets/linux/misc/85-sunshine-rules.rules index 46a78a4a..77c337c4 100644 --- a/src_assets/linux/misc/85-sunshine-rules.rules +++ b/src_assets/linux/misc/85-sunshine-rules.rules @@ -1 +1 @@ -KERNEL=="uinput", GROUP="input", MODE="0660" \ No newline at end of file +KERNEL=="uinput", GROUP="input", MODE="0660", OPTION+="static_node=uinput" \ No newline at end of file From 65c4f019989009389ca95d9598b943acf96647e2 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 8 Jun 2022 23:00:59 -0400 Subject: [PATCH 41/47] Update documentation - Add copy button to code blocks - Fix some badges - Improve Linux installation instructions --- docs/source/about/advanced_usage.rst | 2 +- docs/source/about/installation.rst | 59 ++++++++++++++------ docs/source/about/third_party_packages.rst | 26 +++------ docs/source/about/usage.rst | 63 +++++++++++++++++----- docs/source/conf.py | 3 +- scripts/requirements.txt | 1 + 6 files changed, 105 insertions(+), 49 deletions(-) diff --git a/docs/source/about/advanced_usage.rst b/docs/source/about/advanced_usage.rst index 7699232c..61c9e60f 100644 --- a/docs/source/about/advanced_usage.rst +++ b/docs/source/about/advanced_usage.rst @@ -1055,7 +1055,7 @@ Description by Moonlight. Default - OS dependent + OS and package dependent Example .. code-block:: text diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index 4fab6e68..deb6f60a 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -21,6 +21,26 @@ Docker Linux ----- +Follow the instructions for your preferred package type below. + +.. Hint:: If this is the first time installing. + + .. code-block:: bash + + sudo usermod -a -G input $USER + sudo reboot now + +.. Tip:: Optionally, run Sunshine in the background. + + .. code-block:: bash + + systemctl --user start sunshine + +.. Note:: If screencasting fails with Wayland, you may need to run the following to force screencasting with X11. + + .. code-block:: bash + + sudo setcap -r $(readlink -f $(which sunshine)) AppImage ^^^^^^^^ @@ -41,39 +61,40 @@ The current known compatibility of the AppImage is shown below. - [✖] Ubuntu trusty - [✖] CentOS 7 - -#. Download and extract `sunshine-appimage.zip` -#. Edit ``/etc/udev/rules.d/85-sunshine-rules.rules`` and add - ``KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"`` +#. Download and extract ``sunshine-appimage.zip`` to your home directory. Debian Packages ^^^^^^^^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:linux:debian?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Download ``sunshine.deb`` -#. ``sudo apt install -f ./sunshine.deb`` +#. Download ``sunshine.deb`` and run the following code. + + .. code-block:: bash + + sudo apt install -f ./sunshine.deb + +.. Tip:: You can double click the deb file to see details about the package and begin installation. Red Hat Packages ^^^^^^^^^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:linux:fedora?logo=github&style=for-the-badge :alt: GitHub issues by-label -#. Download ``sunshine.rpm`` -#. ``sudo dnf install ./sunshine.rpm`` +#. Add `rpmfusion` repositories by running the following code. -.. Hint:: If this is the first time installing. + .. code-block:: bash - .. code-block:: bash + sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ + https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm - sudo usermod -a -G input $USER - sudo reboot now +#. Download ``sunshine.rpm`` and run the following code. -.. Tip:: Optionally, run Sunshine in the background. + .. code-block:: bash - .. code-block:: bash + sudo dnf install ./sunshine.rpm - systemctl --user start sunshine +.. Tip:: You can double click the rpm file to see details about the package and begin installation. MacOS ----- @@ -87,8 +108,12 @@ Disk Image File option: Portfile option: #. Install `MacPorts `_ - #. Download the ``Portfile`` to ``/tmp`` - #. In a terminal run ``cd /tmp && sudo port install`` + #. Download the ``Portfile`` to ``/tmp`` and run the following code. + + .. code-block:: bash + + cd /tmp && sudo port install + #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. Standalone option: diff --git a/docs/source/about/third_party_packages.rst b/docs/source/about/third_party_packages.rst index 6069258a..5b63a496 100644 --- a/docs/source/about/third_party_packages.rst +++ b/docs/source/about/third_party_packages.rst @@ -10,6 +10,7 @@ AUR (Arch Linux User Repository) .. image:: https://img.shields.io/aur/version/sunshine?style=for-the-badge&logo=archlinux :alt: AUR version + :target: https://aur.archlinux.org/packages/sunshine .. image:: https://img.shields.io/aur/last-modified/sunshine?style=for-the-badge&logo=archlinux :alt: AUR last modified @@ -20,38 +21,31 @@ AUR (Arch Linux User Repository) .. image:: https://img.shields.io/aur/maintainer/sunshine?style=for-the-badge&logo=archlinux :alt: AUR maintainer -.. image:: https://img.shields.io/static/v1?label=maintainer&message=hadogenes&color=blue&style=for-the-badge&logo=github - :alt: GitHub Maintainer - :target: https://github.com/hadogenes - Chocolatey ---------- .. image:: https://img.shields.io/chocolatey/v/Sunshine?style=for-the-badge&logo=chocolatey :alt: Chocolatey Version + :target: https://community.chocolatey.org/packages/sunshine .. image:: https://img.shields.io/chocolatey/dt/sunshine?style=for-the-badge&logo=chocolatey :alt: Chocolatey -.. image:: https://img.shields.io/static/v1?label=maintainer&message=AeliusSaionji&color=blue&style=for-the-badge&logo=github - :alt: GitHub Maintainer - :target: https://github.com/AeliusSaionji - Scoop ----- .. image:: https://img.shields.io/scoop/v/sunshine?bucket=extras&style=for-the-badge :alt: Scoop Version (extras bucket) - -.. image:: https://img.shields.io/static/v1?label=maintainer&message=sitiom&color=blue&style=for-the-badge&logo=github - :alt: GitHub Maintainer - :target: https://github.com/sitiom - + :target: https://scoop.sh/#/apps?s=0&d=1&o=true&q=sunshine Legacy GitHub Repo ------------------ -.. Attention:: This repo is no longer maintained. Thank you to Loki for bringing this amazing project to life! +.. Attention:: This repo is not maintained. Thank you to Loki for bringing this amazing project to life! + +.. image:: https://img.shields.io/static/v1?label=repo&message=loki-47-6F-64/sunshine&color=blue&style=for-the-badge&logo=github + :alt: GitHub Maintainer + :target: https://github.com/loki-47-6F-64/sunshine/releases .. image:: https://img.shields.io/github/last-commit/loki-47-6F-64/sunshine?style=for-the-badge&logo=github :alt: GitHub last commit @@ -61,7 +55,3 @@ Legacy GitHub Repo .. image:: https://img.shields.io/github/downloads/loki-47-6F-64/sunshine/total?style=for-the-badge&logo=github :alt: GitHub Releases - -.. image:: https://img.shields.io/static/v1?label=maintainer&message=loki-47-6F-64&color=blue&style=for-the-badge&logo=github - :alt: GitHub Maintainer - :target: https://github.com/loki-47-6F-64 diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 4bb81bc5..8f73d204 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -23,8 +23,9 @@ Usage Add games and applications. This can be configured in the web ui. - .. Note:: Additionally, apps can be configured manually. `assets/apps_.json` is an example of a list of - applications that are started just before running a stream. + .. Note:: Additionally, apps can be configured manually. `src_assets//config/apps.json` is an example of a + list of applications that are started just before running a stream. This is the directory within the GitHub + repo. .. Attention:: Application list is not fully supported on MacOS @@ -55,6 +56,9 @@ Setup Linux ^^^^^ +The deb and rpm packages handle these steps automatically. The AppImage does not, and third party packages may not as +well. + Sunshine needs access to `uinput` to create mouse and gamepad events. Add user to group `input`. @@ -62,13 +66,23 @@ Add user to group `input`. usermod -a -G input $USER + .. Warning:: If the above doesn't work you can try the following. This is not an advised method as it makes the + current user the owner of ``/dev/uinput``. Use at your own risk. + + .. code-block:: bash + + sudo chown $USER /dev/uinput + Create `udev` rules. .. code-block:: bash nano /etc/udev/rules.d/85-sunshine-input.rules - Input the following contents: - ``KERNEL=="uinput", GROUP="input", MODE="0660"`` + Input the following contents. + + .. code-block:: + + KERNEL=="uinput", GROUP="input", MODE="0660", OPTION+="static_node=uinput" Save the file and exit: @@ -76,18 +90,43 @@ Create `udev` rules. #. ``Y`` to save modifications. Configure autostart service - `path/to/build/dir/sunshine.service` is used to start sunshine in the background. To use it, do the following: + - filename: ``~/.config/systemd/user/sunshine.service`` + - contents: - #. Copy it to the users systemd: ``cp sunshine.service ~/.config/systemd/user/`` - #. Starting + .. code-block:: - - One time: ``systemctl --user start sunshine`` - - Always on boot: ``systemctl --user enable sunshine`` + [Unit] + Description=Sunshine Gamestream Server for Moonlight + + [Service] + ExecStart=~/sunshine.AppImage + + [Install] + WantedBy=graphical-session.target + + Start once + .. code-block:: bash + + systemctl --user start sunshine + + Start on boot + .. code-block:: bash + + systemctl --user enable sunshine Additional Setup for KMS - .. Note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. + .. Note:: ``cap_sys_admin`` may as well be root, except you don't need to be root to run it. It is necessary to + allow Sunshine to use KMS. - It is necessary to allow Sunshine to use KMS: ``sudo setcap cap_sys_admin+p sunshine`` + Enable + .. code-block:: bash + + sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine)) + + Disable + .. code-block:: bash + + sudo setcap -r $(readlink -f $(which sunshine)) MacOS ^^^^^ @@ -114,7 +153,7 @@ All shortcuts start with CTRL + ALT + SHIFT, just like Moonlight Application List ---------------- - You can use Environment variables in place of values -- ``$(HOME)` will be replaced by the value of ``$HOME`` +- ``$(HOME)`` will be replaced by the value of ``$HOME`` - ``$$`` will be replaced by ``$``, e.g. ``$$(HOME)`` will be replaced by ``$(HOME)`` - ``env`` - Adds or overwrites Environment variables for the commands/applications run by Sunshine - ``"Variable name":"Variable value"`` diff --git a/docs/source/conf.py b/docs/source/conf.py index f609783c..f4873f15 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,7 +46,8 @@ extensions = [ 'm2r2', # enable markdown files 'sphinx.ext.autosectionlabel', 'sphinx.ext.todo', # enable to-do sections - 'sphinx.ext.viewcode' # add links to view source code + 'sphinx.ext.viewcode', # add links to view source code + 'sphinx_copybutton', # add a copy button to code blocks ] # Add any paths that contain templates here, relative to this directory. diff --git a/scripts/requirements.txt b/scripts/requirements.txt index c089efd9..73eefbe1 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1,4 +1,5 @@ Babel==2.9.1 m2r2==0.3.2 Sphinx==4.5.0 +sphinx-copybutton==0.5.0 sphinx-rtd-theme==1.0.0 From 7a5890469ca60bbe926a4f852f723c741dcbcf91 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 10 Jun 2022 23:20:24 -0400 Subject: [PATCH 42/47] Update MacOS build --- .github/workflows/CI.yml | 95 ++++++++++++++++++++++++++++-- CMakeLists.txt | 3 +- Portfile.in | 86 +++++++++++++++++---------- docs/source/about/installation.rst | 26 +++++++- 4 files changed, 172 insertions(+), 38 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index beea51ec..b5c0772b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -247,7 +247,7 @@ jobs: build_mac: name: MacOS - runs-on: macos-11 + runs-on: macos-12 needs: check_changelog steps: @@ -264,12 +264,33 @@ jobs: # fix openssl header not found cd /usr/local/include ln -s ../opt/openssl/include/openssl . + + # update paths for macports + echo "/opt/local/sbin" >> $GITHUB_PATH + echo "/opt/local/bin" >> $GITHUB_PATH - name: Build MacOS run: | + # variables for Portfile + owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) + repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) + branch=${GITHUB_HEAD_REF} + + # check the branch variable + if [ -z "$branch" ] + then + echo "This is a PUSH event" + branch=${GITHUB_BASE_REF} + else + echo "This is a PR event" + fi + echo "Owner: ${owner}" + echo "Repo: ${repo}" + echo "Branch: ${branch}" + mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} .. make -j ${nproc} - name: Package MacOS @@ -279,12 +300,69 @@ jobs: # package cpack -G DragNDrop + mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-dragndrop.dmg + + cpack -G Bundle + mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-bundle.dmg + cpack -G ZIP + mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos-experimental-archive.zip # move mv Portfile ../artifacts/Portfile - mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos.dmg - mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos.zip + + - name: Setup Macports + run : | + curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.bz2 + tar xf MacPorts-2.7.2.tar.bz2 + + cd MacPorts-2.7.2 + ./configure + make + sudo make install + cd ../ + rm -rf MacPorts-2.7.2* + + # update sources + sudo port -v selfupdate + + # use custom sources + sudo chmod 777 /opt/local/etc/macports/sources.conf + echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf + echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf + sudo chmod 644 /opt/local/etc/macports/sources.conf + + - name: Package with MacPorts + run: | + # setup custom port + mkdir -p ~/ports/multimedia/sunshine + + # copy configured Portfile + cp ./artifacts/Portfile ~/ports/multimedia/sunshine/ + + # index the ports + cd ~/ports + portindex + + # build port + sudo port install sunshine + # || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ + # && exit 1 + + # create packages + sudo port dmg sunshine + sudo port pkg sunshine + + # move + mv $(port work sunshine)/Sunshine*.dmg ./artifacts/sunshine.dmg + mv $(port work sunshine)/Sunshine*.ppkg ./artifacts/sunshine.pkg + + # testing only + ls ~/ports/multimedia/sunshine + cat ~/ports/multimedia/sunshine/Portfile + cat /opt/local/etc/macports/sources.conf + cat ~/ports/Portindex + port search sunshine - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -293,6 +371,15 @@ jobs: name: sunshine-macos path: artifacts/ + # this step can be removed after packages are fixed + - name: Delete experimental packages + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + working-directory: artifacts + run: | + rm -f ./sunshine-macos-experimental-dragndrop.dmg + rm -f ./sunshine-macos-experimental-bundle.dmg + rm -f ./sunshine-macos-experimental-archive.zip + - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master diff --git a/CMakeLists.txt b/CMakeLists.txt index 6081f8d2..2963417e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,9 +443,7 @@ endforeach() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) -############# # CPACK / Packaging -#### # Common options set(CPACK_PACKAGE_NAME "SunshineStream") @@ -562,6 +560,7 @@ if(APPLE) # TODO: test set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") + # set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine") # Portfile configure_file(Portfile.in Portfile @ONLY) diff --git a/Portfile.in b/Portfile.in index 3ab6b0ff..36a7d476 100644 --- a/Portfile.in +++ b/Portfile.in @@ -1,49 +1,75 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -PortSystem 1.0 -PortGroup cmake 1.1 -PortGroup github 1.0 -PortGroup boost 1.0 +PortSystem 1.0 +PortGroup cmake 1.1 +PortGroup github 1.0 +PortGroup boost 1.0 -github.setup sunshinestream sunshine master -version @PROJECT_VERSION@ -revision 1 +# bump revision when changes are made to this file +revision 1 -categories multimedia -license GPL-3 -maintainers {sunshinestream @SunshineStream} {outlook.com:anselm.busse} -platforms darwin +github.setup @GITHUB_OWNER@ @GITHUB_REPO@ @GITHUB_BRANCH@ +name @PROJECT_NAME@ +version @PROJECT_VERSION@ +categories multimedia emulators games +platforms darwin +license GPL-3 +maintainers {@SunshineStream sunshinestream} +description @PROJECT_DESCRIPTION@ +long_description {*}${description} +homepage @PROJECT_HOMEPAGE_URL@ +master_sites https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@/releases -fetch.type git +fetch.type git post-fetch { system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive" } -description @PROJECT_DESCRIPTION@ -long_description {*}${description} -homepage @PROJECT_HOMEPAGE_URL@ +depends_lib port:avahi \ + port:ffmpeg \ + port:libopus -depends_lib port:avahi \ - port:ffmpeg \ - port:libopus +boost.version 1.76 +configure.args -DBOOST_ROOT=[boost::install_area] \ + -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine/assets \ + -DSUNSHINE_CONFIG_DIR=${prefix}/etc/sunshine/config -boost.version 1.76 +cmake.out_of_source yes -configure.args -DBOOST_ROOT=[boost::install_area] \ - -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine/assets - -DSUNSHINE_CONFIG_DIR=${prefix}/etc/sunshine/config - -cmake.out_of_source yes +startupitem.create yes +startupitem.executable "${prefix}/bin/{$name}" +startupitem.location LaunchDaemons +startupitem.name ${name} +startupitem.netchange yes +# is this actually necessary? this should all be handled by CMakeLists destroot { - xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/.assets - xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets - xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets + # install assets + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*.*] ${destroot}${prefix}/etc/${name}/assets + xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*.*] ${destroot}${prefix}/etc/${name}/assets - xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/config - xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*] ${destroot}${prefix}/usr/local/${name}/config - xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*] ${destroot}${prefix}/usr/local/${name}/config + # install web assets + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/css + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/webfonts + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/*.*] ${destroot}${prefix}/etc/${name}/assets/web + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/css + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/webfonts + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/images + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/third_party + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/images/*.*] ${destroot}${prefix}/etc/${name}/assets/web/images + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/third_party/*.*] ${destroot}${prefix}/etc/${name}/assets/web/third_party + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/config + + # install sunshine.conf + xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*.*] ${destroot}${prefix}/etc/${name}/config + + # install apps.json + xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*.*] ${destroot}${prefix}/etc/${name}/config + + # install the binary xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin } diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index deb6f60a..ab4b6888 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -108,13 +108,35 @@ Disk Image File option: Portfile option: #. Install `MacPorts `_ - #. Download the ``Portfile`` to ``/tmp`` and run the following code. + #. Update the Macports sources. .. code-block:: bash - cd /tmp && sudo port install + sudo nano /opt/local/etc/macports/sources.conf + + Add this line, replacing your username, below the line that starts with ``rsync``. + + file://Users//ports + + ``Ctrl+x``, then ``Y`` to exit and save changes. + + #. Download the ``Portfile`` to ``~/Downloads`` and run the following code. + + .. code-block:: bash + + mkdir -p ~/ports/multimedia/sunshine + mv ~/Downlaods/Portfile ~/ports/multimedia/sunshine + cd ~/ports + portindex + sudo port install sunshine #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. + #. Try to run the following code if you get this error: `Dynamic session lookup supported but failed: launchd did + not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!` + + .. code-block:: bash + + launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist Standalone option: #. Download and extract ``sunshine-macos.zip`` From 1a1cf20152ebf7f4134b0a93505fe4912d7149f5 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 10 Jun 2022 23:20:24 -0400 Subject: [PATCH 43/47] Update MacOS build --- .github/workflows/CI.yml | 99 +++++++++++++++++++++++++++++- CMakeLists.txt | 3 +- Portfile.in | 86 +++++++++++++++++--------- docs/source/about/installation.rst | 26 +++++++- 4 files changed, 177 insertions(+), 37 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index beea51ec..b9447f12 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -264,12 +264,35 @@ jobs: # fix openssl header not found cd /usr/local/include ln -s ../opt/openssl/include/openssl . + + # update paths for macports + # echo "/opt/local/sbin" >> $GITHUB_PATH + echo "/Users/runner/macports/sbin" >> $GITHUB_PATH + # echo "/opt/local/bin" >> $GITHUB_PATH + echo "/Users/runner/macports/bin" >> $GITHUB_PATH - name: Build MacOS run: | + # variables for Portfile + owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]' ) + repo=$(echo ${GITHUB_REPOSITORY#*/} | tr '[:upper:]' '[:lower:]' ) + branch=${GITHUB_HEAD_REF} + + # check the branch variable + if [ -z "$branch" ] + then + echo "This is a PUSH event" + branch=${GITHUB_BASE_REF} + else + echo "This is a PR event" + fi + echo "Owner: ${owner}" + echo "Repo: ${repo}" + echo "Branch: ${branch}" + mkdir build cd build - cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config .. + cmake -DCMAKE_BUILD_TYPE=Release -DSUNSHINE_ASSETS_DIR=/usr/local/sunshine/assets -DSUNSHINE_CONFIG_DIR=/usr/local/sunshine/config -DGITHUB_OWNER=${owner} -DGITHUB_REPO=${repo} -DGITHUB_BRANCH=${branch} .. make -j ${nproc} - name: Package MacOS @@ -279,12 +302,73 @@ jobs: # package cpack -G DragNDrop + mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-dragndrop.dmg + + cpack -G Bundle + mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos-experimental-bundle.dmg + cpack -G ZIP + mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos-experimental-archive.zip # move mv Portfile ../artifacts/Portfile - mv ./cpack_artifacts/Sunshine.dmg ../artifacts/sunshine-macos.dmg - mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-macos.zip + + - name: Setup Macports + run : | + curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.bz2 + tar xf MacPorts-2.7.2.tar.bz2 + + cd MacPorts-2.7.2 + ./configure --prefix=/Users/runner/macports + make + sudo make install + cd ../ + rm -rf MacPorts-2.7.2* + + # update sources + sudo port -v selfupdate + + # use custom sources + # sudo chmod 777 /opt/local/etc/macports/sources.conf + sudo chmod 777 /Users/runner/macports/etc/macports/sources.conf + # echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf + echo file://$(echo ~)/ports > /Users/runner/macports/etc/macports/sources.conf + # echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf + echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /Users/runner/macports/etc/macports/sources.conf + # sudo chmod 644 /opt/local/etc/macports/sources.conf + sudo chmod 644 /Users/runner/macports/etc/macports/sources.conf + + - name: Package with MacPorts + run: | + # setup custom port + mkdir -p ~/ports/multimedia/sunshine + + # copy configured Portfile + cp ./artifacts/Portfile ~/ports/multimedia/sunshine/ + + # index the ports + cd ~/ports + portindex + + # build port + sudo port install sunshine + # || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ + # && exit 1 + + # create packages + sudo port dmg sunshine + sudo port pkg sunshine + + # move + mv $(port work sunshine)/Sunshine*.dmg ./artifacts/sunshine.dmg + mv $(port work sunshine)/Sunshine*.ppkg ./artifacts/sunshine.pkg + + # testing only + # ls ~/ports/multimedia/sunshine + # cat ~/ports/multimedia/sunshine/Portfile + # cat /opt/local/etc/macports/sources.conf + # cat ~/ports/Portindex + # port search sunshine - name: Upload Artifacts if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} @@ -293,6 +377,15 @@ jobs: name: sunshine-macos path: artifacts/ + # this step can be removed after packages are fixed + - name: Delete experimental packages + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + working-directory: artifacts + run: | + rm -f ./sunshine-macos-experimental-dragndrop.dmg + rm -f ./sunshine-macos-experimental-bundle.dmg + rm -f ./sunshine-macos-experimental-archive.zip + - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master diff --git a/CMakeLists.txt b/CMakeLists.txt index 6081f8d2..2963417e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,9 +443,7 @@ endforeach() target_compile_options(sunshine PRIVATE $<$:${SUNSHINE_COMPILE_OPTIONS}>;$<$:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) -############# # CPACK / Packaging -#### # Common options set(CPACK_PACKAGE_NAME "SunshineStream") @@ -562,6 +560,7 @@ if(APPLE) # TODO: test set(CPACK_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_BUNDLE_PLIST "${APPLE_PLIST_FILE}") set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/sunshine.icns") + # set(CPACK_BUNDLE_STARTUP_COMMAND "${INSTALL_RUNTIME_DIR}/sunshine") # Portfile configure_file(Portfile.in Portfile @ONLY) diff --git a/Portfile.in b/Portfile.in index 3ab6b0ff..36a7d476 100644 --- a/Portfile.in +++ b/Portfile.in @@ -1,49 +1,75 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -PortSystem 1.0 -PortGroup cmake 1.1 -PortGroup github 1.0 -PortGroup boost 1.0 +PortSystem 1.0 +PortGroup cmake 1.1 +PortGroup github 1.0 +PortGroup boost 1.0 -github.setup sunshinestream sunshine master -version @PROJECT_VERSION@ -revision 1 +# bump revision when changes are made to this file +revision 1 -categories multimedia -license GPL-3 -maintainers {sunshinestream @SunshineStream} {outlook.com:anselm.busse} -platforms darwin +github.setup @GITHUB_OWNER@ @GITHUB_REPO@ @GITHUB_BRANCH@ +name @PROJECT_NAME@ +version @PROJECT_VERSION@ +categories multimedia emulators games +platforms darwin +license GPL-3 +maintainers {@SunshineStream sunshinestream} +description @PROJECT_DESCRIPTION@ +long_description {*}${description} +homepage @PROJECT_HOMEPAGE_URL@ +master_sites https://github.com/@GITHUB_OWNER@/@GITHUB_REPO@/releases -fetch.type git +fetch.type git post-fetch { system -W ${worksrcpath} "${git.cmd} submodule update --init --recursive" } -description @PROJECT_DESCRIPTION@ -long_description {*}${description} -homepage @PROJECT_HOMEPAGE_URL@ +depends_lib port:avahi \ + port:ffmpeg \ + port:libopus -depends_lib port:avahi \ - port:ffmpeg \ - port:libopus +boost.version 1.76 +configure.args -DBOOST_ROOT=[boost::install_area] \ + -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine/assets \ + -DSUNSHINE_CONFIG_DIR=${prefix}/etc/sunshine/config -boost.version 1.76 +cmake.out_of_source yes -configure.args -DBOOST_ROOT=[boost::install_area] \ - -DSUNSHINE_ASSETS_DIR=${prefix}/etc/sunshine/assets - -DSUNSHINE_CONFIG_DIR=${prefix}/etc/sunshine/config - -cmake.out_of_source yes +startupitem.create yes +startupitem.executable "${prefix}/bin/{$name}" +startupitem.location LaunchDaemons +startupitem.name ${name} +startupitem.netchange yes +# is this actually necessary? this should all be handled by CMakeLists destroot { - xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/.assets - xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets - xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*] ${destroot}${prefix}/usr/local/${name}/.assets + # install assets + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/*.*] ${destroot}${prefix}/etc/${name}/assets + xinstall {*}[glob ${worksrcpath}/src_assets/macos/assets/*.*] ${destroot}${prefix}/etc/${name}/assets - xinstall -d -m 755 ${destroot}${prefix}/usr/local/${name}/config - xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*] ${destroot}${prefix}/usr/local/${name}/config - xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*] ${destroot}${prefix}/usr/local/${name}/config + # install web assets + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/css + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/webfonts + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/*.*] ${destroot}${prefix}/etc/${name}/assets/web + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/css/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/css + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/fonts/fontawesome-free-web/webfonts/*.*] ${destroot}${prefix}/etc/${name}/assets/web/fonts/fontawesome-free-web/webfonts + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/images + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/assets/web/third_party + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/images/*.*] ${destroot}${prefix}/etc/${name}/assets/web/images + xinstall {*}[glob ${worksrcpath}/src_assets/common/assets/web/third_party/*.*] ${destroot}${prefix}/etc/${name}/assets/web/third_party + xinstall -d -m 755 ${destroot}${prefix}/etc/${name}/config + + # install sunshine.conf + xinstall {*}[glob ${worksrcpath}/src_assets/common/config/*.*] ${destroot}${prefix}/etc/${name}/config + + # install apps.json + xinstall {*}[glob ${worksrcpath}/src_assets/macos/config/*.*] ${destroot}${prefix}/etc/${name}/config + + # install the binary xinstall ${workpath}/build/${name} ${destroot}${prefix}/bin } diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index deb6f60a..ab4b6888 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -108,13 +108,35 @@ Disk Image File option: Portfile option: #. Install `MacPorts `_ - #. Download the ``Portfile`` to ``/tmp`` and run the following code. + #. Update the Macports sources. .. code-block:: bash - cd /tmp && sudo port install + sudo nano /opt/local/etc/macports/sources.conf + + Add this line, replacing your username, below the line that starts with ``rsync``. + + file://Users//ports + + ``Ctrl+x``, then ``Y`` to exit and save changes. + + #. Download the ``Portfile`` to ``~/Downloads`` and run the following code. + + .. code-block:: bash + + mkdir -p ~/ports/multimedia/sunshine + mv ~/Downlaods/Portfile ~/ports/multimedia/sunshine + cd ~/ports + portindex + sudo port install sunshine #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. + #. Try to run the following code if you get this error: `Dynamic session lookup supported but failed: launchd did + not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!` + + .. code-block:: bash + + launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist Standalone option: #. Download and extract ``sunshine-macos.zip`` From 9990b9b04b1146680efd6fe8e8871a98ba0248d1 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:50:22 -0400 Subject: [PATCH 44/47] Separate job for Macports build --- .github/workflows/CI.yml | 123 ++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 40 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index acf8b120..d777444b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -230,7 +230,6 @@ jobs: zip --recurse-paths --move --test ./sunshine-appimage.zip ./* - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: name: sunshine-linux-${{ matrix.type }} @@ -247,7 +246,7 @@ jobs: build_mac: name: MacOS - runs-on: macos-12 + runs-on: macos-11 needs: check_changelog steps: @@ -256,20 +255,20 @@ jobs: with: submodules: recursive + # this is for the macports job + - name: Cache Artifacts + uses: actions/cache@v3 + with: + path: artifacts + key: ${{ runner.os }}-artifacts + - name: Setup Dependencies MacOS run: | # install dependencies using homebrew brew install boost cmake ffmpeg opus # fix openssl header not found - cd /usr/local/include - ln -s ../opt/openssl/include/openssl . - - # update paths for macports - # echo "/opt/local/sbin" >> $GITHUB_PATH - echo "/Users/runner/macports/sbin" >> $GITHUB_PATH - # echo "/opt/local/bin" >> $GITHUB_PATH - echo "/Users/runner/macports/bin" >> $GITHUB_PATH + ln -sf /usr/local/opt/openssl/include/openssl /usr/local/include/openssl - name: Build MacOS run: | @@ -297,6 +296,10 @@ jobs: - name: Package MacOS run: | + # remove cached artifacts + rm -r -f ./artifacts + mkdir artifacts + mkdir -p artifacts cd build @@ -313,47 +316,98 @@ jobs: # move mv Portfile ../artifacts/Portfile + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: sunshine-macos + path: artifacts/ + + # this step can be removed after packages are fixed + - name: Delete experimental packages + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + working-directory: artifacts + run: | + rm -f ./sunshine-macos-experimental-dragndrop.dmg + rm -f ./sunshine-macos-experimental-bundle.dmg + rm -f ./sunshine-macos-experimental-archive.zip + + - name: Create Release + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: SunshineStream/actions/create_release@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + next_version: ${{ needs.check_changelog.outputs.next_version }} + last_version: ${{ needs.check_changelog.outputs.last_version }} + release_body: ${{ needs.check_changelog.outputs.release_body }} + + build_mac_port: + name: Macports + runs-on: macos-11 + needs: [check_changelog, build_mac] + if: never() # disable this job + + steps: + - name: Cache Artifacts + uses: actions/cache@v3 + with: + path: artifacts + key: ${{ runner.os }}-artifacts + - name: Setup Macports run : | + # update paths for macports + echo "/opt/local/sbin" >> $GITHUB_PATH + echo "/opt/local/bin" >> $GITHUB_PATH + + # Set OpenSSL 1.1 as default + # rm -rf /usr/local/opt/openssl + # rm -rf /usr/local/bin/openssl + # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o/bin/openssl /usr/local/bin/openssl + # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o /usr/local/opt/openssl + + # download and extract macports curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.bz2 tar xf MacPorts-2.7.2.tar.bz2 + # build macports cd MacPorts-2.7.2 - ./configure --prefix=/Users/runner/macports + ./configure make sudo make install cd ../ rm -rf MacPorts-2.7.2* - + + - name: Configure Macports + run: | # update sources sudo port -v selfupdate # use custom sources - # sudo chmod 777 /opt/local/etc/macports/sources.conf - sudo chmod 777 /Users/runner/macports/etc/macports/sources.conf - # echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf - echo file://$(echo ~)/ports > /Users/runner/macports/etc/macports/sources.conf - # echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf - echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /Users/runner/macports/etc/macports/sources.conf - # sudo chmod 644 /opt/local/etc/macports/sources.conf - sudo chmod 644 /Users/runner/macports/etc/macports/sources.conf - - - name: Package with MacPorts - run: | + sudo chmod 777 /opt/local/etc/macports/sources.conf + echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf + echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf + sudo chmod 644 /opt/local/etc/macports/sources.conf + # setup custom port mkdir -p ~/ports/multimedia/sunshine # copy configured Portfile - cp ./artifacts/Portfile ~/ports/multimedia/sunshine/ + mv ./artifacts/Portfile ~/ports/multimedia/sunshine/ + + # remove remaining cached artifacts + rm -r -f ./artifacts + mkdir artifacts # index the ports cd ~/ports portindex - + + - name: Build + run: | # build port - sudo port install sunshine - # || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ - # && exit 1 + sudo port install sunshine \ + || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ + && exit 1 # create packages sudo port dmg sunshine @@ -371,21 +425,11 @@ jobs: # port search sunshine - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: - name: sunshine-macos + name: sunshine-macports path: artifacts/ - # this step can be removed after packages are fixed - - name: Delete experimental packages - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - working-directory: artifacts - run: | - rm -f ./sunshine-macos-experimental-dragndrop.dmg - rm -f ./sunshine-macos-experimental-bundle.dmg - rm -f ./sunshine-macos-experimental-archive.zip - - name: Create Release if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: SunshineStream/actions/create_release@master @@ -449,7 +493,6 @@ jobs: mv ./cpack_artifacts/Sunshine.zip ../artifacts/sunshine-windows.zip - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 with: name: sunshine-windows From ca21e6a8ac80c91767da5d6e52d4318f0ec35624 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:52:38 -0400 Subject: [PATCH 45/47] Update documentation --- docs/source/about/installation.rst | 37 +---------------- docs/source/about/usage.rst | 41 ++++++++++++------- docs/source/toc.rst | 9 ++++ docs/source/troubleshooting/general.rst | 13 ++++++ docs/source/troubleshooting/linux.rst | 9 ++++ docs/source/troubleshooting/macos.rst | 14 +++++++ docs/source/troubleshooting/windows.rst | 7 ++++ src_assets/linux/misc/85-sunshine-rules.rules | 2 +- 8 files changed, 80 insertions(+), 52 deletions(-) create mode 100644 docs/source/troubleshooting/general.rst create mode 100644 docs/source/troubleshooting/linux.rst create mode 100644 docs/source/troubleshooting/macos.rst create mode 100644 docs/source/troubleshooting/windows.rst diff --git a/docs/source/about/installation.rst b/docs/source/about/installation.rst index ab4b6888..2176206a 100644 --- a/docs/source/about/installation.rst +++ b/docs/source/about/installation.rst @@ -23,25 +23,6 @@ Linux ----- Follow the instructions for your preferred package type below. -.. Hint:: If this is the first time installing. - - .. code-block:: bash - - sudo usermod -a -G input $USER - sudo reboot now - -.. Tip:: Optionally, run Sunshine in the background. - - .. code-block:: bash - - systemctl --user start sunshine - -.. Note:: If screencasting fails with Wayland, you may need to run the following to force screencasting with X11. - - .. code-block:: bash - - sudo setcap -r $(readlink -f $(which sunshine)) - AppImage ^^^^^^^^ .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/pkg:appimage?logo=github&style=for-the-badge @@ -101,12 +82,7 @@ MacOS .. image:: https://img.shields.io/github/issues/sunshinestream/sunshine/os:macos?logo=github&style=for-the-badge :alt: GitHub issues by-label -Disk Image File option: - #. Download and install ``sunshine.dmg`` - - .. Warning:: The Disk Image File is experimental. Limited support will be provided. - -Portfile option: +Portfile #. Install `MacPorts `_ #. Update the Macports sources. @@ -131,17 +107,6 @@ Portfile option: sudo port install sunshine #. The first time you start Sunshine, you will be asked to grant access to screen recording and your microphone. - #. Try to run the following code if you get this error: `Dynamic session lookup supported but failed: launchd did - not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!` - - .. code-block:: bash - - launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist - -Standalone option: - #. Download and extract ``sunshine-macos.zip`` - - .. Warning:: The Standalone package is experimental. Limited support will be provided. Windows ------- diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index 8f73d204..79d285f9 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -56,33 +56,26 @@ Setup Linux ^^^^^ -The deb and rpm packages handle these steps automatically. The AppImage does not, and third party packages may not as -well. +The deb and rpm packages handle these steps automatically. The AppImage does not, third party packages may not as well. Sunshine needs access to `uinput` to create mouse and gamepad events. -Add user to group `input`. +Add user to group `input`, if this is the first time installing. .. code-block:: bash - usermod -a -G input $USER - - .. Warning:: If the above doesn't work you can try the following. This is not an advised method as it makes the - current user the owner of ``/dev/uinput``. Use at your own risk. - - .. code-block:: bash - - sudo chown $USER /dev/uinput + sudo usermod -a -G input $USER + sudo reboot now Create `udev` rules. .. code-block:: bash - nano /etc/udev/rules.d/85-sunshine-input.rules + sudo nano /etc/udev/rules.d/85-sunshine-input.rules Input the following contents. .. code-block:: - KERNEL=="uinput", GROUP="input", MODE="0660", OPTION+="static_node=uinput" + KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput" Save the file and exit: @@ -99,11 +92,22 @@ Configure autostart service Description=Sunshine Gamestream Server for Moonlight [Service] - ExecStart=~/sunshine.AppImage + ExecStart= [Install] WantedBy=graphical-session.target + .. table:: + :widths: auto + + ======== =================== =============== + package ExecStart Auto Configured + ======== =================== =============== + deb /usr/bin/sunshine ✔ + rpm /usr/bin/sunshine ✔ + AppImage ~/sunshine.AppImage ✖ + ======== =================== =============== + Start once .. code-block:: bash @@ -137,7 +141,14 @@ select their sink as audio device in `sunshine.conf`. .. Note:: Command Keys are not forwarded by Moonlight. Right Option-Key is mapped to CMD-Key. -.. Caution:: Gamepads are not supported. +.. Caution:: Gamepads are not currently supported. + +Configure autostart service + + MacPorts + .. code-block:: bash + + sudo port load Sunshine Windows ^^^^^^^ diff --git a/docs/source/toc.rst b/docs/source/toc.rst index 9c0989ee..efafa92b 100644 --- a/docs/source/toc.rst +++ b/docs/source/toc.rst @@ -9,6 +9,15 @@ about/usage about/advanced_usage +.. toctree:: + :maxdepth: 2 + :caption: Troubleshooting + + troubleshooting/general + troubleshooting/linux + troubleshooting/macos + troubleshooting/windows + .. toctree:: :maxdepth: 2 :caption: Build diff --git a/docs/source/troubleshooting/general.rst b/docs/source/troubleshooting/general.rst new file mode 100644 index 00000000..322327cc --- /dev/null +++ b/docs/source/troubleshooting/general.rst @@ -0,0 +1,13 @@ +:github_url: https://github.com/SunshineStream/Sunshine/tree/nightly/docs/source/troubleshooting/general.rst + +General +======= +If you forgot your credentials to the web UI, try this. + + .. code-block:: bash + + sunshine -creds + +Can't access the web UI? + + #. Check firefall rules. diff --git a/docs/source/troubleshooting/linux.rst b/docs/source/troubleshooting/linux.rst new file mode 100644 index 00000000..71e9eac0 --- /dev/null +++ b/docs/source/troubleshooting/linux.rst @@ -0,0 +1,9 @@ +:github_url: https://github.com/SunshineStream/Sunshine/tree/nightly/docs/source/troubleshooting/linux.rst + +Linux +===== +If screencasting fails with Wayland, you may need to run the following to force screencasting with X11. + + .. code-block:: bash + + sudo setcap -r $(readlink -f $(which sunshine)) diff --git a/docs/source/troubleshooting/macos.rst b/docs/source/troubleshooting/macos.rst new file mode 100644 index 00000000..18ea9361 --- /dev/null +++ b/docs/source/troubleshooting/macos.rst @@ -0,0 +1,14 @@ +:github_url: https://github.com/SunshineStream/Sunshine/tree/nightly/docs/source/troubleshooting/macos.rst + +MacOS +===== +If you get this error: + + ``Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that + org.freedesktop.dbus-session.plist is loaded!`` + + Try this. + + .. code-block:: bash + + launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist diff --git a/docs/source/troubleshooting/windows.rst b/docs/source/troubleshooting/windows.rst new file mode 100644 index 00000000..461bce0a --- /dev/null +++ b/docs/source/troubleshooting/windows.rst @@ -0,0 +1,7 @@ +:github_url: https://github.com/SunshineStream/Sunshine/tree/nightly/docs/source/troubleshooting/windows.rst + +Windows +======= +No gamepad is detected. + + #. Verify that you've installed `ViGEmBus `_. diff --git a/src_assets/linux/misc/85-sunshine-rules.rules b/src_assets/linux/misc/85-sunshine-rules.rules index 77c337c4..a1ee7cd0 100644 --- a/src_assets/linux/misc/85-sunshine-rules.rules +++ b/src_assets/linux/misc/85-sunshine-rules.rules @@ -1 +1 @@ -KERNEL=="uinput", GROUP="input", MODE="0660", OPTION+="static_node=uinput" \ No newline at end of file +KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput" \ No newline at end of file From e86207606af6eee2a02e95e017ee2cf864d65662 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 15 Jun 2022 15:53:04 -0400 Subject: [PATCH 46/47] Use openssl for deb package instead of libssl1.1/3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2963417e..5c9a135f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -583,7 +583,7 @@ if(UNIX AND NOT APPLE) # Dependencies set(CPACK_DEB_COMPONENT_INSTALL ON) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl1.1 | libssl3, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "openssl, libavdevice58, libboost-thread1.67.0 | libboost-thread1.71.0 | libboost-thread1.74.0, libboost-filesystem1.67.0 | libboost-filesystem1.71.0 | libboost-filesystem1.74.0, libboost-log1.67.0 | libboost-log1.71.0 | libboost-log1.74.0, libpulse0, libopus0, libxcb-shm0, libxcb-xfixes0, libxtst6, libevdev2, libdrm2, libcap2") set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.1, libavdevice >= 4.3, boost-thread >= 1.67.0, boost-filesystem >= 1.67.0, boost-log >= 1.67.0, pulseaudio-libs >= 10.0, libopusenc >= 0.2.1, libxcb >= 1.13, libXtst >= 1.2.3, libevdev >= 1.5.6, libdrm >= 2.4.97, libcap >= 2.22") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) # This should automatically figure out dependencies, doesn't work with the current config From dd73f45175c4028c24ea91f251eba7afcb6194df Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 15 Jun 2022 16:05:23 -0400 Subject: [PATCH 47/47] Deactivate mac port job --- .github/workflows/CI.yml | 195 +++++++++++++++++++-------------------- 1 file changed, 97 insertions(+), 98 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d777444b..18d7e89c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -340,104 +340,103 @@ jobs: last_version: ${{ needs.check_changelog.outputs.last_version }} release_body: ${{ needs.check_changelog.outputs.release_body }} - build_mac_port: - name: Macports - runs-on: macos-11 - needs: [check_changelog, build_mac] - if: never() # disable this job - - steps: - - name: Cache Artifacts - uses: actions/cache@v3 - with: - path: artifacts - key: ${{ runner.os }}-artifacts - - - name: Setup Macports - run : | - # update paths for macports - echo "/opt/local/sbin" >> $GITHUB_PATH - echo "/opt/local/bin" >> $GITHUB_PATH - - # Set OpenSSL 1.1 as default - # rm -rf /usr/local/opt/openssl - # rm -rf /usr/local/bin/openssl - # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o/bin/openssl /usr/local/bin/openssl - # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o /usr/local/opt/openssl - - # download and extract macports - curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.bz2 - tar xf MacPorts-2.7.2.tar.bz2 - - # build macports - cd MacPorts-2.7.2 - ./configure - make - sudo make install - cd ../ - rm -rf MacPorts-2.7.2* - - - name: Configure Macports - run: | - # update sources - sudo port -v selfupdate - - # use custom sources - sudo chmod 777 /opt/local/etc/macports/sources.conf - echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf - echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf - sudo chmod 644 /opt/local/etc/macports/sources.conf - - # setup custom port - mkdir -p ~/ports/multimedia/sunshine - - # copy configured Portfile - mv ./artifacts/Portfile ~/ports/multimedia/sunshine/ - - # remove remaining cached artifacts - rm -r -f ./artifacts - mkdir artifacts - - # index the ports - cd ~/ports - portindex - - - name: Build - run: | - # build port - sudo port install sunshine \ - || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ - && exit 1 - - # create packages - sudo port dmg sunshine - sudo port pkg sunshine - - # move - mv $(port work sunshine)/Sunshine*.dmg ./artifacts/sunshine.dmg - mv $(port work sunshine)/Sunshine*.ppkg ./artifacts/sunshine.pkg - - # testing only - # ls ~/ports/multimedia/sunshine - # cat ~/ports/multimedia/sunshine/Portfile - # cat /opt/local/etc/macports/sources.conf - # cat ~/ports/Portindex - # port search sunshine - - - name: Upload Artifacts - uses: actions/upload-artifact@v3 - with: - name: sunshine-macports - path: artifacts/ - - - name: Create Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: SunshineStream/actions/create_release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - next_version: ${{ needs.check_changelog.outputs.next_version }} - last_version: ${{ needs.check_changelog.outputs.last_version }} - release_body: ${{ needs.check_changelog.outputs.release_body }} +# build_mac_port: +# name: Macports +# runs-on: macos-11 +# needs: [check_changelog, build_mac] +# +# steps: +# - name: Cache Artifacts +# uses: actions/cache@v3 +# with: +# path: artifacts +# key: ${{ runner.os }}-artifacts +# +# - name: Setup Macports +# run : | +# # update paths for macports +# echo "/opt/local/sbin" >> $GITHUB_PATH +# echo "/opt/local/bin" >> $GITHUB_PATH +# +# # Set OpenSSL 1.1 as default +# # rm -rf /usr/local/opt/openssl +# # rm -rf /usr/local/bin/openssl +# # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o/bin/openssl /usr/local/bin/openssl +# # ln -sf /usr/local/Cellar/openssl@1.1/1.1.1o /usr/local/opt/openssl +# +# # download and extract macports +# curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.2.tar.bz2 +# tar xf MacPorts-2.7.2.tar.bz2 +# +# # build macports +# cd MacPorts-2.7.2 +# ./configure +# make +# sudo make install +# cd ../ +# rm -rf MacPorts-2.7.2* +# +# - name: Configure Macports +# run: | +# # update sources +# sudo port -v selfupdate +# +# # use custom sources +# sudo chmod 777 /opt/local/etc/macports/sources.conf +# echo file://$(echo ~)/ports > /opt/local/etc/macports/sources.conf +# echo rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default] >> /opt/local/etc/macports/sources.conf +# sudo chmod 644 /opt/local/etc/macports/sources.conf +# +# # setup custom port +# mkdir -p ~/ports/multimedia/sunshine +# +# # copy configured Portfile +# mv ./artifacts/Portfile ~/ports/multimedia/sunshine/ +# +# # remove remaining cached artifacts +# rm -r -f ./artifacts +# mkdir artifacts +# +# # index the ports +# cd ~/ports +# portindex +# +# - name: Build +# run: | +# # build port +# sudo port install sunshine \ +# || cat /opt/local/var/macports/logs/_Users_runner_ports_multimedia_sunshine/Sunshine/main.log \ +# && exit 1 +# +# # create packages +# sudo port dmg sunshine +# sudo port pkg sunshine +# +# # move +# mv $(port work sunshine)/Sunshine*.dmg ./artifacts/sunshine.dmg +# mv $(port work sunshine)/Sunshine*.ppkg ./artifacts/sunshine.pkg +# +# # testing only +# # ls ~/ports/multimedia/sunshine +# # cat ~/ports/multimedia/sunshine/Portfile +# # cat /opt/local/etc/macports/sources.conf +# # cat ~/ports/Portindex +# # port search sunshine +# +# - name: Upload Artifacts +# uses: actions/upload-artifact@v3 +# with: +# name: sunshine-macports +# path: artifacts/ +# +# - name: Create Release +# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} +# uses: SunshineStream/actions/create_release@master +# with: +# token: ${{ secrets.GITHUB_TOKEN }} +# next_version: ${{ needs.check_changelog.outputs.next_version }} +# last_version: ${{ needs.check_changelog.outputs.last_version }} +# release_body: ${{ needs.check_changelog.outputs.release_body }} build_win: name: Windows