Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 19 additions & 39 deletions pkgs/by-name/az/azahar/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
fmt,
ffmpeg_6-headless,
gamemode,
glslang,
httplib,
inih,
lib,
Expand All @@ -31,27 +32,23 @@
soundtouch,
stdenv,
vulkan-headers,
vulkan-loader,
xorg,
zstd,
enableSdl2Frontend ? true,
enableSDL2 ? true,
SDL2,
enableQt ? true,
qt6,
enableQtTranslations ? enableQt,
qt6,
enableCubeb ? true,
cubeb,
useDiscordRichPresence ? false,
useDiscordRichPresence ? true,
rapidjson,
}:
let
inherit (lib)
optional
optionals
cmakeBool
optionalString
getLib
makeLibraryPath
;
in
stdenv.mkDerivation (finalAttrs: {
Expand Down Expand Up @@ -81,6 +78,7 @@ stdenv.mkDerivation (finalAttrs: {
enet
fmt
ffmpeg_6-headless
glslang
httplib
inih
libGL
Expand Down Expand Up @@ -110,10 +108,10 @@ stdenv.mkDerivation (finalAttrs: {
qtwayland
]
)
++ optionals enableSdl2Frontend [ SDL2 ]
++ optionals enableQtTranslations [ qt6.qttools ]
++ optionals enableSDL2 [ SDL2 ]
++ optionals enableCubeb [ cubeb ]
++ optional useDiscordRichPresence rapidjson;
++ optionals useDiscordRichPresence [ rapidjson ];

patches = [
# Fix boost errors
Expand Down Expand Up @@ -143,42 +141,24 @@ stdenv.mkDerivation (finalAttrs: {
--replace-fail "libgamemode.so.0" "${getLib gamemode}/lib/libgamemode.so.0"
'';

postInstall =
let
libs = makeLibraryPath [ vulkan-loader ];
in
optionalString enableSdl2Frontend ''
for binfile in azahar azahar-room
do
wrapProgram "$out/bin/$binfile" \
--prefix LD_LIBRARY_PATH : ${libs}
done
'';

cmakeFlags =
[
(cmakeBool "CITRA_USE_PRECOMPILED_HEADERS" false)
(cmakeBool "USE_SYSTEM_LIBS" true)
(cmakeBool "DISABLE_SYSTEM_DYNARMIC" true)
(cmakeBool "DISABLE_SYSTEM_GLSLANG" true)
(cmakeBool "DISABLE_SYSTEM_LODEPNG" true)
(cmakeBool "DISABLE_SYSTEM_VMA" true)
(cmakeBool "DISABLE_SYSTEM_XBYAK" true)
(cmakeBool "ENABLE_QT" enableQt)
(cmakeBool "ENABLE_SDL2_FRONTEND" enableSdl2Frontend)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arthsmn I think this change made it so that the SDL2 frontend can no longer be enabled without overrideAttrs; attempting to run the package with -n or --no-gui arg results in the message

Cannot use SDL frontend as it was disabled at compile time. Exiting.

Looking at the CMake options, I think both flags are needed to actually end up with a usable SDL2 frontend? Do you think it would make sense to have something like this?

cmakeFlags = [
  # ...
  (cmakeBool "ENABLE_SDL2" enableSDL2)
  (cmakeBool "ENABLE_SDL2_FRONTEND" enableSDL2)
];

I'm happen to open a PR if it makes sense to change like this (or perhaps add a different flag for the frontend?)

Copy link
Member Author

@arthsmn arthsmn Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the inconvenience. As it can be seen here, the ENABLE_SDL2_FRONTEND option is disabled by default, so this option might be the problem. I disabled it because somewhere the devs said it was a mess but I didn't know it had a usecase. I'm not at home right now, so if you could open a PR, I would be glad to accept it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #396667.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

(cmakeBool "ENABLE_CUBEB" enableCubeb)
(cmakeBool "USE_DISCORD_PRESENCE" useDiscordRichPresence)
]
++ optionals enableQt [
(cmakeBool "ENABLE_QT_TRANSLATION" enableQtTranslations)
];
cmakeFlags = [
(cmakeBool "USE_SYSTEM_LIBS" true)
(cmakeBool "DISABLE_SYSTEM_DYNARMIC" true)
(cmakeBool "DISABLE_SYSTEM_LODEPNG" true)
(cmakeBool "DISABLE_SYSTEM_VMA" true)
(cmakeBool "DISABLE_SYSTEM_XBYAK" true)
(cmakeBool "ENABLE_QT" enableQt)
(cmakeBool "ENABLE_QT_TRANSLATION" enableQtTranslations)
(cmakeBool "ENABLE_SDL2" enableSDL2)
(cmakeBool "ENABLE_CUBEB" enableCubeb)
(cmakeBool "USE_DISCORD_PRESENCE" useDiscordRichPresence)
];

meta = {
description = "An open-source 3DS emulator project based on Citra";
homepage = "https://github.com/azahar-emu/azahar";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ arthsmn ];
mainProgram = "azahar";
platforms = lib.platforms.linux;
};
})