diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
commit | 5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch) | |
tree | f316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/servers/sunshine/default.nix | |
parent | 46a88117a05c3469af5d99433af140c3de8ca088 (diff) | |
parent | 8aa81f34981add12aecada6c702ddbbd0375ca36 (diff) | |
download | nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2 nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/servers/sunshine/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/sunshine/default.nix | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/nixpkgs/pkgs/servers/sunshine/default.nix b/nixpkgs/pkgs/servers/sunshine/default.nix index 331770a565d5..a4fd4abc109c 100644 --- a/nixpkgs/pkgs/servers/sunshine/default.nix +++ b/nixpkgs/pkgs/servers/sunshine/default.nix @@ -39,29 +39,36 @@ , vulkan-loader , libappindicator , libnotify +, miniupnpc , config , cudaSupport ? config.cudaSupport -, cudaPackages ? {} +, 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.2"; src = fetchFromGitHub { owner = "LizardByte"; repo = "Sunshine"; rev = "v${version}"; - sha256 = "sha256-uvQAJkoKazFLz5iTpYSAGYJQZ2EprQ+p9+tryqorFHM="; + sha256 = "sha256-So8fX0XQoW2cdTWWENoE07EU6e8vvjeTpizLoaDTjeg="; fetchSubmodules = true; }; - # fetch node_modules needed for webui + patches = [ + # remove npm install as it needs internet access -- handled separately below + ./dont-build-webui.patch + ]; + + # build webui ui = buildNpmPackage { inherit src version; pname = "sunshine-ui"; - npmDepsHash = "sha256-+T1XAf4SThoJLOFpnVxDa2qiKFLIKQPGewjA83GQovM="; - - dontNpmBuild = true; + npmDepsHash = "sha256-0487ntbJZ20MZHezQ+Z3EJkidF3Dgoh/mynYwR7k/+I="; # use generated package-lock.json as upstream does not provide one postPatch = '' @@ -70,7 +77,7 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out - cp -r node_modules $out/ + cp -r * $out/ ''; }; @@ -80,7 +87,7 @@ stdenv.mkDerivation rec { autoPatchelfHook makeWrapper ] ++ lib.optionals cudaSupport [ - cudaPackages.autoAddOpenGLRunpathHook + cudaPackages.autoAddDriverRunpath ]; buildInputs = [ @@ -121,6 +128,7 @@ stdenv.mkDerivation rec { svt-av1 libappindicator libnotify + miniupnpc ] ++ lib.optionals cudaSupport [ cudaPackages.cudatoolkit ] ++ lib.optionals stdenv.isx86_64 [ @@ -137,22 +145,26 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-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 = '' - # fix hardcoded libevdev path - substituteInPlace cmake/compile_definitions/linux.cmake \ - --replace '/usr/include/libevdev-1.0' '${libevdev}/include/libevdev-1.0' + # remove upstream dependency on systemd and udev + substituteInPlace cmake/packaging/linux.cmake \ + --replace-fail 'find_package(Systemd)' "" \ + --replace-fail 'find_package(Udev)' "" substituteInPlace packaging/linux/sunshine.desktop \ - --replace '@PROJECT_NAME@' 'Sunshine' \ - --replace '@PROJECT_DESCRIPTION@' 'Self-hosted game stream host for Moonlight' + --subst-var-by PROJECT_NAME 'Sunshine' \ + --subst-var-by PROJECT_DESCRIPTION 'Self-hosted game stream host for Moonlight' \ + --replace-fail '/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 |