From dbc3860cebfd52137809e543b08245e878fb636a Mon Sep 17 00:00:00 2001 From: Jookia <166291@gmail.com> Date: Wed, 6 Apr 2016 21:00:58 +0800 Subject: gnu: gtk+-2: Look in system data dirs for themes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/gtk2-theme-paths.patch: New patch. * gnu/packages/gtk.scm (gtk+-2)[source]: Use it. * gnu-system.am (dist_patch_DATA): Add it. Signed-off-by: 宋文武 --- gnu/packages/gtk.scm | 3 ++- gnu/packages/patches/gtk2-theme-paths.patch | 41 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gtk2-theme-paths.patch (limited to 'gnu/packages') diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 23e015eace..f31a510504 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -557,7 +557,8 @@ (define-public gtk+-2 (sha256 (base32 "0l6aqk86aw5w132ygy6hv6nlxvd1h6xg7c85qbm60p6mnv1ww58d")) - (patches (search-patches "gtk2-respect-GUIX_GTK2_PATH.patch")))) + (patches (search-patches "gtk2-respect-GUIX_GTK2_PATH.patch" + "gtk2-theme-paths.patch")))) (build-system gnu-build-system) (outputs '("out" "doc")) (propagated-inputs diff --git a/gnu/packages/patches/gtk2-theme-paths.patch b/gnu/packages/patches/gtk2-theme-paths.patch new file mode 100644 index 0000000000..6c1351e516 --- /dev/null +++ b/gnu/packages/patches/gtk2-theme-paths.patch @@ -0,0 +1,41 @@ +From: Jookia <166291@gmail.com> +Subject: [PATCHv2] gtk: Patch GTK+ to look for themes in profiles. +To: guix-devel@gnu.org +Date: Sun, 13 Mar 2016 15:17:37 +1100 +Url: https://lists.gnu.org/archive/html/guix-devel/2016-03/msg00492.html + +diff -Naur gtk+-2.24.28.new/gtk/gtkrc.c gtk+-2.24.28/gtk/gtkrc.c +--- gtk+-2.24.28.new/gtk/gtkrc.c 2016-03-13 10:31:14.413644362 +1100 ++++ gtk+-2.24.28/gtk/gtkrc.c 2016-03-13 12:51:34.723398423 +1100 +@@ -808,6 +808,8 @@ + gchar *path = NULL; + const gchar *home_dir; + gchar *subpath; ++ const gchar * const *xdg_data_dirs; ++ gint i; + + if (type) + subpath = g_strconcat ("gtk-2.0-", type, +@@ -830,6 +832,22 @@ + } + + if (!path) ++ { ++ xdg_data_dirs = g_get_system_data_dirs (); ++ for (i = 0; xdg_data_dirs[i]; i++) ++ { ++ path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL); ++ if (g_file_test (path, G_FILE_TEST_EXISTS)) ++ break; ++ else ++ { ++ g_free (path); ++ path = NULL; ++ } ++ } ++ } ++ ++ if (!path) + { + gchar *theme_dir = gtk_rc_get_theme_dir (); + path = g_build_filename (theme_dir, name, subpath, NULL); -- cgit v1.2.3