citra: nightly 1963 -> 2043, canary 2573 -> 2695

This commit is contained in:
Martino Fontana 2023-10-29 12:11:28 +01:00
parent 8b8c940784
commit 5139b441d3
2 changed files with 69 additions and 48 deletions

View file

@ -9,19 +9,19 @@ let
# Please make sure to update this when updating citra! # Please make sure to update this when updating citra!
compat-list = fetchurl { compat-list = fetchurl {
name = "citra-compat-list"; name = "citra-compat-list";
url = "https://web.archive.org/web/20230807103651/https://api.citra-emu.org/gamedb/"; url = "https://web.archive.org/web/20231111133415/https://api.citra-emu.org/gamedb";
hash = "sha256-J+zqtWde5NgK2QROvGewtXGRAWUTNSKHNMG6iu9m1fU="; hash = "sha256-J+zqtWde5NgK2QROvGewtXGRAWUTNSKHNMG6iu9m1fU=";
}; };
in { in {
nightly = qt6Packages.callPackage ./generic.nix rec { nightly = qt6Packages.callPackage ./generic.nix rec {
pname = "citra-nightly"; pname = "citra-nightly";
version = "1963"; version = "2043";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "citra-emu"; owner = "citra-emu";
repo = "citra-nightly"; repo = "citra-nightly";
rev = "nightly-${version}"; rev = "nightly-${version}";
sha256 = "0ggi1l8327s43xaxs616g0s9vmal6q7vsv69bn07gp71gchhcmyi"; sha256 = "sha256-26M3uzqp4rUMOhr619UooupZT11B03IJfamUPNkceQk=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
@ -30,13 +30,13 @@ in {
canary = qt6Packages.callPackage ./generic.nix rec { canary = qt6Packages.callPackage ./generic.nix rec {
pname = "citra-canary"; pname = "citra-canary";
version = "2573"; version = "2695";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "citra-emu"; owner = "citra-emu";
repo = "citra-canary"; repo = "citra-canary";
rev = "canary-${version}"; rev = "canary-${version}";
sha256 = "sha256-tQJ3WcqGcnW9dOiwDrBgL0n3UNp1DGQ/FjCR28Xjdpc="; sha256 = "sha256-090er4aUGze8bk3DIFZoa+/6EcJhr4bim3nWgZHs1mo=";
fetchSubmodules = true; fetchSubmodules = true;
}; };

View file

@ -6,70 +6,93 @@
, lib , lib
, stdenv , stdenv
, fetchFromGitHub
, cmake , cmake
, boost , boost
, pkg-config , pkg-config
, libusb1 , catch2_3
, cpp-jwt
, cryptopp
, enet
, ffmpeg
, fmt
, glslang , glslang
, httplib
, inih
, libusb1
, nlohmann_json
, openal
, openssl
, SDL2
, soundtouch
, spirv-tools
, zstd , zstd
, libressl , vulkan-headers
, enableSdl2 ? true, SDL2 , vulkan-loader
, enableQt ? true, qtbase, qtmultimedia, wrapQtAppsHook , enableSdl2Frontend ? true
, enableQt ? true, qtbase, qtmultimedia, qtwayland, wrapQtAppsHook
, enableQtTranslation ? enableQt, qttools , enableQtTranslation ? enableQt, qttools
, enableWebService ? true , enableWebService ? true
, enableCubeb ? true, cubeb , enableCubeb ? true, cubeb
, enableFfmpegAudioDecoder ? true
, enableFfmpegVideoDumper ? true
, ffmpeg_4
, useDiscordRichPresence ? true, rapidjson , useDiscordRichPresence ? true, rapidjson
, enableFdk ? false, fdk_aac
}: }:
assert lib.assertMsg (!enableFfmpegAudioDecoder || !enableFdk) "Can't enable both enableFfmpegAudioDecoder and enableFdk"; stdenv.mkDerivation {
stdenv.mkDerivation rec {
inherit pname version src; inherit pname version src;
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
glslang
pkg-config pkg-config
ffmpeg
glslang
] ++ lib.optionals enableQt [ wrapQtAppsHook ]; ] ++ lib.optionals enableQt [ wrapQtAppsHook ];
buildInputs = [ buildInputs = [
boost boost
catch2_3
cpp-jwt
cryptopp
# intentionally omitted: dynarmic - prefer vendored version for compatibility
enet
fmt
httplib
inih
libusb1 libusb1
] ++ lib.optionals enableQt [ qtbase qtmultimedia ] nlohmann_json
++ lib.optional enableSdl2 SDL2 openal
openssl
SDL2
soundtouch
spirv-tools
vulkan-headers
# intentionally omitted: xbyak - prefer vendored version for compatibility
zstd
] ++ lib.optionals enableQt [ qtbase qtmultimedia qtwayland ]
++ lib.optional enableQtTranslation qttools ++ lib.optional enableQtTranslation qttools
++ lib.optionals enableCubeb cubeb.passthru.backendLibs ++ lib.optional enableCubeb cubeb
++ lib.optional (enableFfmpegAudioDecoder || enableFfmpegVideoDumper) ffmpeg_4 ++ lib.optional useDiscordRichPresence rapidjson;
++ lib.optional useDiscordRichPresence rapidjson
++ lib.optional enableFdk fdk_aac;
cmakeFlags = [ cmakeFlags = [
"-DUSE_SYSTEM_BOOST=ON" "-DUSE_SYSTEM_LIBS=ON"
"-DCITRA_WARNINGS_AS_ERRORS=OFF"
"-DCITRA_USE_BUNDLED_FFMPEG=OFF"
"-DCITRA_USE_BUNDLED_QT=OFF"
"-DUSE_SYSTEM_SDL2=ON"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
# We dont want to bother upstream with potentially outdated compat reports "-DDISABLE_SYSTEM_DYNARMIC=ON"
"-DDISABLE_SYSTEM_GLSLANG=ON" # The following imported targets are referenced, but are missing: SPIRV-Tools-opt
"-DDISABLE_SYSTEM_LODEPNG=ON" # Not packaged in nixpkgs
"-DDISABLE_SYSTEM_VMA=ON"
"-DDISABLE_SYSTEM_XBYAK=ON"
# We don't want to bother upstream with potentially outdated compat reports
"-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON" "-DCITRA_ENABLE_COMPATIBILITY_REPORTING=ON"
"-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically "-DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF" # We provide this deterministically
] ++ lib.optional (!enableSdl2) "-DENABLE_SDL2=OFF" ] ++ lib.optional (!enableSdl2Frontend) "-DENABLE_SDL2_FRONTEND=OFF"
++ lib.optional (!enableQt) "-DENABLE_QT=OFF" ++ lib.optional (!enableQt) "-DENABLE_QT=OFF"
++ lib.optional enableQtTranslation "-DENABLE_QT_TRANSLATION=ON" ++ lib.optional enableQtTranslation "-DENABLE_QT_TRANSLATION=ON"
++ lib.optional (!enableWebService) "-DENABLE_WEB_SERVICE=OFF" ++ lib.optional (!enableWebService) "-DENABLE_WEB_SERVICE=OFF"
++ lib.optional (!enableCubeb) "-DENABLE_CUBEB=OFF" ++ lib.optional (!enableCubeb) "-DENABLE_CUBEB=OFF"
++ lib.optional enableFfmpegAudioDecoder "-DENABLE_FFMPEG_AUDIO_DECODER=ON" ++ lib.optional useDiscordRichPresence "-DUSE_DISCORD_PRESENCE=ON";
++ lib.optional enableFfmpegVideoDumper "-DENABLE_FFMPEG_VIDEO_DUMPER=ON"
++ lib.optional useDiscordRichPresence "-DUSE_DISCORD_PRESENCE=ON"
++ lib.optional enableFdk "-DENABLE_FDK=ON";
postPatch = with lib; let # causes redefinition of _FORTIFY_SOURCE
hardeningDisable = [ "fortify3" ];
postPatch = let
branchCaptialized = (lib.toUpper (lib.substring 0 1 branch) + lib.substring 1 (-1) branch); branchCaptialized = (lib.toUpper (lib.substring 0 1 branch) + lib.substring 1 (-1) branch);
in '' in ''
# Fix file not found when looking in var/empty instead of opt # Fix file not found when looking in var/empty instead of opt
@ -85,19 +108,17 @@ stdenv.mkDerivation rec {
# Add versions # Add versions
echo 'set(BUILD_FULLNAME "${branchCaptialized} ${version}")' >> CMakeModules/GenerateBuildInfo.cmake echo 'set(BUILD_FULLNAME "${branchCaptialized} ${version}")' >> CMakeModules/GenerateBuildInfo.cmake
# 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
''; '';
# Fixes https://github.com/NixOS/nixpkgs/issues/171173 postInstall = let
postInstall = lib.optionalString (enableCubeb && enableSdl2) '' libs = lib.makeLibraryPath [ vulkan-loader ];
in lib.optionalString enableSdl2Frontend ''
wrapProgram "$out/bin/citra" \ wrapProgram "$out/bin/citra" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath cubeb.passthru.backendLibs} --prefix LD_LIBRARY_PATH : ${libs}
'' + lib.optionalString enableQt ''
qtWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${libs}
)
''; '';
meta = with lib; { meta = with lib; {