gtk3: make gtk3 look for immodule cache in $NIX_PROFILE

+29 -7
+27
pkgs/development/libraries/gtk+/3.0-immodules.cache.patch
··· 1 + --- a/gtk/deprecated/gtkrc.c 2016-04-02 18:43:08.401663112 +0900 2 + +++ b/gtk/deprecated/gtkrc.c 2016-04-02 18:29:19.927608592 +0900 3 + @@ -774,5 +774,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-3.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 -7
pkgs/development/libraries/gtk+/3.x.nix
··· 28 28 29 29 nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection perl ]; 30 30 31 + patches = [ ./3.0-immodules.cache.patch ]; 32 + 31 33 buildInputs = [ libxkbcommon epoxy json_glib ]; 32 34 propagatedBuildInputs = with xorg; with stdenv.lib; 33 35 [ expat glib cairo pango gdk_pixbuf atk at_spi2_atk ··· 57 59 substituteInPlace "$out/lib/gtk-3.0/3.0.0/printbackends/libprintbackend-cups.la" \ 58 60 --replace '-L${gmp.dev}/lib' '-L${gmp.out}/lib' 59 61 ''; 60 - 61 - passthru = { 62 - gtkExeEnvPostBuild = '' 63 - rm $out/lib/gtk-3.0/3.0.0/immodules.cache 64 - $out/bin/gtk-query-immodules-3.0 $out/lib/gtk-3.0/3.0.0/immodules/*.so > $out/lib/gtk-3.0/3.0.0/immodules.cache 65 - ''; # workaround for bug of nix-mode for Emacs */ ''; 66 - }; 67 62 68 63 meta = with stdenv.lib; { 69 64 description = "A multi-platform toolkit for creating graphical user interfaces";