|
| 1 | +{ stdenv, fetchFromGitHub |
| 2 | +, cmake, pkgconfig, wrapQtAppsHook |
| 3 | +, boost173, catch2, fmt, lz4, nlohmann_json, rapidjson, zlib, zstd, SDL2 |
| 4 | +, udev, libusb1, libzip, qtbase, qtwebengine, qttools, ffmpeg |
| 5 | +, libpulseaudio, libjack2, alsaLib, sndio, ecasound |
| 6 | +, useVulkan ? true, vulkan-loader, vulkan-headers |
| 7 | +}: |
| 8 | + |
| 9 | +stdenv.mkDerivation rec { |
| 10 | + pname = "yuzu"; |
| 11 | + version = "482"; |
| 12 | + |
| 13 | + src = fetchFromGitHub { |
| 14 | + owner = "yuzu-emu"; |
| 15 | + repo = "yuzu-mainline"; # They use a separate repo for mainline “branch” |
| 16 | + rev = "mainline-0-${version}"; |
| 17 | + sha256 = "1bhkdbhj1dv33qv0np26gzsw65p4z88whjmd6bc7mh2b5lvrjwxm"; |
| 18 | + fetchSubmodules = true; |
| 19 | + }; |
| 20 | + |
| 21 | + nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ]; |
| 22 | + buildInputs = [ qtbase qtwebengine qttools boost173 catch2 fmt lz4 nlohmann_json rapidjson zlib zstd SDL2 udev libusb1 libpulseaudio alsaLib sndio ecasound libjack2 libzip ffmpeg ] |
| 23 | + ++ stdenv.lib.optionals useVulkan [ vulkan-loader vulkan-headers ]; |
| 24 | + cmakeFlags = [ "-DENABLE_QT_TRANSLATION=ON" "-DYUZU_USE_QT_WEB_ENGINE=ON" "-DUSE_DISCORD_PRESENCE=ON" ] |
| 25 | + ++ stdenv.lib.optionals (!useVulkan) [ "-DENABLE_VULKAN=No" ]; |
| 26 | + |
| 27 | + # Trick the configure system. This prevents a check for submodule directories. |
| 28 | + preConfigure = "rm .gitmodules"; |
| 29 | + |
| 30 | + # Fix vulkan detection |
| 31 | + postFixup = stdenv.lib.optionals useVulkan '' |
| 32 | + wrapProgram $out/bin/yuzu --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib |
| 33 | + wrapProgram $out/bin/yuzu-cmd --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib |
| 34 | + ''; |
| 35 | + |
| 36 | + meta = with stdenv.lib; { |
| 37 | + homepage = "https://yuzu-emu.org"; |
| 38 | + description = "An experimental Nintendo Switch emulator written in C++"; |
| 39 | + license = with licenses; [ |
| 40 | + gpl2Plus |
| 41 | + # Icons |
| 42 | + cc-by-nd-30 cc0 |
| 43 | + ]; |
| 44 | + maintainers = with maintainers; [ ivar joshuafern ]; |
| 45 | + platforms = platforms.linux; |
| 46 | + }; |
| 47 | +} |
0 commit comments