azahar: refactor
This commit is contained in:
parent
e448c1c1e6
commit
5a396598ed
@ -12,6 +12,7 @@
|
|||||||
fmt,
|
fmt,
|
||||||
ffmpeg_6-headless,
|
ffmpeg_6-headless,
|
||||||
gamemode,
|
gamemode,
|
||||||
|
glslang,
|
||||||
httplib,
|
httplib,
|
||||||
inih,
|
inih,
|
||||||
lib,
|
lib,
|
||||||
@ -31,27 +32,23 @@
|
|||||||
soundtouch,
|
soundtouch,
|
||||||
stdenv,
|
stdenv,
|
||||||
vulkan-headers,
|
vulkan-headers,
|
||||||
vulkan-loader,
|
|
||||||
xorg,
|
xorg,
|
||||||
zstd,
|
zstd,
|
||||||
enableSdl2Frontend ? true,
|
enableSDL2 ? true,
|
||||||
SDL2,
|
SDL2,
|
||||||
enableQt ? true,
|
enableQt ? true,
|
||||||
qt6,
|
|
||||||
enableQtTranslations ? enableQt,
|
enableQtTranslations ? enableQt,
|
||||||
|
qt6,
|
||||||
enableCubeb ? true,
|
enableCubeb ? true,
|
||||||
cubeb,
|
cubeb,
|
||||||
useDiscordRichPresence ? false,
|
useDiscordRichPresence ? true,
|
||||||
rapidjson,
|
rapidjson,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
optional
|
|
||||||
optionals
|
optionals
|
||||||
cmakeBool
|
cmakeBool
|
||||||
optionalString
|
|
||||||
getLib
|
getLib
|
||||||
makeLibraryPath
|
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
@ -81,6 +78,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
enet
|
enet
|
||||||
fmt
|
fmt
|
||||||
ffmpeg_6-headless
|
ffmpeg_6-headless
|
||||||
|
glslang
|
||||||
httplib
|
httplib
|
||||||
inih
|
inih
|
||||||
libGL
|
libGL
|
||||||
@ -110,10 +108,10 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
qtwayland
|
qtwayland
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
++ optionals enableSdl2Frontend [ SDL2 ]
|
|
||||||
++ optionals enableQtTranslations [ qt6.qttools ]
|
++ optionals enableQtTranslations [ qt6.qttools ]
|
||||||
|
++ optionals enableSDL2 [ SDL2 ]
|
||||||
++ optionals enableCubeb [ cubeb ]
|
++ optionals enableCubeb [ cubeb ]
|
||||||
++ optional useDiscordRichPresence rapidjson;
|
++ optionals useDiscordRichPresence [ rapidjson ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# Fix boost errors
|
# Fix boost errors
|
||||||
@ -143,35 +141,18 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
--replace-fail "libgamemode.so.0" "${getLib gamemode}/lib/libgamemode.so.0"
|
--replace-fail "libgamemode.so.0" "${getLib gamemode}/lib/libgamemode.so.0"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall =
|
cmakeFlags = [
|
||||||
let
|
(cmakeBool "USE_SYSTEM_LIBS" true)
|
||||||
libs = makeLibraryPath [ vulkan-loader ];
|
(cmakeBool "DISABLE_SYSTEM_DYNARMIC" true)
|
||||||
in
|
(cmakeBool "DISABLE_SYSTEM_LODEPNG" true)
|
||||||
optionalString enableSdl2Frontend ''
|
(cmakeBool "DISABLE_SYSTEM_VMA" true)
|
||||||
for binfile in azahar azahar-room
|
(cmakeBool "DISABLE_SYSTEM_XBYAK" true)
|
||||||
do
|
(cmakeBool "ENABLE_QT" enableQt)
|
||||||
wrapProgram "$out/bin/$binfile" \
|
(cmakeBool "ENABLE_QT_TRANSLATION" enableQtTranslations)
|
||||||
--prefix LD_LIBRARY_PATH : ${libs}
|
(cmakeBool "ENABLE_SDL2" enableSDL2)
|
||||||
done
|
(cmakeBool "ENABLE_CUBEB" enableCubeb)
|
||||||
'';
|
(cmakeBool "USE_DISCORD_PRESENCE" useDiscordRichPresence)
|
||||||
|
];
|
||||||
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)
|
|
||||||
(cmakeBool "ENABLE_CUBEB" enableCubeb)
|
|
||||||
(cmakeBool "USE_DISCORD_PRESENCE" useDiscordRichPresence)
|
|
||||||
]
|
|
||||||
++ optionals enableQt [
|
|
||||||
(cmakeBool "ENABLE_QT_TRANSLATION" enableQtTranslations)
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "An open-source 3DS emulator project based on Citra";
|
description = "An open-source 3DS emulator project based on Citra";
|
||||||
@ -179,6 +160,5 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
license = lib.licenses.gpl2Only;
|
license = lib.licenses.gpl2Only;
|
||||||
maintainers = with lib.maintainers; [ arthsmn ];
|
maintainers = with lib.maintainers; [ arthsmn ];
|
||||||
mainProgram = "azahar";
|
mainProgram = "azahar";
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user