all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob f2fe4260c2cdf1f64102cc4e65250b60548fea18 2183 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
41
42
43
44
45
46
47
48
49
50
51
52
 
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -415,13 +415,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)
@@ -1198,6 +1192,24 @@ nsresult nsXREDirProvider::SetUserDataProfileDirectory(nsCOMPtr<nsIFile>& aFile,
   return NS_OK;
 }
 
+nsresult nsXREDirProvider::GetGuixExtensionDir(nsIFile** aFile) {
+  nsresult rv;
+  nsCOMPtr<nsIFile> localDir;
+
+#if defined(XP_UNIX)
+  const char* extensionDir = getenv("ICECAT_EXTENSION_DIR");
+  if (!extensionDir || !*extensionDir) return NS_ERROR_FAILURE;
+
+  rv = NS_NewNativeLocalFile(nsDependentCString(extensionDir), true,
+                             getter_AddRefs(localDir));
+#else
+#  error "Don't know how to get product dir on your platform"
+#endif
+
+  NS_IF_ADDREF(*aFile = localDir);
+  return rv;
+}
+
 nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
                                                     bool aLocal) {
   // Copied from nsAppFileLocationProvider (more or less)
--- a/toolkit/xre/nsXREDirProvider.h
+++ b/toolkit/xre/nsXREDirProvider.h
@@ -112,6 +112,7 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
  private:
   nsresult GetFilesInternal(const char* aProperty,
                             nsISimpleEnumerator** aResult);
+  static nsresult GetGuixExtensionDir(nsIFile** aFile);
   static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal);
   static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile);
 #if defined(XP_UNIX) || defined(XP_MACOSX)

debug log:

solving f2fe4260c2cd ...
found f2fe4260c2cd in https://yhetil.org/guix/43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org/

applying [1/1] https://yhetil.org/guix/43b86867b651d877c805d7e5963b42319606e0d1.1697027198.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..f2fe4260c2cd

1:27: 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 f2fe4260c2cdf1f64102cc4e65250b60548fea18	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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.