ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / gn / gnome-panel / modulesdir-env-var.patch
blob40638bf123d2a54fd0f209cabcbfc8c4a834f1f8
1 diff --git a/gnome-panel/gp-module-manager.c b/gnome-panel/gp-module-manager.c
2 index 58447fd84..7af99de7d 100644
3 --- a/gnome-panel/gp-module-manager.c
4 +++ b/gnome-panel/gp-module-manager.c
5 @@ -49,8 +49,16 @@ load_modules (GpModuleManager *self)
7 GDir *dir;
8 const gchar *name;
9 + const gchar *modules_dir;
11 - dir = g_dir_open (MODULESDIR, 0, NULL);
12 + modules_dir = g_getenv ("NIX_GNOME_PANEL_MODULESDIR");
14 + if (!modules_dir) {
15 + g_warning ("The NIX_GNOME_PANEL_MODULESDIR environment variable was not set, modules will not be loaded.");
16 + return;
17 + }
19 + dir = g_dir_open (modules_dir, 0, NULL);
20 if (!dir)
21 return;
23 @@ -63,7 +71,7 @@ load_modules (GpModuleManager *self)
24 if (!g_str_has_suffix (name, ".so"))
25 continue;
27 - path = g_build_filename (MODULESDIR, name, NULL);
28 + path = g_build_filename (modules_dir, name, NULL);
29 module = gp_module_new_from_path (path);
30 g_free (path);