Merge pull request #296747 from devusb/sunshine

sunshine: 0.22.0 -> 0.22.2
This commit is contained in:
Sandro 2024-03-23 18:20:47 +01:00 committed by GitHub
commit ee82708c94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 25 deletions

View file

@ -1,7 +1,6 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, autoPatchelfHook , autoPatchelfHook
, makeWrapper , makeWrapper
, buildNpmPackage , buildNpmPackage
@ -50,32 +49,26 @@ let
in in
stdenv'.mkDerivation rec { stdenv'.mkDerivation rec {
pname = "sunshine"; pname = "sunshine";
version = "0.22.0"; version = "0.22.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "LizardByte"; owner = "LizardByte";
repo = "Sunshine"; repo = "Sunshine";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-O9U4zP1o6yWtzk+2DW7ueimvsTuajLY8IETlvCT4jTE="; sha256 = "sha256-So8fX0XQoW2cdTWWENoE07EU6e8vvjeTpizLoaDTjeg=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
patches = [ patches = [
# remove npm install as it needs internet access -- handled separately below # remove npm install as it needs internet access -- handled separately below
./dont-build-webui.patch ./dont-build-webui.patch
# revert https://github.com/LizardByte/Sunshine/pull/2046 - let cmake install handle udev and systemd files
(fetchpatch {
url = "https://github.com/LizardByte/Sunshine/commit/0d4dfcd708c0027b7d8827a03163858800fa79fa.patch";
hash = "sha256-77NtfX0zB7ty92AyFOz9wJoa1jHshlNbPQ7NOpqUuYo=";
revert = true;
})
]; ];
# build webui # build webui
ui = buildNpmPackage { ui = buildNpmPackage {
inherit src version; inherit src version;
pname = "sunshine-ui"; pname = "sunshine-ui";
npmDepsHash = "sha256-jAZUu2CfcqhC2xMiZYpY7KPCRVFQgT/kgUvSI+5Cpkc="; npmDepsHash = "sha256-0487ntbJZ20MZHezQ+Z3EJkidF3Dgoh/mynYwR7k/+I=";
# use generated package-lock.json as upstream does not provide one # use generated package-lock.json as upstream does not provide one
postPatch = '' postPatch = ''
@ -152,17 +145,21 @@ stdenv'.mkDerivation rec {
cmakeFlags = [ cmakeFlags = [
"-Wno-dev" "-Wno-dev"
# upstream tries to use systemd and udev packages to find these directories in FHS; set the paths explicitly instead
(lib.cmakeFeature "UDEV_RULES_INSTALL_DIR" "lib/udev/rules.d")
(lib.cmakeFeature "SYSTEMD_USER_UNIT_INSTALL_DIR" "lib/systemd/user")
]; ];
postPatch = '' postPatch = ''
# fix hardcoded libevdev path # remove upstream dependency on systemd and udev
substituteInPlace cmake/compile_definitions/linux.cmake \ substituteInPlace cmake/packaging/linux.cmake \
--replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0' --replace-fail 'find_package(Systemd)' "" \
--replace-fail 'find_package(Udev)' ""
substituteInPlace packaging/linux/sunshine.desktop \ substituteInPlace packaging/linux/sunshine.desktop \
--replace '@PROJECT_NAME@' 'Sunshine' \ --subst-var-by PROJECT_NAME 'Sunshine' \
--replace '@PROJECT_DESCRIPTION@' 'Self-hosted game stream host for Moonlight' \ --subst-var-by PROJECT_DESCRIPTION 'Self-hosted game stream host for Moonlight' \
--replace '/usr/bin/env systemctl start --u sunshine' 'sunshine' --replace-fail '/usr/bin/env systemctl start --u sunshine' 'sunshine'
''; '';
preBuild = '' preBuild = ''

View file

@ -1,14 +1,14 @@
diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake
index 3dd629e..acec58d 100644 index 9f2ce08..8c32b8f 100644
--- a/cmake/targets/common.cmake --- a/cmake/targets/common.cmake
+++ b/cmake/targets/common.cmake +++ b/cmake/targets/common.cmake
@@ -37,8 +37,4 @@ endif() @@ -48,8 +48,4 @@ else()
set(NPM_BUILD_HOMEBREW "")
target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>) # cmake-lint: disable=C0301 endif()
-#WebUI build -#WebUI build
-add_custom_target(web-ui ALL -add_custom_target(web-ui ALL
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
- COMMENT "Installing NPM Dependencies and Building the Web UI" - COMMENT "Installing NPM Dependencies and Building the Web UI"
- COMMAND bash -c \"npm install && SUNSHINE_SOURCE_ASSETS_DIR=${SUNSHINE_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${CMAKE_BINARY_DIR} npm run build\") # cmake-lint: disable=C0301 - COMMAND bash -c \"npm install && SUNSHINE_BUILD_HOMEBREW=${NPM_BUILD_HOMEBREW} SUNSHINE_SOURCE_ASSETS_DIR=${NPM_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${NPM_ASSETS_DIR} npm run build\") # cmake-lint: disable=C0301
+ +

View file

@ -1,5 +1,5 @@
{ {
"name": "Sunshine", "name": "sunshine",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
@ -790,9 +790,9 @@
} }
}, },
"node_modules/source-map-js": { "node_modules/source-map-js": {
"version": "1.0.2", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.3.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "integrity": "sha512-H/5Vyeo/I1hqIdOS0m1Q63OPr0yFdZLaiVkr8ap/WyIVGdU3PyoOV/HXY8+PJE2M43+n11FY5zWQnNRNnD1UFg==",
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }