diff options
author | Eric Sagnes <eric.sagnes@gmail.com> | 2016-04-09 17:43:55 +0900 |
---|---|---|
committer | Eric Sagnes <eric.sagnes@gmail.com> | 2016-04-16 17:51:32 +0900 |
commit | 3e2318ec3ecff70e1583ad5717f26f91ecdda952 (patch) | |
tree | 1092695cbd1ab1c9641f45c5287367d59a7f843d | |
parent | 77c413926230eb4fda6be41f666f5603129bbf73 (diff) | |
download | nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar.gz nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar.bz2 nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar.lz nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar.xz nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.tar.zst nixpkgs-3e2318ec3ecff70e1583ad5717f26f91ecdda952.zip |
gtk2: make gtk2 look for immodule cache in $NIX_PROFILE
-rw-r--r-- | pkgs/development/libraries/gtk+/2.0-immodules.cache.patch | 27 | ||||
-rw-r--r-- | pkgs/development/libraries/gtk+/2.x.nix | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gtk+/2.0-immodules.cache.patch b/pkgs/development/libraries/gtk+/2.0-immodules.cache.patch new file mode 100644 index 00000000000..1b8231756e7 --- /dev/null +++ b/pkgs/development/libraries/gtk+/2.0-immodules.cache.patch @@ -0,0 +1,27 @@ +--- a/gtk/gtkrc.c 2014-09-30 05:02:17.000000000 +0900 ++++ b/gtk/gtkrc.c 2016-04-09 17:39:51.363288355 +0900 +@@ -445,5 +445,23 @@ + if (var) + result = g_strdup (var); + ++ // check NIX_PROFILES paths. ++ const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES"); ++ gchar *cachePath; ++ guint i; ++ ++ if(nixProfilesEnv && !result){ ++ gchar **paths = g_strsplit(nixProfilesEnv, " ", -1); ++ for (i = 0; paths[i] != NULL; i++){ ++ cachePath = g_build_filename(paths[i], "etc", "gtk-2.0", "immodules.cache", NULL); ++ if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){ ++ if(result) g_free(result); ++ result = g_strdup(cachePath); ++ } ++ g_free(cachePath); ++ } ++ g_strfreev(paths); ++ } ++ + if (!result) + { + diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix index d4d4cddb402..f3ebc189cd7 100644 --- a/pkgs/development/libraries/gtk+/2.x.nix +++ b/pkgs/development/libraries/gtk+/2.x.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ setupHook perl pkgconfig gettext ]; + patches = [ ./2.0-immodules.cache.patch ]; + propagatedBuildInputs = with xorg; with stdenv.lib; [ glib cairo pango gdk_pixbuf atk ] ++ optionals (stdenv.isLinux || stdenv.isDarwin) [ |