summary refs log tree commit diff
path: root/pkgs/servers/sunshine/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/sunshine/default.nix')
-rw-r--r--pkgs/servers/sunshine/default.nix63
1 files changed, 33 insertions, 30 deletions
diff --git a/pkgs/servers/sunshine/default.nix b/pkgs/servers/sunshine/default.nix
index bf3f4fa3005..b5b855a4b69 100644
--- a/pkgs/servers/sunshine/default.nix
+++ b/pkgs/servers/sunshine/default.nix
@@ -1,8 +1,6 @@
 { lib
 , stdenv
-, callPackage
 , fetchFromGitHub
-, fetchurl
 , autoPatchelfHook
 , makeWrapper
 , buildNpmPackage
@@ -14,7 +12,6 @@
 , libxcb
 , openssl
 , libopus
-, ffmpeg_5-full
 , boost
 , pkg-config
 , libdrm
@@ -23,47 +20,45 @@
 , libcap
 , mesa
 , curl
+, pcre
+, pcre2
+, libuuid
+, libselinux
+, libsepol
+, libthai
+, libdatrie
+, libxkbcommon
+, libepoxy
 , libva
 , libvdpau
 , numactl
 , amf-headers
+, intel-media-sdk
 , svt-av1
 , vulkan-loader
 , libappindicator
+, libnotify
 , config
 , cudaSupport ? config.cudaSupport
 , cudaPackages ? {}
 }:
-let
-  libcbs = callPackage ./libcbs.nix { };
-  # get cmake file used to find external ffmpeg from previous sunshine version
-  findFfmpeg = fetchurl {
-    url = "https://raw.githubusercontent.com/LizardByte/Sunshine/6702802829869547708dfec98db5b8cbef39be89/cmake/FindFFMPEG.cmake";
-    sha256 = "sha256:1hl3sffv1z8ghdql5y9flk41v74asvh23y6jmaypll84f1s6k1xa";
-  };
-in
 stdenv.mkDerivation rec {
   pname = "sunshine";
-  version = "0.20.0";
+  version = "0.21.0";
 
   src = fetchFromGitHub {
     owner = "LizardByte";
     repo = "Sunshine";
     rev = "v${version}";
-    sha256 = "sha256-/ceN44PAEtXzrAUi4AEldW1FBhJqIXah1Zd0S6fiV3s=";
+    sha256 = "sha256-uvQAJkoKazFLz5iTpYSAGYJQZ2EprQ+p9+tryqorFHM=";
     fetchSubmodules = true;
   };
 
-  # remove pre-built ffmpeg; use ffmpeg from nixpkgs
-  patches = [
-    ./ffmpeg.diff
-  ];
-
   # fetch node_modules needed for webui
   ui = buildNpmPackage {
     inherit src version;
     pname = "sunshine-ui";
-    npmDepsHash = "sha256-pwmkpZjDwluKJjcY0ehetQbAlFnj1tsW100gRjolboc=";
+    npmDepsHash = "sha256-+T1XAf4SThoJLOFpnVxDa2qiKFLIKQPGewjA83GQovM=";
 
     dontNpmBuild = true;
 
@@ -88,9 +83,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    libcbs
     avahi
-    ffmpeg_5-full
     libevdev
     libpulseaudio
     xorg.libX11
@@ -109,6 +102,16 @@ stdenv.mkDerivation rec {
     libcap
     libdrm
     curl
+    pcre
+    pcre2
+    libuuid
+    libselinux
+    libsepol
+    libthai
+    libdatrie
+    xorg.libXdmcp
+    libxkbcommon
+    libepoxy
     libva
     libvdpau
     numactl
@@ -116,8 +119,11 @@ stdenv.mkDerivation rec {
     amf-headers
     svt-av1
     libappindicator
+    libnotify
   ] ++ lib.optionals cudaSupport [
     cudaPackages.cudatoolkit
+  ] ++ lib.optionals stdenv.isx86_64 [
+    intel-media-sdk
   ];
 
   runtimeDependencies = [
@@ -132,16 +138,13 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
-    # fix hardcoded libevdev and icon path
-    substituteInPlace CMakeLists.txt \
-      --replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0' \
-      --replace '/usr/share' "$out/share"
+    # fix hardcoded libevdev path
+    substituteInPlace cmake/compile_definitions/linux.cmake \
+      --replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0'
 
     substituteInPlace packaging/linux/sunshine.desktop \
-      --replace '@PROJECT_NAME@' 'Sunshine'
-
-    # add FindFFMPEG to source tree
-    cp ${findFfmpeg} cmake/FindFFMPEG.cmake
+      --replace '@PROJECT_NAME@' 'Sunshine' \
+      --replace '@PROJECT_DESCRIPTION@' 'Self-hosted game stream host for Moonlight'
   '';
 
   preBuild = ''
@@ -163,7 +166,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = ./updater.sh;
 
   meta = with lib; {
-    description = "Sunshine is a Game stream host for Moonlight.";
+    description = "Sunshine is a Game stream host for Moonlight";
     homepage = "https://github.com/LizardByte/Sunshine";
     license = licenses.gpl3Only;
     maintainers = with maintainers; [ devusb ];