guix/gnu/packages/patches/torbrowser-use-system-wide-dir.patch
André Batista 972a8412d5
gnu: torbrowser: Update to 15.0.
User profile directory has changed to "~/.tor project" in this version as
MOZ_APP_PROFILE flag cannot be set anymore.

* gnu/packages/tor-browsers.scm (firefox-locales): Update to 64046fdc97.
(%torbrowser-build-date): Update to 20251028094500.
(%torbrowser-version): Update to 15.0.
(%torbrowser-firefox-version): Update to 140.4.0esr-15.0-1-build4.
(torbrowser-translation-base): Update to cdd3da6308.
(torbrowser-translation-specific): Update to 3395fe5bdb.
(lld-as-ld-wrapper-18): Replace with lld-as-ld-wrapper-19.
(make-torbrowser) [inputs]: Use libpng-apng-next, icu4c-76 and nss-rapid,
in place of the defaults for those libraries.
[native-inputs]: Use rust-cbindgen-0.28, lld-as-ld-wrapper-19, llvm-19 and
clang-19.
[arguments] <#:configure-flags>: Remove '--enable-official-branding' which
breaks browser branding as of this version.
<#:phases> 'setenv: Do not set MOZ_APP_PROFILE, which is now implied and
breaks configuration phase when set.
* gnu/packages/patches/torbrowser-compare-paths.patch: ...
* gnu/packages/patches/torbrowser-use-system-wide-dir.patch: ...
* gnu/packages/patches/torbrowsers-add-store-to-rdd-allowlist.patch: Refresh
patches.

Change Id: Id4134edd63328f479589e6ed61f46a869dbbda5d

Signed-off-by: Andreas Enge <andreas@enge.fr>
2025-12-03 20:08:58 +01:00

35 lines
1.2 KiB
Diff

Replace "/usr/lib/mozilla" (the system-wide directory for extensions and
native manifests) with "$ICECAT_SYSTEM_DIR".
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -287,24 +287,11 @@
static nsresult GetSystemParentDirectory(nsIFile** aFile) {
nsresult rv;
nsCOMPtr<nsIFile> localDir;
-# if defined(XP_MACOSX)
- rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType,
- getter_AddRefs(localDir));
- if (NS_SUCCEEDED(rv)) {
- rv = localDir->AppendNative("Mozilla"_ns);
- }
-# else
- constexpr auto dirname =
-# ifdef HAVE_USR_LIB64_DIR
- "/usr/lib64/mozilla"_ns
-# elif defined(__OpenBSD__) || defined(__FreeBSD__)
- "/usr/local/lib/mozilla"_ns
-# else
- "/usr/lib/mozilla"_ns
-# endif
- ;
- rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir));
-# endif
+ const char* systemParentDir = getenv("ICECAT_SYSTEM_DIR");
+ if (!systemParentDir || !*systemParentDir) return NS_ERROR_FAILURE;
+
+ rv = NS_NewNativeLocalFile(nsDependentCString(systemParentDir),
+ getter_AddRefs(localDir));
if (NS_SUCCEEDED(rv)) {
localDir.forget(aFile);