From e01964746afe2d0ac92160c5a8f51bb67bf8a55b Mon Sep 17 00:00:00 2001 From: myothk Date: Mon, 1 Jul 2024 02:56:00 +0630 Subject: [PATCH] New package: sunshine-0.23.1 --- srcpkgs/sunshine/files/sunshine/run | 4 + .../patches/endianness-detection.patch | 21 ++++ srcpkgs/sunshine/patches/ffmpeg.patch | 11 ++ srcpkgs/sunshine/patches/fix-systemd.patch | 30 ++++++ srcpkgs/sunshine/template | 101 ++++++++++++++++++ 5 files changed, 167 insertions(+) create mode 100644 srcpkgs/sunshine/files/sunshine/run create mode 100644 srcpkgs/sunshine/patches/endianness-detection.patch create mode 100644 srcpkgs/sunshine/patches/ffmpeg.patch create mode 100644 srcpkgs/sunshine/patches/fix-systemd.patch create mode 100644 srcpkgs/sunshine/template diff --git a/srcpkgs/sunshine/files/sunshine/run b/srcpkgs/sunshine/files/sunshine/run new file mode 100644 index 00000000000000..cca2ef1d370783 --- /dev/null +++ b/srcpkgs/sunshine/files/sunshine/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +sv check dbus > /dev/null || exit 1 +exec sunshine ${OPTS} diff --git a/srcpkgs/sunshine/patches/endianness-detection.patch b/srcpkgs/sunshine/patches/endianness-detection.patch new file mode 100644 index 00000000000000..255ada3b6cceef --- /dev/null +++ b/srcpkgs/sunshine/patches/endianness-detection.patch @@ -0,0 +1,21 @@ +# makes both musl and glic detect endianness +--- a/src/utility.h ++++ b/src/utility.h +@@ -944,7 +944,7 @@ + template + struct endianness { + enum : bool { +-#if defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN || \ ++#if defined(__BYTE_ORDER__) && __BYTE_ORDER == __BIG_ENDIAN || \ + defined(__BIG_ENDIAN__) || \ + defined(__ARMEB__) || \ + defined(__THUMBEB__) || \ +@@ -952,7 +952,7 @@ + defined(_MIBSEB) || defined(__MIBSEB) || defined(__MIBSEB__) + // It's a big-endian target architecture + little = false, +-#elif defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN || \ ++#elif defined(__BYTE_ORDER__) && __BYTE_ORDER == __LITTLE_ENDIAN || \ + defined(__LITTLE_ENDIAN__) || \ + defined(__ARMEL__) || \ + defined(__THUMBEL__) || \ diff --git a/srcpkgs/sunshine/patches/ffmpeg.patch b/srcpkgs/sunshine/patches/ffmpeg.patch new file mode 100644 index 00000000000000..50a2f3850b82ec --- /dev/null +++ b/srcpkgs/sunshine/patches/ffmpeg.patch @@ -0,0 +1,11 @@ +# remove mfx +--- a/cmake/dependencies/common.cmake ++++ b/cmake/dependencies/common.cmake +@@ -39,7 +39,6 @@ + elseif(UNIX) + set(FFMPEG_PLATFORM_LIBRARIES va va-drm va-x11 vdpau X11) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") +- list(APPEND FFMPEG_PLATFORM_LIBRARIES mfx) + set(FFMPEG_PREPARED_BINARIES "${CMAKE_SOURCE_DIR}/third-party/build-deps/ffmpeg/linux-x86_64") + set(CPACK_DEB_PLATFORM_PACKAGE_DEPENDS "libmfx1,") + set(CPACK_RPM_PLATFORM_PACKAGE_REQUIRES "intel-mediasdk >= 22.3.0,") diff --git a/srcpkgs/sunshine/patches/fix-systemd.patch b/srcpkgs/sunshine/patches/fix-systemd.patch new file mode 100644 index 00000000000000..d14576d066fd3f --- /dev/null +++ b/srcpkgs/sunshine/patches/fix-systemd.patch @@ -0,0 +1,30 @@ +# remove systemd requirement. +--- a/cmake/packaging/linux.cmake ++++ b/cmake/packaging/linux.cmake +@@ -11,13 +11,10 @@ if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" + DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user") + else() +- find_package(Systemd) + find_package(Udev) + + install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/60-sunshine.rules" + DESTINATION "${UDEV_RULES_INSTALL_DIR}") +- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service" +- DESTINATION "${SYSTEMD_USER_UNIT_INSTALL_DIR}") + endif() + + # Post install + +# change .desktop file to not use systemctl. +--- a/packaging/linux/sunshine.desktop ++++ b/packaging/linux/sunshine.desktop +@@ -1,7 +1,7 @@ + [Desktop Entry] + Type=Application + Name=@PROJECT_NAME@ +-Exec=/usr/bin/env systemctl start --u sunshine ++Exec=sunshine + Version=1.0 + Comment=@PROJECT_DESCRIPTION@ + Icon=sunshine diff --git a/srcpkgs/sunshine/template b/srcpkgs/sunshine/template new file mode 100644 index 00000000000000..4fea0f823bcdad --- /dev/null +++ b/srcpkgs/sunshine/template @@ -0,0 +1,101 @@ +# Template file for 'sunshine' +pkgname=sunshine +version=0.23.1 +revision=1 +archs="x86_64* aarch64*" +build_style=cmake +configure_args="-Wno-dev -DBUILD_TESTS=OFF -DSUNSHINE_EXECUTABLE_PATH=/usr/bin/sunshine + -DSUNSHINE_ASSETS_DIR=/usr/share/sunshine" +hostmakedepends="boost cmake git make nodejs pkg-config wayland-devel" +makedepends="boost-devel doxygen ffmpeg-devel graphviz libayatana-appindicator-devel libboost_filesystem + libboost_locale libboost_program_options libcap-devel libcurl-devel libdrm-devel libevdev-devel + libnuma-devel libnotify-devel libopusenc-devel libsvt-av1-devel libva-devel libvdpau-devel libX11-devel + libxcb-devel libXcursor-devel libXfixes-devel libXi-devel libXinerama-devel libXrandr-devel + libXtst-devel MesaLib-devel miniupnpc-devel nv-codec-headers opus-devel openssl-devel + pulseaudio-devel x264-devel x265-devel wayland-protocols" +short_desc="Self-hosted GameStream host for Moonlight" +maintainer="myothk " +license="GPL-3.0-only" +homepage="https://app.lizardbyte.dev/Sunshine" + +# sub modules +_tpc_ver="1.6.2" +_vgec_ver="8d71f6740ffff4671cdadbca255ce528e3cd3fef" +_build_deps_ver="efd3a380113e8ae98ae68cc1d73fd7c4b54b03c6" +_googletest_ver="1.14.0" +_moonlight_commonc_ver="cbd0ec1b25edfb8ee8645fffa49ff95b6e04c70e" +_nanors_ver="e9e242e98e27037830490b2a752895ca68f75f8b" +_nvcodec_headers_ver="22441b505d9d9afc1e3002290820909846c24bdc" +_nvapi_opensdk_ver="R535" +_tray_ver="4d8b798cafdd11285af9409c16b5f792968e0045" +_wayland_protocols_ver="1.35" +_wlr_protocols_ver="2b8d43325b7012cc3f9b55c08d26e50e42beac7d" +_simplewebserver_ver="27b41f5ee154cca0fce4fe2955dd886d04e3a4ed" +_enet_ver="04e27590670a87a7cd40f5a05cda97467e4e25a3" +distfiles="https://github.com/LizardByte/Sunshine/archive/refs/tags/v${version}.tar.gz + https://github.com/michaeltyson/TPCircularBuffer/archive/refs/tags/${_tpc_ver}.tar.gz>TPCircularBuffer-${_tpc_ver}.tar.gz + https://github.com/LizardByte/Virtual-Gamepad-Emulation-Client/archive/${_vgec_ver}.tar.gz>ViGEmClient-${_vgec_ver}.tar.gz + https://github.com/LizardByte/build-deps/archive/${_build_deps_ver}.tar.gz>build-deps-${_build_deps_ver}.tar.gz + https://github.com/google/googletest/archive/refs/tags/v${_googletest_ver}.tar.gz>googletest-${_googletest_ver}.tar.gz + https://github.com/moonlight-stream/moonlight-common-c/archive/${_moonlight_commonc_ver}.tar.gz>moonlight-common-c-${_moonlight_commonc_ver}.tar.gz + https://github.com/sleepybishop/nanors/archive/${_nanors_ver}.tar.gz>nanors-${_nanors_ver}.tar.gz + https://github.com/FFmpeg/nv-codec-headers/archive/${_nvcodec_headers_ver}.tar.gz>nv-codec-headers-${_nvcodec_headers_ver}.tar.gz + https://github.com/LizardByte/nvapi-open-source-sdk/archive/refs/tags/${_nvapi_opensdk_ver}.tar.gz>nvapi-open-source-sdk-${_nvapi_opensdk_ver}.tar.gz + https://github.com/LizardByte/tray/archive/${_tray_ver}.tar.gz>tray-${_tray_ver}.tar.gz + https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/${_wayland_protocols_ver}/wayland-protocols-${_wayland_protocols_ver}.tar.gz>wayland-protocols-${_wayland_protocols_ver}.tar.gz + https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/archive/${_wlr_protocols_ver}/wlr-protocols-${_wlr_protocols_ver}.tar.gz>wlr-protocols-${_wlr_protocols_ver}.tar.gz + https://gitlab.com/eidheim/Simple-Web-Server/-/archive/${_simplewebserver_ver}/Simple-Web-Server-${_simplewebserver_ver}.tar.gz>Simple-Web-Server-${_simplewebserver_ver}.tar.gz + https://github.com/cgutman/enet/archive/${_enet_ver}.zip>enet-${_enet_ver}.tar.gz" +checksum="f811b07950a6bfd041e80cc424f95e29d4ba84a8bcdf2a61d5cdc751152c9927 + 3741283950fb001de383478438fea8dd644bbf043cded1dfc70a4bd87b2bc964 + 27907cba8c017de220b66e036ed04a39f5eacb9182846700047420aef2f5cd0e + c6d9343c8a6306e1b6025bf30893f555b1f1f1a3ffe75ddd3e2e67911adc7339 + 8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7 + 8390c3fc51796d228577c6887bfa7c3afda42cc18e5967187951c3e0ad343458 + fee62ecffef3b456e789852787cf534f4712e1a7973bcdd5763baad4b7d2e879 + dc28f764fbc72f6ac2a96fcace252e6ecc84b308b8d4400820203cc901bae596 + 689c124192ea1e10dbc907d9d51bd0a30e4bbc1ed3a98a46db601ff8b9f84276 + 298e90d80c146b07fd71040d08e5184b0baca362258bf26033d7c9b80cdac11f + 6e62dfa92ce82487d107b76064cfe2d7ca107c87c239ea9036a763d79c09105a + 5bfcca71ba8548bb5d7fdb6ba0ec2c883bf79deca74282c4aba75978837ac000 + 6179016c556c630e2c1459b38f93db881955e191840e069dd4a98dd3dd1dc56e + bc2f1e6975aa5394683c1f82a53459cc45c3cd7a0f9c37b8afc8d77f8818fd58 + " +skip_extraction=" + Simple-Web-Server-${_simplewebserver_ver}.tar.gz + TPCircularBuffer-${_tpc_ver}.tar.gz + ViGEmClient-${_vgec_ver}.tar.gz + build-deps-${_build_deps_ver}.tar.gz + googletest-${_googletest_ver}.tar.gz + moonlight-common-c-${_moonlight_commonc_ver}.tar.gz + nanors-${_nanors_ver}.tar.gz + nv-codec-headers-${_nvcodec_headers_ver}.tar.gz + nvapi-open-source-sdk-${_nvapi_opensdk_ver}.tar.gz + tray-${_tray_ver}.tar.gz + wayland-protocols-${_wayland_protocols_ver}.tar.gz + wlr-protocols-${_wlr_protocols_ver}.tar.gz + enet-${_enet_ver}.tar.gz" + +post_extract() { + vsrcextract -C third-party/Simple-Web-Server Simple-Web-Server-${_simplewebserver_ver}.tar.gz + vsrcextract -C third-party/TPCircularBuffer TPCircularBuffer-${_tpc_ver}.tar.gz + vsrcextract -C third-party/ViGEmClient ViGEmClient-${_vgec_ver}.tar.gz + vsrcextract -C third-party/build-deps build-deps-${_build_deps_ver}.tar.gz + vsrcextract -C third-party/googletest googletest-${_googletest_ver}.tar.gz + vsrcextract -C third-party/moonlight-common-c moonlight-common-c-${_moonlight_commonc_ver}.tar.gz + vsrcextract -C third-party/moonlight-common-c/enet enet-${_enet_ver}.tar.gz + vsrcextract -C third-party/nanors nanors-${_nanors_ver}.tar.gz + vsrcextract -C third-party/nv-codec-headers nv-codec-headers-${_nvcodec_headers_ver}.tar.gz + vsrcextract -C third-party/nvapi-open-source-sdk nvapi-open-source-sdk-${_nvapi_opensdk_ver}.tar.gz + vsrcextract -C third-party/tray tray-${_tray_ver}.tar.gz + vsrcextract -C third-party/wayland-protocols wayland-protocols-${_wayland_protocols_ver}.tar.gz + vsrcextract -C third-party/wlr-protocols wlr-protocols-${_wlr_protocols_ver}.tar.gz +} +pre_configure() { + export BRANCH=master + export BUILD_VERSION=${version} + export COMMIT=v${version} +} +post_install() { + vsv sunshine +}