gtk2: make gtk2 look for immodule cache in $NIX_PROFILE

+29
+27
pkgs/development/libraries/gtk+/2.0-immodules.cache.patch
··· 1 + --- a/gtk/gtkrc.c 2014-09-30 05:02:17.000000000 +0900 2 + +++ b/gtk/gtkrc.c 2016-04-09 17:39:51.363288355 +0900 3 + @@ -445,5 +445,23 @@ 4 + if (var) 5 + result = g_strdup (var); 6 + 7 + + // check NIX_PROFILES paths. 8 + + const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES"); 9 + + gchar *cachePath; 10 + + guint i; 11 + + 12 + + if(nixProfilesEnv && !result){ 13 + + gchar **paths = g_strsplit(nixProfilesEnv, " ", -1); 14 + + for (i = 0; paths[i] != NULL; i++){ 15 + + cachePath = g_build_filename(paths[i], "etc", "gtk-2.0", "immodules.cache", NULL); 16 + + if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){ 17 + + if(result) g_free(result); 18 + + result = g_strdup(cachePath); 19 + + } 20 + + g_free(cachePath); 21 + + } 22 + + g_strfreev(paths); 23 + + } 24 + + 25 + if (!result) 26 + { 27 +
+2
pkgs/development/libraries/gtk+/2.x.nix
··· 26 26 27 27 nativeBuildInputs = [ setupHook perl pkgconfig gettext ]; 28 28 29 + patches = [ ./2.0-immodules.cache.patch ]; 30 + 29 31 propagatedBuildInputs = with xorg; with stdenv.lib; 30 32 [ glib cairo pango gdk_pixbuf atk ] 31 33 ++ optionals (stdenv.isLinux || stdenv.isDarwin) [