gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / patches / gtk2-respect-GUIX_GTK2_PATH.patch
1 This patch makes GTK+ look for additional modules in a list of directories
2 specified by the environment variable "GUIX_GTK2_PATH". This can be used
3 instead of "GTK_PATH" to make GTK+ find modules that are incompatible with
4 other major versions of GTK+.
5
6 --- a/gtk/gtkmodules.c 2014-09-29 22:02:17.000000000 +0200
7 +++ b/gtk/gtkmodules.c 2015-12-02 18:41:53.306396938 +0100
8 @@ -55,6 +55,7 @@
9 get_module_path (void)
10 {
11 const gchar *module_path_env;
12 + const gchar *module_guix_gtk2_path_env;
13 const gchar *exe_prefix;
14 const gchar *home_dir;
15 gchar *home_gtk_dir = NULL;
16 @@ -70,6 +71,7 @@
17 home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL);
18
19 module_path_env = g_getenv ("GTK_PATH");
20 + module_guix_gtk2_path_env = g_getenv ("GUIX_GTK2_PATH");
21 exe_prefix = g_getenv ("GTK_EXE_PREFIX");
22
23 if (exe_prefix)
24 @@ -77,9 +79,21 @@
25 else
26 default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL);
27
28 - if (module_path_env && home_gtk_dir)
29 + if (module_guix_gtk2_path_env && module_path_env && home_gtk_dir)
30 + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
31 + module_guix_gtk2_path_env, module_path_env, home_gtk_dir, default_dir, NULL);
32 + else if (module_guix_gtk2_path_env && home_gtk_dir)
33 + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
34 + module_guix_gtk2_path_env, home_gtk_dir, default_dir, NULL);
35 + else if (module_guix_gtk2_path_env && module_path_env)
36 + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
37 + module_guix_gtk2_path_env, module_path_env, default_dir, NULL);
38 + else if (module_path_env && home_gtk_dir)
39 module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
40 module_path_env, home_gtk_dir, default_dir, NULL);
41 + else if (module_guix_gtk2_path_env)
42 + module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
43 + module_guix_gtk2_path_env, default_dir, NULL);
44 else if (module_path_env)
45 module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
46 module_path_env, default_dir, NULL);