_86Box: simplify wrapping logic

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-03-24 11:12:18 -03:00
parent 3199d631af
commit cae20d2bf5

View File

@ -59,21 +59,15 @@ stdenv.mkDerivation (finalAttrs: {
# Some libraries are loaded dynamically, but QLibrary doesn't seem to search # Some libraries are loaded dynamically, but QLibrary doesn't seem to search
# the runpath, so use a wrapper instead. # the runpath, so use a wrapper instead.
postFixup = let preFixup = let
libPath = lib.makeLibraryPath ([ libPath = lib.makeLibraryPath ([
libpcap libpcap
] ++ lib.optional unfreeEnableDiscord discord-gamesdk); ] ++ lib.optional unfreeEnableDiscord discord-gamesdk);
libPathVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; libPathVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in in ''
'' makeWrapperArgs+=(--prefix ${libPathVar} : "${libPath}")
wrapProgram $out/bin/86Box \
"''${qtWrapperArgs[@]}" \
--prefix ${libPathVar} : "${libPath}"
''; '';
# Do not wrap twice.
dontWrapQtApps = true;
meta = with lib; { meta = with lib; {
description = "Emulator of x86-based machines based on PCem."; description = "Emulator of x86-based machines based on PCem.";
mainProgram = "86Box"; mainProgram = "86Box";