2022-02-28 19:05:58 +00:00
|
|
|
{ lib
|
|
|
|
, buildDotnetModule
|
2022-09-26 17:45:48 +00:00
|
|
|
, dotnetCorePackages
|
|
|
|
, stdenvNoCC
|
2022-02-28 19:05:58 +00:00
|
|
|
, fetchFromGitHub
|
2022-08-23 02:09:33 +00:00
|
|
|
, wrapGAppsHook
|
2022-02-28 19:05:58 +00:00
|
|
|
, libX11
|
|
|
|
, libgdiplus
|
|
|
|
, ffmpeg
|
|
|
|
, openal
|
|
|
|
, libsoundio
|
|
|
|
, sndio
|
|
|
|
, pulseaudio
|
|
|
|
, gtk3
|
|
|
|
, gdk-pixbuf
|
2022-08-07 23:57:42 +00:00
|
|
|
, vulkan-loader
|
2022-08-12 19:20:25 +00:00
|
|
|
, libICE
|
|
|
|
, libSM
|
|
|
|
, libXi
|
|
|
|
, libXcursor
|
|
|
|
, libXext
|
|
|
|
, libXrandr
|
|
|
|
, fontconfig
|
|
|
|
, glew
|
2022-08-23 02:09:33 +00:00
|
|
|
, libGL
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
2020-07-31 11:34:41 +00:00
|
|
|
}:
|
|
|
|
|
2021-08-19 15:10:41 +00:00
|
|
|
buildDotnetModule rec {
|
2020-07-31 11:34:41 +00:00
|
|
|
pname = "ryujinx";
|
2022-10-26 03:12:14 +00:00
|
|
|
version = "1.1.327"; # Based off of the official github actions builds: https://github.com/Ryujinx/Ryujinx/actions/workflows/release.yml
|
2020-07-31 11:34:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Ryujinx";
|
|
|
|
repo = "Ryujinx";
|
2022-10-26 03:12:14 +00:00
|
|
|
rev = "9719b6a1129c017d96532ff026e2bb933c0b2d0b";
|
|
|
|
sha256 = "1vm1zwjm02jp64gjcfn923lxc4hqwgw44w9rspjy97q2z6r9vwjh";
|
2020-07-31 11:34:41 +00:00
|
|
|
};
|
|
|
|
|
2021-08-19 15:10:41 +00:00
|
|
|
nugetDeps = ./deps.nix;
|
2020-07-31 11:34:41 +00:00
|
|
|
|
2021-10-24 22:15:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
2022-01-11 23:07:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
2021-10-24 22:15:04 +00:00
|
|
|
gdk-pixbuf
|
|
|
|
];
|
|
|
|
|
2021-08-19 15:10:41 +00:00
|
|
|
runtimeDeps = [
|
|
|
|
gtk3
|
|
|
|
libX11
|
|
|
|
libgdiplus
|
|
|
|
SDL2_mixer
|
|
|
|
openal
|
|
|
|
libsoundio
|
|
|
|
sndio
|
|
|
|
pulseaudio
|
2022-08-07 23:57:42 +00:00
|
|
|
vulkan-loader
|
2022-08-12 18:09:12 +00:00
|
|
|
ffmpeg
|
2022-08-12 19:20:25 +00:00
|
|
|
|
|
|
|
# Avalonia UI
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXext
|
|
|
|
libXrandr
|
|
|
|
fontconfig
|
|
|
|
glew
|
2022-08-23 02:09:33 +00:00
|
|
|
|
|
|
|
# Headless executable
|
|
|
|
libGL
|
|
|
|
SDL2
|
2022-05-02 17:55:14 +00:00
|
|
|
];
|
|
|
|
|
2021-01-28 20:40:11 +00:00
|
|
|
patches = [
|
2022-03-07 22:17:46 +00:00
|
|
|
./appdir.patch # Ryujinx attempts to write to the nix store. This patch redirects it to "~/.config/Ryujinx" on Linux.
|
2021-01-28 20:40:11 +00:00
|
|
|
];
|
2020-07-31 11:34:41 +00:00
|
|
|
|
2022-08-23 02:09:33 +00:00
|
|
|
projectFile = "Ryujinx.sln";
|
|
|
|
testProjectFile = "Ryujinx.Tests/Ryujinx.Tests.csproj";
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
dotnetFlags = [
|
|
|
|
"/p:ExtraDefineConstants=DISABLE_UPDATER"
|
|
|
|
];
|
|
|
|
|
2022-09-26 17:45:48 +00:00
|
|
|
dotnetRestoreFlags = [ "--runtime ${dotnetCorePackages.sdk_6_0.systemToDotnetRid stdenvNoCC.targetPlatform.system}" ];
|
|
|
|
|
2022-08-23 02:09:33 +00:00
|
|
|
executables = [
|
|
|
|
"Ryujinx.Headless.SDL2"
|
|
|
|
"Ryujinx.Ava"
|
|
|
|
"Ryujinx"
|
|
|
|
];
|
|
|
|
|
2022-08-17 16:48:54 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
# Without this Ryujinx fails to start on wayland. See https://github.com/Ryujinx/Ryujinx/issues/2714
|
|
|
|
"--set GDK_BACKEND x11"
|
2022-08-18 19:49:45 +00:00
|
|
|
"--set SDL_VIDEODRIVER x11"
|
2022-08-17 16:48:54 +00:00
|
|
|
];
|
|
|
|
|
2021-08-19 15:10:41 +00:00
|
|
|
preInstall = ''
|
2022-04-06 18:21:50 +00:00
|
|
|
# workaround for 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
|
2022-03-07 22:17:46 +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-07-31 11:34:41 +00:00
|
|
|
|
2022-08-23 02:09:33 +00:00
|
|
|
substituteInPlace $out/share/applications/ryujinx.desktop \
|
|
|
|
--replace "Exec=Ryujinx" "Exec=$out/bin/Ryujinx"
|
|
|
|
|
|
|
|
ln -s $out/bin/Ryujinx $out/bin/ryujinx
|
2022-03-07 22:17:46 +00:00
|
|
|
|
|
|
|
popd
|
2020-07-31 11:34:41 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-07 22:17:46 +00:00
|
|
|
passthru.updateScript = ./updater.sh;
|
2021-10-24 22:15:04 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-07-31 11:34:41 +00:00
|
|
|
homepage = "https://ryujinx.org/";
|
2021-10-24 22:15:04 +00:00
|
|
|
changelog = "https://github.com/Ryujinx/Ryujinx/wiki/Changelog";
|
2022-02-28 19:05:58 +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-07-31 11:34:41 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-01-11 23:07:08 +00:00
|
|
|
mainProgram = "Ryujinx";
|
2020-07-31 11:34:41 +00:00
|
|
|
};
|
|
|
|
}
|