summary refs log tree commit diff
path: root/pkgs/applications/emulators/citra/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/emulators/citra/default.nix')
-rw-r--r--pkgs/applications/emulators/citra/default.nix122
1 files changed, 37 insertions, 85 deletions
diff --git a/pkgs/applications/emulators/citra/default.nix b/pkgs/applications/emulators/citra/default.nix
index 31f5ebc3038..8b9f2cfd069 100644
--- a/pkgs/applications/emulators/citra/default.nix
+++ b/pkgs/applications/emulators/citra/default.nix
@@ -1,93 +1,45 @@
-{ lib
-, stdenv
+{ branch
+, libsForQt5
 , fetchFromGitHub
-, cmake
-, wrapQtAppsHook
-, boost17x
-, pkg-config
-, libusb1
-, zstd
-, libressl
-, enableSdl2 ? true, SDL2
-, enableQt ? true, qtbase, qtmultimedia
-, enableQtTranslation ? enableQt, qttools
-, enableWebService ? true
-, enableCubeb ? true, libpulseaudio
-, enableFfmpegAudioDecoder ? true
-, enableFfmpegVideoDumper ? true
-, ffmpeg
-, useDiscordRichPresence ? true, rapidjson
-, enableFdk ? false, fdk_aac
+, fetchurl
 }:
-assert lib.assertMsg (!enableFfmpegAudioDecoder || !enableFdk) "Can't enable both enableFfmpegAudioDecoder and enableFdk";
 
-stdenv.mkDerivation {
-  pname = "citra";
-  version = "2021-11-01";
-
-  src = fetchFromGitHub {
-    owner = "citra-emu";
-    repo = "citra";
-    rev = "5a7d80172dd115ad9bc6e8e85cee6ed9511c48d0";
-    sha256 = "sha256-vy2JMizBsnRK9NBEZ1dxT7fP/HFhOZSsC+5P+Dzi27s=";
-    fetchSubmodules = true;
+let
+  # Fetched from https://api.citra-emu.org/gamedb, last updated 2022-05-02
+  # Please make sure to update this when updating citra!
+  compat-list = fetchurl {
+    name = "citra-compat-list";
+    url = "https://web.archive.org/web/20220502114622/https://api.citra-emu.org/gamedb/";
+    sha256 = "sha256-blIlaYaUQjw7Azgg+Dd7ZPEQf+ddZMO++Yxinwe+VG0=";
+  };
+in {
+  nightly = libsForQt5.callPackage ./generic.nix rec {
+    pname = "citra-nightly";
+    version = "1765";
+
+    src = fetchFromGitHub {
+      owner = "citra-emu";
+      repo = "citra-nightly";
+      rev = "nightly-${version}";
+      sha256 = "0d3dfh63cmsy5idbypdz3ibydmb4a35sfv7qmxxlcpc390pp9cvq";
+      fetchSubmodules = true;
+    };
+
+    inherit branch compat-list;
   };
 
-  nativeBuildInputs = [
-    cmake
-    pkg-config
-  ]
-  ++ lib.optionals enableQt [ wrapQtAppsHook ];
-
-  buildInputs = [
-    boost17x
-    libusb1
-  ]
-  ++ lib.optionals enableSdl2 [ SDL2 ]
-  ++ lib.optionals enableQt [ qtbase qtmultimedia ]
-  ++ lib.optionals enableQtTranslation [ qttools ]
-  ++ lib.optionals enableCubeb [ libpulseaudio ]
-  ++ lib.optionals (enableFfmpegAudioDecoder || enableFfmpegVideoDumper) [ ffmpeg ]
-  ++ lib.optionals useDiscordRichPresence [ rapidjson ]
-  ++ lib.optionals enableFdk [ fdk_aac ];
-
-  cmakeFlags = [
-    "-DUSE_SYSTEM_BOOST=ON"
-  ]
-  ++ lib.optionals (!enableSdl2) [ "-DENABLE_SDL2=OFF" ]
-  ++ lib.optionals (!enableQt) [ "-DENABLE_QT=OFF" ]
-  ++ lib.optionals enableQtTranslation [ "-DENABLE_QT_TRANSLATION=ON" ]
-  ++ lib.optionals (!enableWebService) [ "-DENABLE_WEB_SERVICE=OFF" ]
-  ++ lib.optionals (!enableCubeb) [ "-DENABLE_CUBEB=OFF" ]
-  ++ lib.optionals enableFfmpegAudioDecoder [ "-DENABLE_FFMPEG_AUDIO_DECODER=ON"]
-  ++ lib.optionals enableFfmpegVideoDumper [ "-DENABLE_FFMPEG_VIDEO_DUMPER=ON" ]
-  ++ lib.optionals useDiscordRichPresence [ "-DUSE_DISCORD_PRESENCE=ON" ]
-  ++ lib.optionals enableFdk [ "-DENABLE_FDK=ON" ];
-
-  postPatch = ''
-    # We already know the submodules are present
-    substituteInPlace CMakeLists.txt \
-      --replace "check_submodules_present()" ""
-
-    # Devendoring
-    rm -rf externals/zstd externals/libressl
-    cp -r ${zstd.src} externals/zstd
-    tar xf ${libressl.src} -C externals/
-    mv externals/${libressl.name} externals/libressl
-    chmod -R a+w externals/zstd
-  '';
+  canary = libsForQt5.callPackage ./generic.nix rec {
+    pname = "citra-canary";
+    version = "2146";
 
-  # Fixes https://github.com/NixOS/nixpkgs/issues/171173
-  postInstall = lib.optionalString (enableCubeb && enableSdl2) ''
-    wrapProgram "$out/bin/citra" \
-      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libpulseaudio ]}
-  '';
+    src = fetchFromGitHub {
+      owner = "citra-emu";
+      repo = "citra-canary";
+      rev = "canary-${version}";
+      sha256 = "1wnym0nklngimf5gaaa2703nz4g5iy572wlgp88h67rrh9b4f04r";
+      fetchSubmodules = true;
+    };
 
-  meta = with lib; {
-    homepage = "https://citra-emu.org";
-    description = "An open-source emulator for the Nintendo 3DS";
-    license = licenses.gpl2;
-    maintainers = with maintainers; [ abbradar ];
-    platforms = platforms.linux;
+    inherit branch compat-list;
   };
-}
+}.${branch}