From d66c4998900eff94f2d77807599ea67b844c5cd2 Mon Sep 17 00:00:00 2001 From: IvarWithoutBones Date: Mon, 25 Jan 2021 19:32:53 +0100 Subject: [PATCH 1/2] yuzu: 482 -> 517 && rename to yuzu-mainline --- pkgs/misc/emulators/yuzu/base.nix | 66 ++++++++++++++++++++++++++++ pkgs/misc/emulators/yuzu/default.nix | 62 +++++++------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 5 ++- 4 files changed, 86 insertions(+), 48 deletions(-) create mode 100644 pkgs/misc/emulators/yuzu/base.nix diff --git a/pkgs/misc/emulators/yuzu/base.nix b/pkgs/misc/emulators/yuzu/base.nix new file mode 100644 index 000000000000..257407b1949b --- /dev/null +++ b/pkgs/misc/emulators/yuzu/base.nix @@ -0,0 +1,66 @@ +{ pname, version, src, branch +, stdenv, fetchFromGitHub, wrapQtAppsHook +, cmake, pkgconfig +, libpulseaudio, libjack2, alsaLib, sndio, ecasound +, vulkan-loader, vulkan-headers +, qtbase, qtwebengine, qttools +, nlohmann_json, rapidjson +, zlib, zstd, libzip, lz4 +, glslang +, boost173 +, catch2 +, fmt +, SDL2 +, udev +, libusb1 +, ffmpeg +}: + +stdenv.mkDerivation rec { + inherit pname version src; + + nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ]; + buildInputs = [ + libpulseaudio libjack2 alsaLib sndio ecasound + vulkan-loader vulkan-headers + qtbase qtwebengine qttools + nlohmann_json rapidjson + zlib zstd libzip lz4 + glslang + boost173 + catch2 + fmt + SDL2 + udev + libusb1 + ffmpeg + ]; + + cmakeFlags = [ "-DENABLE_QT_TRANSLATION=ON" "-DYUZU_USE_QT_WEB_ENGINE=ON" "-DUSE_DISCORD_PRESENCE=ON" ]; + + # Trick the configure system. This prevents a check for submodule directories. + preConfigure = "rm -f .gitmodules"; + + # 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 stdenv.lib; { + homepage = "https://yuzu-emu.org"; + description = "The ${branch} 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 ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/misc/emulators/yuzu/default.nix b/pkgs/misc/emulators/yuzu/default.nix index 5bb01b9fca08..6a4be69a1dc6 100644 --- a/pkgs/misc/emulators/yuzu/default.nix +++ b/pkgs/misc/emulators/yuzu/default.nix @@ -1,47 +1,17 @@ -{ lib, stdenv, fetchFromGitHub -, cmake, pkg-config, wrapQtAppsHook -, boost173, catch2, fmt, lz4, nlohmann_json, rapidjson, zlib, zstd, SDL2 -, udev, libusb1, libzip, qtbase, qtwebengine, qttools, ffmpeg -, libpulseaudio, libjack2, alsaLib, sndio, ecasound -, useVulkan ? true, vulkan-loader, vulkan-headers -}: - -stdenv.mkDerivation rec { - pname = "yuzu"; - version = "482"; - - src = fetchFromGitHub { - owner = "yuzu-emu"; - repo = "yuzu-mainline"; # They use a separate repo for mainline “branch” - rev = "mainline-0-${version}"; - sha256 = "1bhkdbhj1dv33qv0np26gzsw65p4z88whjmd6bc7mh2b5lvrjwxm"; - fetchSubmodules = true; +{ branch ? "mainline", pkgs }: +let + inherit (pkgs) libsForQt5 fetchFromGitHub; +in { + mainline = libsForQt5.callPackage ./base.nix rec { + pname = "yuzu-mainline"; + version = "517"; + branch = branch; + src = fetchFromGitHub { + owner = "yuzu-emu"; + repo = "yuzu-mainline"; + rev = "mainline-0-${version}"; + sha256 = "0i73yl2ycs8p9cqn25rw35cll0l6l68605f1mc1qvf4zy82jggbb"; + fetchSubmodules = true; + }; }; - - nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]; - buildInputs = [ qtbase qtwebengine qttools boost173 catch2 fmt lz4 nlohmann_json rapidjson zlib zstd SDL2 udev libusb1 libpulseaudio alsaLib sndio ecasound libjack2 libzip ffmpeg ] - ++ lib.optionals useVulkan [ vulkan-loader vulkan-headers ]; - cmakeFlags = [ "-DENABLE_QT_TRANSLATION=ON" "-DYUZU_USE_QT_WEB_ENGINE=ON" "-DUSE_DISCORD_PRESENCE=ON" ] - ++ lib.optionals (!useVulkan) [ "-DENABLE_VULKAN=No" ]; - - # Trick the configure system. This prevents a check for submodule directories. - preConfigure = "rm .gitmodules"; - - # Fix vulkan detection - postFixup = lib.optionals useVulkan '' - 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 = "An experimental Nintendo Switch emulator written in C++"; - license = with licenses; [ - gpl2Plus - # Icons - cc-by-nd-30 cc0 - ]; - maintainers = with maintainers; [ ivar joshuafern ]; - platforms = platforms.linux; - }; -} +}.${branch} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1b37bd3a97c5..0e13c9aea980 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -736,6 +736,7 @@ mapAliases ({ xv = xxv; # added 2020-02-22 youtubeDL = youtube-dl; # added 2014-10-26 ytop = throw "ytop has been abandoned by upstream. Consider switching to bottom instead"; + yuzu = yuzu-mainline; # added 2021-01-25 zdfmediathk = mediathekview; # added 2019-01-19 gnome_user_docs = gnome-user-docs; # added 2019-11-20 # spidermonkey is not ABI upwards-ompatible, so only allow this for nix-shell diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b86a0631a06..a1cc88e2f337 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29411,8 +29411,9 @@ in yaxg = callPackage ../tools/graphics/yaxg {}; - yuzu = libsForQt5.callPackage ../misc/emulators/yuzu { - stdenv = gcc10Stdenv; + yuzu-mainline = import ../misc/emulators/yuzu { + branch = "mainline"; + inherit pkgs; }; zap = callPackage ../tools/networking/zap { }; From 44f4a61fc762dc49eb17d3ed8120e833cedc372a Mon Sep 17 00:00:00 2001 From: IvarWithoutBones Date: Mon, 25 Jan 2021 19:34:06 +0100 Subject: [PATCH 2/2] yuzu-ea: init at 1377 --- pkgs/misc/emulators/yuzu/base.nix | 22 ++++++++++++++-------- pkgs/misc/emulators/yuzu/default.nix | 17 ++++++++++++++--- pkgs/top-level/all-packages.nix | 6 +++++- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/pkgs/misc/emulators/yuzu/base.nix b/pkgs/misc/emulators/yuzu/base.nix index 257407b1949b..89c8f2cd9474 100644 --- a/pkgs/misc/emulators/yuzu/base.nix +++ b/pkgs/misc/emulators/yuzu/base.nix @@ -1,6 +1,6 @@ -{ pname, version, src, branch -, stdenv, fetchFromGitHub, wrapQtAppsHook -, cmake, pkgconfig +{ pname, version, src, branchName +, stdenv, lib, fetchFromGitHub, wrapQtAppsHook +, cmake, pkg-config , libpulseaudio, libjack2, alsaLib, sndio, ecasound , vulkan-loader, vulkan-headers , qtbase, qtwebengine, qttools @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { inherit pname version src; - nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ]; + nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]; buildInputs = [ libpulseaudio libjack2 alsaLib sndio ecasound vulkan-loader vulkan-headers @@ -36,10 +36,16 @@ stdenv.mkDerivation rec { ffmpeg ]; - cmakeFlags = [ "-DENABLE_QT_TRANSLATION=ON" "-DYUZU_USE_QT_WEB_ENGINE=ON" "-DUSE_DISCORD_PRESENCE=ON" ]; + cmakeFlags = [ + "-DENABLE_QT_TRANSLATION=ON" + "-DYUZU_USE_QT_WEB_ENGINE=ON" + "-DUSE_DISCORD_PRESENCE=ON" + ]; # Trick the configure system. This prevents a check for submodule directories. - preConfigure = "rm -f .gitmodules"; + preConfigure = '' + rm -f .gitmodules + ''; # Fix vulkan detection postFixup = '' @@ -47,9 +53,9 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/yuzu-cmd --prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://yuzu-emu.org"; - description = "The ${branch} branch of an experimental Nintendo Switch emulator written in C++"; + 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. diff --git a/pkgs/misc/emulators/yuzu/default.nix b/pkgs/misc/emulators/yuzu/default.nix index 6a4be69a1dc6..89a500bb313c 100644 --- a/pkgs/misc/emulators/yuzu/default.nix +++ b/pkgs/misc/emulators/yuzu/default.nix @@ -1,11 +1,11 @@ -{ branch ? "mainline", pkgs }: +{ branch ? "mainline", libsForQt5, fetchFromGitHub }: let - inherit (pkgs) libsForQt5 fetchFromGitHub; + inherit libsForQt5 fetchFromGitHub; in { mainline = libsForQt5.callPackage ./base.nix rec { pname = "yuzu-mainline"; version = "517"; - branch = branch; + branchName = branch; src = fetchFromGitHub { owner = "yuzu-emu"; repo = "yuzu-mainline"; @@ -14,4 +14,15 @@ in { fetchSubmodules = true; }; }; + early-access = libsForQt5.callPackage ./base.nix rec { + pname = "yuzu-ea"; + version = "1377"; + branchName = branch; + src = fetchFromGitHub { + owner = "pineappleEA"; + repo = "pineapple-src"; + rev = "EA-${version}"; + sha256 = "0jjddmcqbkns5iqjwqh51hpjviw5j12n49jwfq7xwrsns6vbpqkf"; + }; + }; }.${branch} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a1cc88e2f337..1575caca165f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29413,7 +29413,11 @@ in yuzu-mainline = import ../misc/emulators/yuzu { branch = "mainline"; - inherit pkgs; + inherit (pkgs) libsForQt5 fetchFromGitHub; + }; + yuzu-ea = import ../misc/emulators/yuzu { + branch = "early-access"; + inherit (pkgs) libsForQt5 fetchFromGitHub; }; zap = callPackage ../tools/networking/zap { };