about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/misc/emulators/ryujinx/default.nix')
-rw-r--r--nixpkgs/pkgs/misc/emulators/ryujinx/default.nix92
1 files changed, 22 insertions, 70 deletions
diff --git a/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix b/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
index 2e89aa296a23..e584331ea669 100644
--- a/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
+++ b/nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
@@ -1,11 +1,25 @@
-{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, makeDesktopItem, linkFarmFromDrvs
-, dotnet-sdk_5, dotnetPackages, dotnetCorePackages, cacert
+{ lib, buildDotnetModule, fetchFromGitHub, makeDesktopItem
 , libX11, libgdiplus, ffmpeg
 , SDL2_mixer, openal, libsoundio, sndio, pulseaudio
 , gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook
 }:
 
-let
+buildDotnetModule rec {
+  pname = "ryujinx";
+  version = "1.0.7065"; # Versioning is based off of the official appveyor builds: https://ci.appveyor.com/project/gdkchan/ryujinx
+
+  src = fetchFromGitHub {
+    owner = "Ryujinx";
+    repo = "Ryujinx";
+    rev = "c54a14d0b8d445d9d0074861dca816cc801e4008";
+    sha256 = "13j91413x1bvg27vcx9sgc7gv00q84d8f5pllih5g5plzld4r541";
+  };
+
+  projectFile = "Ryujinx.sln";
+  executables = [ "Ryujinx" ];
+  nugetDeps = ./deps.nix;
+
+  nativeBuildInputs = [ wrapGAppsHook gobject-introspection gdk-pixbuf ];
   runtimeDeps = [
     gtk3
     libX11
@@ -17,81 +31,24 @@ let
     sndio
     pulseaudio
   ];
-in stdenv.mkDerivation rec {
-  pname = "ryujinx";
-  version = "1.0.7047"; # Versioning is based off of the official appveyor builds: https://ci.appveyor.com/project/gdkchan/ryujinx
-
-  src = fetchFromGitHub {
-    owner = "Ryujinx";
-    repo = "Ryujinx";
-    rev = "7c5ead1c196d597384085cc9a609afdc89a43774";
-    sha256 = "00c6il67y9ky0f8f97nn8aqm4klwz59842nsh554w98gwv8w1jjb";
-  };
-
-  nativeBuildInputs = [ dotnet-sdk_5 dotnetPackages.Nuget cacert makeWrapper wrapGAppsHook gobject-introspection gdk-pixbuf ];
-
-  nugetDeps = linkFarmFromDrvs "${pname}-nuget-deps" (import ./deps.nix {
-    fetchNuGet = { name, version, sha256 }: fetchurl {
-      name = "nuget-${name}-${version}.nupkg";
-      url = "https://www.nuget.org/api/v2/package/${name}/${version}";
-      inherit sha256;
-    };
-  });
 
   patches = [
     ./log.patch # Without this, Ryujinx attempts to write logs to the nix store. This patch makes it write to "~/.config/Ryujinx/Logs" on Linux.
   ];
 
-  configurePhase = ''
-    runHook preConfigure
-
-    export HOME=$(mktemp -d)
-    export DOTNET_CLI_TELEMETRY_OPTOUT=1
-    export DOTNET_NOLOGO=1
-
-    nuget sources Add -Name nixos -Source "$PWD/nixos"
-    nuget init "$nugetDeps" "$PWD/nixos"
-
-    # FIXME: https://github.com/NuGet/Home/issues/4413
-    mkdir -p $HOME/.nuget/NuGet
-    cp $HOME/.config/NuGet/NuGet.Config $HOME/.nuget/NuGet
-
-    dotnet restore --source "$PWD/nixos" Ryujinx.sln
-
-    runHook postConfigure
-  '';
-
-  buildPhase = ''
-    runHook preBuild
-    dotnet build Ryujinx.sln \
-      --no-restore \
-      --configuration Release \
-      -p:Version=${version}
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    dotnet publish Ryujinx.sln \
-      --no-build \
-      --configuration Release \
-      --no-self-contained \
-      --output $out/lib/ryujinx
-    shopt -s extglob
-
+  preInstall = ''
     # TODO: fix this hack https://github.com/Ryujinx/Ryujinx/issues/2349
     mkdir -p $out/lib/sndio-6
     ln -s ${sndio}/lib/libsndio.so $out/lib/sndio-6/libsndio.so.6
 
-    makeWrapper $out/lib/ryujinx/Ryujinx $out/bin/Ryujinx \
-      --set DOTNET_ROOT "${dotnetCorePackages.net_5_0}" \
-      --suffix LD_LIBRARY_PATH : "${builtins.concatStringsSep ":" [ (lib.makeLibraryPath runtimeDeps) "$out/lib/sndio-6" ]}" \
-      ''${gappsWrapperArgs[@]}
+    makeWrapperArgs+=(
+      --suffix LD_LIBRARY_PATH : "$out/lib/sndio-6"
+    )
 
     for i in 16 32 48 64 96 128 256 512 1024; do
       install -D ${src}/Ryujinx/Ui/Resources/Logo_Ryujinx.png $out/share/icons/hicolor/''${i}x$i/apps/ryujinx.png
     done
+
     cp -r ${makeDesktopItem {
       desktopName = "Ryujinx";
       name = "ryujinx";
@@ -101,13 +58,8 @@ in stdenv.mkDerivation rec {
       type = "Application";
       categories = "Game;";
     }}/share/applications $out/share
-
-    runHook postInstall
   '';
 
-  # Strip breaks the executable.
-  dontStrip = true;
-
   meta = with lib; {
     description = "Experimental Nintendo Switch Emulator written in C#";
     homepage = "https://ryujinx.org/";