Unverified Commit ac2afcdf authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

Merge pull request #293938 from devusb/sunshine

sunshine: 0.21.0 -> 0.22.0
parents a807c610 de74b3be
Loading
Loading
Loading
Loading
+28 −13
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, autoPatchelfHook
, makeWrapper
, buildNpmPackage
@@ -39,29 +40,42 @@
, vulkan-loader
, libappindicator
, libnotify
, miniupnpc
, config
, cudaSupport ? config.cudaSupport
, cudaPackages ? { }
}:
stdenv.mkDerivation rec {
let
  stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv;
in
stdenv'.mkDerivation rec {
  pname = "sunshine";
  version = "0.21.0";
  version = "0.22.0";

  src = fetchFromGitHub {
    owner = "LizardByte";
    repo = "Sunshine";
    rev = "v${version}";
    sha256 = "sha256-uvQAJkoKazFLz5iTpYSAGYJQZ2EprQ+p9+tryqorFHM=";
    sha256 = "sha256-O9U4zP1o6yWtzk+2DW7ueimvsTuajLY8IETlvCT4jTE=";
    fetchSubmodules = true;
  };

  # fetch node_modules needed for webui
  patches = [
    # remove npm install as it needs internet access -- handled separately below
    ./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
  ui = buildNpmPackage {
    inherit src version;
    pname = "sunshine-ui";
    npmDepsHash = "sha256-+T1XAf4SThoJLOFpnVxDa2qiKFLIKQPGewjA83GQovM=";

    dontNpmBuild = true;
    npmDepsHash = "sha256-jAZUu2CfcqhC2xMiZYpY7KPCRVFQgT/kgUvSI+5Cpkc=";

    # use generated package-lock.json as upstream does not provide one
    postPatch = ''
@@ -70,7 +84,7 @@ stdenv.mkDerivation rec {

    installPhase = ''
      mkdir -p $out
      cp -r node_modules $out/
      cp -r * $out/
    '';
  };

@@ -121,6 +135,7 @@ stdenv.mkDerivation rec {
    svt-av1
    libappindicator
    libnotify
    miniupnpc
  ] ++ lib.optionals cudaSupport [
    cudaPackages.cudatoolkit
  ] ++ lib.optionals stdenv.isx86_64 [
@@ -146,13 +161,13 @@ stdenv.mkDerivation rec {

    substituteInPlace packaging/linux/sunshine.desktop \
      --replace '@PROJECT_NAME@' 'Sunshine' \
      --replace '@PROJECT_DESCRIPTION@' 'Self-hosted game stream host for Moonlight'
      --replace '@PROJECT_DESCRIPTION@' 'Self-hosted game stream host for Moonlight' \
      --replace '/usr/bin/env systemctl start --u sunshine' 'sunshine'
  '';

  preBuild = ''
    # copy node_modules where they can be picked up by build
    mkdir -p ../node_modules
    cp -r ${ui}/node_modules/* ../node_modules
    # copy webui where it can be picked up by build
    cp -r ${ui}/build ../
  '';

  # allow Sunshine to find libvulkan
+14 −0
Original line number Diff line number Diff line
diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake
index 3dd629e..acec58d 100644
--- a/cmake/targets/common.cmake
+++ b/cmake/targets/common.cmake
@@ -37,8 +37,4 @@ endif()
 
 target_compile_options(sunshine PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${SUNSHINE_COMPILE_OPTIONS}>;$<$<COMPILE_LANGUAGE:CUDA>:${SUNSHINE_COMPILE_OPTIONS_CUDA};-std=c++17>)  # cmake-lint: disable=C0301
 
-#WebUI build
-add_custom_target(web-ui ALL
-        WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
-        COMMENT "Installing NPM Dependencies and Building the Web UI"
-        COMMAND bash -c \"npm install && SUNSHINE_SOURCE_ASSETS_DIR=${SUNSHINE_SOURCE_ASSETS_DIR} SUNSHINE_ASSETS_DIR=${CMAKE_BINARY_DIR} npm run build\") # cmake-lint: disable=C0301
+
+852 −14

File changed.

Preview size limit exceeded, changes collapsed.