nixpkgs/pkgs/misc/emulators/ryujinx/default.nix
2021-11-02 04:24:26 +00:00

84 lines
2.3 KiB
Nix

{ lib, buildDotnetModule, fetchFromGitHub, makeDesktopItem, copyDesktopItems
, libX11, libgdiplus, ffmpeg
, SDL2_mixer, openal, libsoundio, sndio, pulseaudio
, gtk3, gobject-introspection, gdk-pixbuf, wrapGAppsHook
}:
buildDotnetModule rec {
pname = "ryujinx";
version = "1.0.7096"; # Versioning is based off of the official appveyor builds: https://ci.appveyor.com/project/gdkchan/ryujinx
src = fetchFromGitHub {
owner = "Ryujinx";
repo = "Ryujinx";
rev = "f41687f4c1948e9e111afd70e979e98ea5de52fa";
sha256 = "0l0ll0bbqnqr63xlv4j9ir8pqb2ni7xmw52r8mdzw8vxq6xgs70b";
};
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" ];
nativeBuildInputs = [
copyDesktopItems
wrapGAppsHook
gobject-introspection
gdk-pixbuf
];
runtimeDeps = [
gtk3
libX11
libgdiplus
ffmpeg
SDL2_mixer
openal
libsoundio
sndio
pulseaudio
];
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.
];
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
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
'';
desktopItems = [(makeDesktopItem {
desktopName = "Ryujinx";
name = "ryujinx";
exec = "Ryujinx";
icon = "ryujinx";
comment = meta.description;
type = "Application";
categories = "Game;";
})];
meta = with lib; {
description = "Experimental Nintendo Switch Emulator written in C#";
homepage = "https://ryujinx.org/";
license = licenses.mit;
changelog = "https://github.com/Ryujinx/Ryujinx/wiki/Changelog";
maintainers = [ maintainers.ivar ];
platforms = [ "x86_64-linux" ];
};
passthru.updateScript = ./updater.sh;
}