updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / indicator-session / make-gtklogouthelper-optional.patch
blob1a6c5912fd6eb8c0bb413de49d7c3107249a662f
1 diff -Naur indicator-session-0.3.7.1.orig/configure.ac indicator-session-0.3.7.1/configure.ac
2 --- indicator-session-0.3.7.1.orig/configure.ac 2011-10-28 17:25:05.000000000 +0200
3 +++ indicator-session-0.3.7.1/configure.ac 2011-11-23 21:27:59.888673086 +0100
4 @@ -77,16 +77,38 @@
5 AC_SUBST(SESSIONERVICE_CFLAGS)
6 AC_SUBST(SESSIONERVICE_LIBS)
8 -AS_IF([test "x$with_gtk" = x3],
9 - [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
10 - polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION)
11 - ],
12 - [test "x$with_gtk" = x2],
13 - [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION
14 - polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION)
15 - ]
17 +###########################
18 +# GTK Logout Helper
19 +###########################
21 +AC_ARG_ENABLE([gtklogouthelper],
22 + AS_HELP_STRING([--enable-gtklogouthelper], [enable GTK Logout Helper]),,
23 + enable_gtklogouthelper=auto)
25 +if test x"$enable_gtklogouthelper" != x"no" ; then
26 + AS_IF([test "x$with_gtk" = x3],
27 + [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
28 + polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
29 + [have_gtklogouthelper=yes],
30 + [have_gtklogouthelper=no])
31 + ],
32 + [test "x$with_gtk" = x2],
33 + [PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION
34 + polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
35 + [have_gtklogouthelper=yes],
36 + [have_gtklogouthelper=no])
37 + ]
38 + )
39 + if test x${have_gtklogouthelper} = xyes; then
40 + AC_DEFINE(HAVE_GTKLOGOUTHELPER, 1, [Define to 1 to enable GTK Logout Helper])
41 + fi
42 + if test x${enable_gtklogouthelper} = xyes && test x${have_gtklogouthelper} = xno; then
43 + AC_MSG_ERROR([GTK Logout Helper configured but polkit-gobject not found])
44 + fi
45 +else
46 + have_gtklogouthelper=no
47 +fi
48 +AM_CONDITIONAL(BUILD_GTKLOGOUTHELPER, test x${have_gtklogouthelper} = xyes)
50 AC_SUBST(GTKLOGOUTHELPER_CFLAGS)
51 AC_SUBST(GTKLOGOUTHELPER_LIBS)
52 @@ -192,4 +214,5 @@
53 Prefix: $prefix
54 Indicator Dir: $INDICATORDIR
55 Indicator GTK: $with_gtk
56 + Logout Helper: $have_gtklogouthelper
58 diff -Naur indicator-session-0.3.7.1.orig/data/Makefile.am indicator-session-0.3.7.1/data/Makefile.am
59 --- indicator-session-0.3.7.1.orig/data/Makefile.am 2011-09-06 19:15:12.000000000 +0200
60 +++ indicator-session-0.3.7.1/data/Makefile.am 2011-11-23 21:19:08.967858785 +0100
61 @@ -18,6 +18,15 @@
62 convertdir = $(datadir)/GConf/gsettings
63 dist_convert_DATA = indicator-session.convert
65 +EXTRA_DIST = \
66 + $(service_in_files) \
67 + $(gsettings_SCHEMAS:.xml=.xml.in)
69 +CLEANFILES = \
70 + $(dbus_services_DATA) \
71 + $(gsettings_SCHEMAS)
73 +if BUILD_GTKLOGOUTHELPER
74 @INTLTOOL_DESKTOP_RULE@
76 %.desktop.in: %.desktop.in.in
77 @@ -37,14 +46,9 @@
78 $(logout_helper_desktop_in_in_files:.desktop.in.in=.desktop)
79 logout_helper_DATA = $(logout_helper_desktop_files)
81 -EXTRA_DIST = \
82 - $(service_in_files) \
83 - $(gsettings_SCHEMAS:.xml=.xml.in) \
84 +EXTRA_DIST += \
85 $(logout_helper_desktop_in_in_files)
88 -CLEANFILES = \
89 - $(dbus_services_DATA) \
90 - $(gsettings_SCHEMAS) \
91 +CLEANFILES += \
92 $(logout_helper_desktop_files)
94 +endif
95 diff -Naur indicator-session-0.3.7.1.orig/src/device-menu-mgr.c indicator-session-0.3.7.1/src/device-menu-mgr.c
96 --- indicator-session-0.3.7.1.orig/src/device-menu-mgr.c 2011-09-06 19:15:12.000000000 +0200
97 +++ indicator-session-0.3.7.1/src/device-menu-mgr.c 2011-11-23 21:19:08.974525045 +0100
98 @@ -17,6 +17,7 @@
99 with this program. If not, see <http://www.gnu.org/licenses/>.
102 +#include <config.h>
103 #include <libdbusmenu-glib/client.h>
104 #include <libdbusmenu-gtk3/menuitem.h>
106 @@ -410,7 +411,11 @@
107 show_dialog (DbusmenuMenuitem * mi, guint timestamp, gchar * type)
110 +#ifdef HAVE_GTKLOGOUTHELPER
111 gchar * helper = g_build_filename(LIBEXECDIR, "gtk-logout-helper", NULL);
112 +#else
113 + gchar * helper = g_build_filename("gnome-session-quit", NULL);
114 +#endif /* HAVE_GTKLOGOUTHELPER */
115 gchar * dialog_line = g_strdup_printf("%s --%s", helper, type);
116 g_free(helper);
118 @@ -726,7 +731,11 @@
119 dbusmenu_menuitem_child_append (self->root_item, shutdown_mi);
120 g_signal_connect (G_OBJECT(shutdown_mi),
121 DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
122 +#ifdef HAVE_GTKLOGOUTHELPER
123 G_CALLBACK(show_dialog), "shutdown");
124 +#else
125 + G_CALLBACK(show_dialog), "power-off");
126 +#endif /* HAVE_GTKLOGOUTHELPER */
128 RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = g_new0 (RestartShutdownLogoutMenuItems, 1);
129 restart_shutdown_logout_mi->logout_mi = logout_mi;
130 diff -Naur indicator-session-0.3.7.1.orig/src/Makefile.am indicator-session-0.3.7.1/src/Makefile.am
131 --- indicator-session-0.3.7.1.orig/src/Makefile.am 2011-09-06 19:15:12.000000000 +0200
132 +++ indicator-session-0.3.7.1/src/Makefile.am 2011-11-23 21:19:08.977858174 +0100
133 @@ -1,7 +1,11 @@
135 libexec_PROGRAMS = \
136 - indicator-session-service \
137 + indicator-session-service
139 +if BUILD_GTKLOGOUTHELPER
140 +libexec_PROGRAMS += \
141 gtk-logout-helper
142 +endif
144 ###################
145 # Indicator Stuff
146 @@ -124,6 +128,7 @@
147 # GTK Logout Stuff
148 #################
150 +if BUILD_GTKLOGOUTHELPER
151 gtk_logout_helper_SOURCES = \
152 gtk-logout-helper.c \
153 settings-helper.c \
154 @@ -142,6 +147,7 @@
155 $(SESSIONSERVICE_LIBS) \
156 $(GTKLOGOUTHELPER_LIBS) \
157 $(GCONF_LIBS)
158 +endif
161 ###############