summary refs log tree commit diff
path: root/pkgs/desktops/mate/caja/caja-extension-dirs.patch
blob: 0b1453bd46893cb1065b47669ce2a6e07a52f19c (plain) (blame)
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
From 35e9e6a6f3ba6cbe62a3957044eb67864f5d8e66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Tue, 11 Feb 2020 17:49:13 -0300
Subject: [PATCH] Look for caja extentions at $CAJA_EXTENTSION_DIRS

CAJA_EXTENSION_DIRS is a list of paths where caja extensions are
looked for. It is needed for distributions like NixOS that do not
install all extensions in the same directory. In NixOS each package is
installed in a self contained directory.
---
 libcaja-private/caja-module.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libcaja-private/caja-module.c b/libcaja-private/caja-module.c
index d54d7cf..9794e56 100644
--- a/libcaja-private/caja-module.c
+++ b/libcaja-private/caja-module.c
@@ -258,11 +258,25 @@ void
 caja_module_setup (void)
 {
     static gboolean initialized = FALSE;
+    gchar *caja_extension_dirs;
+    gchar **dir_vector;
 
     if (!initialized)
     {
         initialized = TRUE;
 
+        caja_extension_dirs = (gchar *) g_getenv ("CAJA_EXTENSION_DIRS");
+
+        if (caja_extension_dirs)
+        {
+            dir_vector = g_strsplit (caja_extension_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
+
+            for (gchar **dir = dir_vector; *dir != NULL; ++ dir)
+                load_module_dir (*dir);
+
+            g_strfreev(dir_vector);
+        }
+
         load_module_dir (CAJA_EXTENSIONDIR);
 
         eel_debug_call_at_shutdown (free_module_objects);
-- 
2.25.0