summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/emulators/yuzu
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-02-15 23:28:16 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-02-16 01:38:20 -0300
commit8d65e832f0a18f60e2040940c80d96373ac8b88c (patch)
tree3d6ade66b2a81403e3852b80b9e7c660699b6ed6 /pkgs/applications/emulators/yuzu
parent19574af0af3ffaf7c9e359744ed32556f34536bd (diff)
Move misc/emulators to applications/emulators - part 1
Emulators form a class by themselves. So, they should be moved to applications/.
Diffstat (limited to 'pkgs/applications/emulators/yuzu')
-rw-r--r--pkgs/applications/emulators/yuzu/base.nix86
-rw-r--r--pkgs/applications/emulators/yuzu/default.nix28
2 files changed, 114 insertions, 0 deletions
diff --git a/pkgs/applications/emulators/yuzu/base.nix b/pkgs/applications/emulators/yuzu/base.nix
new file mode 100644
index 000000000000..aff09134fae9
--- /dev/null
+++ b/pkgs/applications/emulators/yuzu/base.nix
@@ -0,0 +1,86 @@
+{ pname, version, src, branchName
+, stdenv, lib, wrapQtAppsHook
+, cmake, pkg-config
+, libpulseaudio, libjack2, alsa-lib, sndio
+, vulkan-loader, vulkan-headers
+, qtbase, qtwebengine, qttools
+, nlohmann_json, rapidjson
+, zlib, zstd, libzip, lz4
+, glslang
+, boost173
+, catch2
+, fmt_8
+, SDL2
+, udev
+, libusb1
+, ffmpeg
+}:
+
+stdenv.mkDerivation rec {
+ inherit pname version src;
+
+ nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
+ buildInputs = [
+ libpulseaudio libjack2 alsa-lib sndio
+ vulkan-loader vulkan-headers
+ qtbase qtwebengine qttools
+ nlohmann_json rapidjson
+ zlib zstd libzip lz4
+ glslang
+ boost173
+ catch2
+ fmt_8
+ SDL2
+ udev
+ libusb1
+ ffmpeg
+ ];
+
+ cmakeFlags = [
+ "-DYUZU_USE_BUNDLED_QT=OFF"
+ "-DYUZU_USE_BUNDLED_SDL2=OFF"
+ "-DYUZU_USE_BUNDLED_FFMPEG=OFF"
+ "-DENABLE_QT_TRANSLATION=ON"
+ "-DYUZU_USE_QT_WEB_ENGINE=ON"
+ "-DUSE_DISCORD_PRESENCE=ON"
+ ];
+
+ # This changes `ir/opt` to `ir/var/empty` in `externals/dynarmic/src/dynarmic/CMakeLists.txt`
+ # making the build fail, as that path does not exist
+ dontFixCmake = true;
+
+ preConfigure = ''
+ # Trick the configure system. This prevents a check for submodule directories.
+ rm -f .gitmodules
+
+ # see https://github.com/NixOS/nixpkgs/issues/114044, setting this through cmakeFlags does not work.
+ cmakeFlagsArray+=(
+ "-DTITLE_BAR_FORMAT_IDLE=yuzu ${branchName} ${version}"
+ "-DTITLE_BAR_FORMAT_RUNNING=yuzu ${branchName} ${version} | {3}"
+ )
+ '';
+
+ # Fix vulkan detection
+ postFixup = ''
+ wrapProgram $out/bin/yuzu --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
+ wrapProgram $out/bin/yuzu-cmd --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
+ '';
+
+ meta = with lib; {
+ homepage = "https://yuzu-emu.org";
+ description = "The ${branchName} branch of an experimental Nintendo Switch emulator written in C++";
+ longDescription = ''
+ An experimental Nintendo Switch emulator written in C++.
+ Using the mainline branch is recommanded for general usage.
+ Using the early-access branch is recommanded if you would like to try out experimental features, with a cost of stability.
+ '';
+ license = with licenses; [
+ gpl2Plus
+ # Icons
+ cc-by-nd-30 cc0
+ ];
+ maintainers = with maintainers; [ ivar joshuafern sbruder ];
+ platforms = platforms.linux;
+ broken = stdenv.isAarch64; # Currently aarch64 is not supported.
+ };
+}
diff --git a/pkgs/applications/emulators/yuzu/default.nix b/pkgs/applications/emulators/yuzu/default.nix
new file mode 100644
index 000000000000..9e45ba0cd2cb
--- /dev/null
+++ b/pkgs/applications/emulators/yuzu/default.nix
@@ -0,0 +1,28 @@
+{ branch ? "mainline", libsForQt5, fetchFromGitHub }:
+let
+ inherit libsForQt5 fetchFromGitHub;
+in {
+ mainline = libsForQt5.callPackage ./base.nix rec {
+ pname = "yuzu-mainline";
+ version = "882";
+ branchName = branch;
+ src = fetchFromGitHub {
+ owner = "yuzu-emu";
+ repo = "yuzu-mainline";
+ rev = "mainline-0-${version}";
+ sha256 = "17j845laxnaq50icwl32yisdivwcnwa59fxdr297yxrz4hmfzhxq";
+ fetchSubmodules = true;
+ };
+ };
+ early-access = libsForQt5.callPackage ./base.nix rec {
+ pname = "yuzu-ea";
+ version = "2432";
+ branchName = branch;
+ src = fetchFromGitHub {
+ owner = "pineappleEA";
+ repo = "pineapple-src";
+ rev = "EA-${version}";
+ sha256 = "0zqab61rphgjzyxk52idhr7dqwwxih0f8b9hig3zvrwkdry9wfh4";
+ };
+ };
+}.${branch}