2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeDesktopItem
|
|
|
|
, copyDesktopItems
|
|
|
|
, dotnetCorePackages
|
|
|
|
, libX11
|
|
|
|
, libgdiplus
|
|
|
|
, ffmpeg
|
|
|
|
, SDL2_mixer
|
|
|
|
, openal
|
|
|
|
, libsoundio
|
|
|
|
, sndio
|
|
|
|
, pulseaudio
|
|
|
|
, gtk3
|
|
|
|
, gdk-pixbuf
|
|
|
|
, wrapGAppsHook
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
buildDotnetModule rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "ryujinx";
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "1.1.54"; # Versioning is based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ryujinx";
|
|
|
|
repo = "Ryujinx";
|
2022-03-05 16:20:37 +00:00
|
|
|
rev = "3705c206688c69d3348f5cec84dc480d8d7c578e";
|
|
|
|
sha256 = "1lhnr11x46yjpka865m0dzkbkdxmrrhjcpvq4ab4wll6j0ipy908";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_6_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_6_0;
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
projectFile = "Ryujinx.sln";
|
|
|
|
nugetDeps = ./deps.nix;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
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
|
2022-01-19 23:45:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
2021-10-28 06:52:43 +00:00
|
|
|
gdk-pixbuf
|
|
|
|
];
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
runtimeDeps = [
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libgdiplus
|
|
|
|
ffmpeg
|
|
|
|
SDL2_mixer
|
|
|
|
openal
|
|
|
|
libsoundio
|
|
|
|
sndio
|
|
|
|
pulseaudio
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
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.
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
preInstall = ''
|
2021-07-14 22:03:04 +00:00
|
|
|
# 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
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
makeWrapperArgs+=(
|
|
|
|
--suffix LD_LIBRARY_PATH : "$out/lib/sndio-6"
|
|
|
|
)
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
for i in 16 32 48 64 96 128 256 512 1024; do
|
2021-02-05 17:12:51 +00:00
|
|
|
install -D ${src}/Ryujinx/Ui/Resources/Logo_Ryujinx.png $out/share/icons/hicolor/''${i}x$i/apps/ryujinx.png
|
2020-08-20 17:08:02 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
desktopName = "Ryujinx";
|
|
|
|
name = "ryujinx";
|
|
|
|
exec = "Ryujinx";
|
|
|
|
icon = "ryujinx";
|
|
|
|
comment = meta.description;
|
|
|
|
type = "Application";
|
|
|
|
categories = [ "Game" ];
|
|
|
|
})
|
|
|
|
];
|
2021-10-28 06:52:43 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-08-20 17:08:02 +00:00
|
|
|
homepage = "https://ryujinx.org/";
|
2021-10-28 06:52:43 +00:00
|
|
|
changelog = "https://github.com/Ryujinx/Ryujinx/wiki/Changelog";
|
2022-03-05 16:20:37 +00:00
|
|
|
description = "Experimental Nintendo Switch Emulator written in C#";
|
|
|
|
longDescription = ''
|
|
|
|
Ryujinx is an open-source Nintendo Switch emulator, created by gdkchan,
|
|
|
|
written in C#. This emulator aims at providing excellent accuracy and
|
|
|
|
performance, a user-friendly interface and consistent builds. It was
|
|
|
|
written from scratch and development on the project began in September
|
|
|
|
2017.
|
|
|
|
'';
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ivar jk ];
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-01-19 23:45:15 +00:00
|
|
|
mainProgram = "Ryujinx";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2021-04-05 15:23:46 +00:00
|
|
|
passthru.updateScript = ./updater.sh;
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|