From b7c348bbd054f9a1ebd9ffcca8c9effb19842888 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 29 Oct 2024 21:28:50 +0100 Subject: [PATCH] buildMozillaMach: update system dir patch for Firefox 133+ Signed-off-by: Sefa Eyeoglu --- .../networking/browsers/firefox/common.nix | 3 ++- .../env_var_for_system_dir-ff133.patch | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/networking/browsers/firefox/env_var_for_system_dir-ff133.patch diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 3b4e6cdba26eab..52165b6721799c 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -234,7 +234,8 @@ buildStdenv.mkDerivation { "profilingPhase" ]; - patches = lib.optionals (lib.versionAtLeast version "111") [ ./env_var_for_system_dir-ff111.patch ] + patches = lib.optionals (lib.versionAtLeast version "111" && lib.versionOlder version "133") [ ./env_var_for_system_dir-ff111.patch ] + ++ lib.optionals (lib.versionAtLeast version "133") [ ./env_var_for_system_dir-ff133.patch ] ++ lib.optionals (lib.versionAtLeast version "96" && lib.versionOlder version "121") [ ./no-buildconfig-ffx96.patch ] ++ lib.optionals (lib.versionAtLeast version "121") [ ./no-buildconfig-ffx121.patch ] ++ lib.optionals (lib.versionOlder version "128.2" || (lib.versionAtLeast version "129" && lib.versionOlder version "130")) [ diff --git a/pkgs/applications/networking/browsers/firefox/env_var_for_system_dir-ff133.patch b/pkgs/applications/networking/browsers/firefox/env_var_for_system_dir-ff133.patch new file mode 100644 index 00000000000000..f35569c5909fc4 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox/env_var_for_system_dir-ff133.patch @@ -0,0 +1,22 @@ +diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp +index 6db876975187..5882c5d7f1d6 100644 +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -11,6 +11,7 @@ + + #include "jsapi.h" + #include "xpcpublic.h" ++#include "prenv.h" + #include "prprf.h" + + #include "nsIAppStartup.h" +@@ -297,7 +297,8 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) { + "/usr/lib/mozilla"_ns + # endif + ; +- rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir)); ++ const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR"); ++ rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast(dirname), getter_AddRefs(localDir)); + # endif + + if (NS_SUCCEEDED(rv)) {