Skip to content

Commit

Permalink
buildMozillaMach: update system dir patch for Firefox 133+
Browse files Browse the repository at this point in the history
Signed-off-by: Sefa Eyeoglu <[email protected]>
  • Loading branch information
Scrumplex committed Oct 29, 2024
1 parent d4049f0 commit b7c348b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkgs/applications/networking/browsers/firefox/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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")) [
Expand Down
Original file line number Diff line number Diff line change
@@ -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<const nsCString&>(dirname), getter_AddRefs(localDir));
# endif

if (NS_SUCCEEDED(rv)) {

0 comments on commit b7c348b

Please sign in to comment.