diff options
| author | Hilton Chain <hako@ultrarare.space> | 2024-12-11 23:30:51 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2024-12-13 13:07:47 +0800 |
| commit | e81013943d8c2bbab13e078fabe7ea357a0d37b1 (patch) | |
| tree | f8022b6cf37cec7523b2e24ce1afa3ca73d74f86 | |
| parent | 4fe0608a5cc44e3f368dab98709d0ab4392a37ed (diff) | |
nongnu: firefox: Support Guix icecat browser extensions.
* nongnu/packages/patches/firefox-use-system-wide-dir.patch: New file.
* nongnu/packages/mozilla.scm (firefox)[source]: Add it along with
firefox-esr-compare-paths.patch.
| -rw-r--r-- | nongnu/packages/mozilla.scm | 12 | ||||
| -rw-r--r-- | nongnu/packages/patches/firefox-use-system-wide-dir.patch | 37 |
2 files changed, 45 insertions, 4 deletions
diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index d6bc572..9103c0a 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm | |||
| @@ -559,10 +559,14 @@ MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" | |||
| 559 | (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" | 559 | (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" |
| 560 | version "/source/firefox-" version ".source.tar.xz")) | 560 | version "/source/firefox-" version ".source.tar.xz")) |
| 561 | (patches | 561 | (patches |
| 562 | (list (search-path | 562 | (map (lambda (patch) |
| 563 | (map (cut string-append <> "/nongnu/packages/patches") | 563 | (search-path |
| 564 | %load-path) | 564 | (map (cut string-append <> "/nongnu/packages/patches") |
| 565 | "firefox-restore-desktop-files.patch"))) | 565 | %load-path) |
| 566 | patch)) | ||
| 567 | '("firefox-restore-desktop-files.patch" | ||
| 568 | "firefox-esr-compare-paths.patch" | ||
| 569 | "firefox-use-system-wide-dir.patch"))) | ||
| 566 | (sha256 | 570 | (sha256 |
| 567 | (base32 "06ya18ma1gndci0aygz75hidn3kwa1kji78g8smh7fq0091aad7i")))) | 571 | (base32 "06ya18ma1gndci0aygz75hidn3kwa1kji78g8smh7fq0091aad7i")))) |
| 568 | (arguments | 572 | (arguments |
diff --git a/nongnu/packages/patches/firefox-use-system-wide-dir.patch b/nongnu/packages/patches/firefox-use-system-wide-dir.patch new file mode 100644 index 0000000..564f12f --- /dev/null +++ b/nongnu/packages/patches/firefox-use-system-wide-dir.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | Replace "/usr/lib/mozilla" (the system-wide directory for extensions and | ||
| 2 | native manifests) with "$ICECAT_SYSTEM_DIR". | ||
| 3 | |||
| 4 | diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp | ||
| 5 | index e3be04e70c..a3501c4f44 100644 | ||
| 6 | --- a/toolkit/xre/nsXREDirProvider.cpp | ||
| 7 | +++ b/toolkit/xre/nsXREDirProvider.cpp | ||
| 8 | @@ -280,24 +280,11 @@ nsresult nsXREDirProvider::GetBackgroundTasksProfilesRootDir( | ||
| 9 | static nsresult GetSystemParentDirectory(nsIFile** aFile) { | ||
| 10 | nsresult rv; | ||
| 11 | nsCOMPtr<nsIFile> localDir; | ||
| 12 | -# if defined(XP_MACOSX) | ||
| 13 | - rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType, | ||
| 14 | - getter_AddRefs(localDir)); | ||
| 15 | - if (NS_SUCCEEDED(rv)) { | ||
| 16 | - rv = localDir->AppendNative("Mozilla"_ns); | ||
| 17 | - } | ||
| 18 | -# else | ||
| 19 | - constexpr auto dirname = | ||
| 20 | -# ifdef HAVE_USR_LIB64_DIR | ||
| 21 | - "/usr/lib64/mozilla"_ns | ||
| 22 | -# elif defined(__OpenBSD__) || defined(__FreeBSD__) | ||
| 23 | - "/usr/local/lib/mozilla"_ns | ||
| 24 | -# else | ||
| 25 | - "/usr/lib/mozilla"_ns | ||
| 26 | -# endif | ||
| 27 | - ; | ||
| 28 | - rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir)); | ||
| 29 | -# endif | ||
| 30 | + const char* systemParentDir = getenv("ICECAT_SYSTEM_DIR"); | ||
| 31 | + if (!systemParentDir || !*systemParentDir) return NS_ERROR_FAILURE; | ||
| 32 | + | ||
| 33 | + rv = NS_NewNativeLocalFile(nsDependentCString(systemParentDir), | ||
| 34 | + getter_AddRefs(localDir)); | ||
| 35 | |||
| 36 | if (NS_SUCCEEDED(rv)) { | ||
| 37 | localDir.forget(aFile); | ||
