firefox: additional closure cleanup for darwin

gtk, libcanberra, glvnd, pulseaudio, gsettings - none are used on
Darwin. Neither Wayland variables are needed on the platform.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
Ihar Hrachyshka
2025-04-04 23:13:27 -04:00
parent 489f834fcf
commit 7bdcd453f2
@@ -49,7 +49,7 @@ let
wmClass ? applicationName,
nativeMessagingHosts ? [ ],
pkcs11Modules ? [ ],
useGlvnd ? true,
useGlvnd ? (!isDarwin),
cfg ? config.${applicationName} or { },
## Following options are needed for extra prefs & policies
@@ -109,13 +109,13 @@ let
zlib
]
)
++ lib.optional (config.pulseaudio or true) libpulseaudio
++ lib.optional (config.pulseaudio or (!isDarwin)) libpulseaudio
++ lib.optional alsaSupport alsa-lib
++ lib.optional sndioSupport sndio
++ lib.optional jackSupport libjack2
++ lib.optional smartcardSupport opensc
++ pkcs11Modules
++ gtk_modules;
++ lib.optionals (!isDarwin) gtk_modules;
gtk_modules = [ libcanberra-gtk3 ];
# Darwin does not rename bundled binaries
@@ -289,7 +289,7 @@ let
lndir
jq
];
buildInputs = [ browser.gtk3 ];
buildInputs = lib.optionals (!isDarwin) [ browser.gtk3 ];
makeWrapperArgs =
[
@@ -298,11 +298,6 @@ let
":"
"${finalAttrs.libs}"
"--suffix"
"GTK_PATH"
":"
"${lib.concatStringsSep ":" finalAttrs.gtk_modules}"
"--suffix"
"PATH"
":"
@@ -319,6 +314,12 @@ let
"--set"
"MOZ_ALLOW_DOWNGRADE"
"1"
]
++ lib.optionals (!isDarwin) [
"--suffix"
"GTK_PATH"
":"
"${lib.concatStringsSep ":" finalAttrs.gtk_modules}"
"--suffix"
"XDG_DATA_DIRS"
@@ -457,8 +458,11 @@ let
oldExe="$executablePrefix/.${applicationName}"-old
mv "$executablePath" "$oldExe"
fi
''
+ lib.optionalString (!isDarwin) ''
appendToVar makeWrapperArgs --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
''
+ ''
concatTo makeWrapperArgs oldWrapperArgs
makeWrapper "$oldExe" "$out/${finalBinaryPath}" "''${makeWrapperArgs[@]}"