From 2c5b25312aca35125bf7ebe6fcafb6988351e92b Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Sun, 16 Feb 2025 22:39:19 -0500 Subject: [PATCH] firefox: also copy any embedded *.app bundles on Darwin Without this, plugin-container fails to start. Signed-off-by: Ihar Hrachyshka --- .../networking/browsers/firefox/wrapper.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index 5aebff66b1f4..bd28a3abdd12 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -323,14 +323,22 @@ let cd "$out" '' + lib.optionalString isDarwin '' + cd "${appPath}" + # These files have to be copied and not symlinked, otherwise tabs crash. # Maybe related to how omni.ja file is mmapped into memory. See: # https://github.com/mozilla/gecko-dev/blob/b1662b447f306e6554647914090d4b73ac8e1664/modules/libjar/nsZipArchive.cpp#L204 - cd "${appPath}" for file in $(find . -type l -name "omni.ja"); do rm "$file" cp "${browser}/${appPath}/$file" "$file" done + + # Copy any embedded .app directories; plugin-container fails to start otherwise. + for dir in $(find . -type d -name '*.app'); do + rm -r "$dir" + cp -r "${browser}/${appPath}/$dir" "$dir" + done + cd .. '' + ''