Unverified Commit e3e70384 authored by Ivar Scholten's avatar Ivar Scholten
Browse files

ryujinx: 1.1.223 -> 1.1.248

Its now running unit tests, and the headless frontend is packaged as
well. The latter is a bit inconsistent, on the OpenGL backend it will
always fail to create an SDL+OpenGL instance, causing a crash.

The Vulkan backend mostly works fine, although it might need a few
restarts before it decides to show graphics. Better than nothing though.
parent c320c43b
Loading
Loading
Loading
Loading
+29 −15
Original line number Diff line number Diff line
{ lib
, buildDotnetModule
, fetchFromGitHub
, dotnetCorePackages
, wrapGAppsHook
, libX11
, libgdiplus
, ffmpeg
, SDL2_mixer
, openal
, libsoundio
, sndio
, pulseaudio
, gtk3
, gdk-pixbuf
, wrapGAppsHook
, vulkan-loader
, libICE
, libSM
@@ -22,28 +20,24 @@
, libXrandr
, fontconfig
, glew
, libGL
, SDL2
, SDL2_mixer
}:

buildDotnetModule rec {
  pname = "ryujinx";
  version = "1.1.223"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
  version = "1.1.248"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml

  src = fetchFromGitHub {
    owner = "Ryujinx";
    repo = "Ryujinx";
    rev = "951700fdd8f54fb34ffe8a3fb328a68b5bf37abe";
    sha256 = "0kzchsxir8wh74rxvp582mci855hbd0vma6yhcc9vpz0zmhi2cpf";
    rev = "5ff5fe47bad947a95545390865c597bec6c62070";
    sha256 = "0nfzf7q58mhdyszwv3mbz3wqf4w0m1p3fmf3cpga1pf9mfq65nqz";
  };

  projectFile = "Ryujinx.sln";
  nugetDeps = ./deps.nix;

  dotnetFlags = [ "/p:ExtraDefineConstants=DISABLE_UPDATER" ];

  # TODO: Add the headless frontend. Currently errors on the following:
  # System.Exception: SDL2 initlaization failed with error "No available video device"
  executables = [ "Ryujinx" "Ryujinx.Ava" ];

  nativeBuildInputs = [
    wrapGAppsHook
  ];
@@ -74,12 +68,30 @@ buildDotnetModule rec {
    libXrandr
    fontconfig
    glew

    # Headless executable
    libGL
    SDL2
  ];

  patches = [
    ./appdir.patch # Ryujinx attempts to write to the nix store. This patch redirects it to "~/.config/Ryujinx" on Linux.
  ];

  projectFile = "Ryujinx.sln";
  testProjectFile = "Ryujinx.Tests/Ryujinx.Tests.csproj";
  doCheck = true;

  dotnetFlags = [
    "/p:ExtraDefineConstants=DISABLE_UPDATER"
  ];

  executables = [
    "Ryujinx.Headless.SDL2"
    "Ryujinx.Ava"
    "Ryujinx"
  ];

  makeWrapperArgs = [
    # Without this Ryujinx fails to start on wayland. See https://github.com/Ryujinx/Ryujinx/issues/2714
    "--set GDK_BACKEND x11"
@@ -100,8 +112,10 @@ buildDotnetModule rec {
    install -D ./ryujinx-mime.xml $out/share/mime/packages/ryujinx-mime.xml
    install -D ./ryujinx-logo.svg $out/share/icons/hicolor/scalable/apps/ryujinx.svg

    substituteInPlace $out/share/applications/ryujinx.desktop --replace \
      "Exec=Ryujinx" "Exec=$out/bin/Ryujinx"
    substituteInPlace $out/share/applications/ryujinx.desktop \
      --replace "Exec=Ryujinx" "Exec=$out/bin/Ryujinx"

    ln -s $out/bin/Ryujinx $out/bin/ryujinx

    popd
  '';