2022-03-05 16:20:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, 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-30 09:31:56 +00:00
|
|
|
version = "1.1.77"; # 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-30 09:31:56 +00:00
|
|
|
rev = "df70442c46e7ee133b1fb79dc23ddd134e618085";
|
|
|
|
sha256 = "1m9msp7kxsj7251l2yjcfzrb4k1lisk9sip7acm22pxmi1a7gw73";
|
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 = [
|
|
|
|
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
|
|
|
|
SDL2_mixer
|
|
|
|
openal
|
|
|
|
libsoundio
|
|
|
|
sndio
|
|
|
|
pulseaudio
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
patches = [
|
2022-03-10 19:12:11 +00:00
|
|
|
./appdir.patch # Ryujinx attempts to write to the nix store. This patch redirects it to "~/.config/Ryujinx" on Linux.
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
preInstall = ''
|
2022-03-10 19:12:11 +00:00
|
|
|
# Ryujinx tries to use ffmpeg from PATH
|
2021-10-14 00:43:12 +00:00
|
|
|
makeWrapperArgs+=(
|
2022-03-10 19:12:11 +00:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ ffmpeg ]}
|
2021-10-14 00:43:12 +00:00
|
|
|
)
|
2022-03-10 19:12:11 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/scalable/apps,mime/packages}
|
|
|
|
pushd ${src}/distribution/linux
|
|
|
|
|
|
|
|
install -D ./ryujinx.desktop $out/share/applications/ryujinx.desktop
|
|
|
|
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
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
substituteInPlace $out/share/applications/ryujinx.desktop --replace \
|
|
|
|
"Exec=Ryujinx" "Exec=$out/bin/Ryujinx"
|
|
|
|
|
|
|
|
popd
|
2020-08-20 17:08:02 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
passthru.updateScript = ./updater.sh;
|
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
|
|
|
};
|
|
|
|
}
|