unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob ed1ce922d55bdf9efe748526dc95865f05a33dd5 1464 bytes (raw)
name: gnu/packages/patches/icecat-use-guix-extensions.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -281,6 +281,22 @@ nsresult nsXREDirProvider::GetBackgroundTasksProfilesRootDir(
 }
 #endif
 
+static nsresult GetGuixExtensionDir(nsIFile** aFile) {
+  nsresult rv;
+  nsCOMPtr<nsIFile> localDir;
+
+  const char* extensionDir = getenv("ICECAT_EXTENSION_DIR");
+  if (!extensionDir || !*extensionDir) return NS_ERROR_FAILURE;
+
+  rv = NS_NewNativeLocalFile(nsDependentCString(extensionDir), true,
+                             getter_AddRefs(localDir));
+
+  if (NS_SUCCEEDED(rv)) {
+    localDir.forget(aFile);
+  }
+  return rv;
+}
+
 #if defined(XP_UNIX) || defined(XP_MACOSX)
 /**
  * Get the directory that is the parent of the system-wide directories
@@ -415,13 +431,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent,
 #if defined(XP_UNIX) && !defined(XP_MACOSX)
   else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) {
 #  ifdef ENABLE_SYSTEM_EXTENSION_DIRS
-#    if defined(__OpenBSD__) || defined(__FreeBSD__)
-    static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions";
-#    else
-    static const char* const sysLExtDir = "/usr/share/mozilla/extensions";
-#    endif
-    rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false,
-                               getter_AddRefs(file));
+    rv = ::GetGuixExtensionDir(getter_AddRefs(file));
 #  endif
   }
 #endif  // defined(XP_UNIX) && !defined(XP_MACOSX)

debug log:

solving ed1ce922d55b ...
found ed1ce922d55b in https://yhetil.org/guix-patches/4df560c46b4d4512cabcce18b8d3a38d2f2730bc.1697546935.git.clement@lassieur.org/

applying [1/1] https://yhetil.org/guix-patches/4df560c46b4d4512cabcce18b8d3a38d2f2730bc.1697546935.git.clement@lassieur.org/
diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/packages/patches/icecat-use-guix-extensions.patch
new file mode 100644
index 000000000000..ed1ce922d55b

1:12: trailing whitespace.
 
Checking patch gnu/packages/patches/icecat-use-guix-extensions.patch...
Applied patch gnu/packages/patches/icecat-use-guix-extensions.patch cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 ed1ce922d55bdf9efe748526dc95865f05a33dd5	gnu/packages/patches/icecat-use-guix-extensions.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).