firefox: don't include xdg-open and other linux-specific dependencies in wrapped closure on darwin (#395917)

This commit is contained in:
Martin Weinelt
2025-04-06 15:37:41 +02:00
committed by GitHub
@@ -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"
@@ -330,7 +331,7 @@ let
"1"
]
++ lib.optionals (!xdg-utils.meta.broken) [
++ lib.optionals (!xdg-utils.meta.broken && !isDarwin) [
# make xdg-open overridable at runtime
"--suffix"
"PATH"
@@ -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[@]}"