updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / indicator-session / make-apt-optional.patch
blob25adc2cb0814fb0f6e1b8b6775b2d62d9f246d86
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-11-23 21:48:14.894253690 +0100
3 +++ indicator-session-0.3.7.1/configure.ac 2011-11-23 21:57:07.314976121 +0100
4 @@ -114,6 +114,18 @@
5 AC_SUBST(GTKLOGOUTHELPER_LIBS)
7 ###########################
8 +# APT support
9 +###########################
10 +AC_ARG_ENABLE([apt],
11 + AC_HELP_STRING([--disable-apt], [disable APT support]),,
12 + [enable_apt=yes])
13 +AM_CONDITIONAL([BUILD_APT], [test "x$enable_apt" != "xno"])
15 +if test "x$enable_apt" != "xno"; then
16 + AC_DEFINE(HAVE_APT, 1, [Define to 1 to enable APT support])
17 +fi
19 +###########################
20 # Check to see if we're local
21 ###########################
23 @@ -215,4 +227,5 @@
24 Indicator Dir: $INDICATORDIR
25 Indicator GTK: $with_gtk
26 Logout Helper: $have_gtklogouthelper
27 + APT support: $enable_apt
29 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
30 --- indicator-session-0.3.7.1.orig/src/device-menu-mgr.c 2011-11-23 21:48:14.897586821 +0100
31 +++ indicator-session-0.3.7.1/src/device-menu-mgr.c 2011-11-23 21:44:28.711440915 +0100
32 @@ -27,7 +27,11 @@
33 #include "dbusmenu-shared.h"
34 #include "lock-helper.h"
35 #include "upower-client.h"
37 +#ifdef HAVE_APT
38 #include "apt-watcher.h"
39 +#endif /* HAVE_APT */
41 #include "udev-mgr.h"
43 #define UP_ADDRESS "org.freedesktop.UPower"
44 @@ -41,7 +45,9 @@
45 GObject parent_instance;
46 DbusmenuMenuitem* root_item;
47 SessionDbus* session_dbus_interface;
48 +#ifdef HAVE_APT
49 AptWatcher* apt_watcher;
50 +#endif /* HAVE_APT */
51 UdevMgr* udev_mgr;
54 @@ -51,7 +57,9 @@
55 static DbusmenuMenuitem *system_settings_menuitem = NULL;
56 static DbusmenuMenuitem *display_settings_menuitem = NULL;
57 static DbusmenuMenuitem *login_settings_menuitem = NULL;
58 +#ifdef HAVE_APT
59 static DbusmenuMenuitem *software_updates_menuitem = NULL;
60 +#endif /* HAVE_APT */
61 static DbusmenuMenuitem *printers_menuitem = NULL;
62 static DbusmenuMenuitem *scanners_menuitem = NULL;
63 static DbusmenuMenuitem *webcam_menuitem = NULL;
64 @@ -103,7 +111,9 @@
65 static void
66 device_menu_mgr_init (DeviceMenuMgr *self)
68 +#ifdef HAVE_APT
69 self->apt_watcher = NULL;
70 +#endif /* HAVE_APT */
71 self->root_item = dbusmenu_menuitem_new ();
72 setup_up(self);
73 g_idle_add(lock_screen_setup, NULL);
74 @@ -485,12 +495,14 @@
76 g_warning("Unable to launch simple-scan: %s", error->message);
77 g_error_free(error);
78 +#ifdef HAVE_APT
79 if (!g_spawn_command_line_async("software-center simple-scan", &error))
81 g_warning ("Unable to launch software-centre simple-scan: %s",
82 error->message);
83 g_error_free(error);
85 +#endif /* HAVE_APT */
89 @@ -503,12 +515,14 @@
91 g_warning("Unable to launch cheese: %s", error->message);
92 g_error_free(error);
93 +#ifdef HAVE_APT
94 if (!g_spawn_command_line_async("software-center cheese", &error))
96 g_warning ("Unable to launch software-centre cheese: %s",
97 error->message);
98 g_error_free(error);
100 +#endif /* HAVE_APT */
104 @@ -547,6 +561,7 @@
105 dbusmenu_menuitem_child_add_position(self->root_item,
106 login_settings_menuitem,
108 +#ifdef HAVE_APT
109 software_updates_menuitem = dbusmenu_menuitem_new();
110 dbusmenu_menuitem_property_set (software_updates_menuitem,
111 DBUSMENU_MENUITEM_PROP_LABEL,
112 @@ -554,6 +569,7 @@
113 dbusmenu_menuitem_child_add_position(self->root_item,
114 software_updates_menuitem,
116 +#endif /* HAVE_APT */
118 DbusmenuMenuitem * separator1 = dbusmenu_menuitem_new();
119 dbusmenu_menuitem_property_set (separator1,
120 @@ -787,9 +803,11 @@
121 DeviceMenuMgr* device_mgr = g_object_new (DEVICE_TYPE_MENU_MGR, NULL);
122 device_mgr->session_dbus_interface = session_dbus;
123 device_menu_mgr_build_static_items (device_mgr, greeter_mode);
124 +#ifdef HAVE_APT
125 if (software_updates_menuitem != NULL) {
126 device_mgr->apt_watcher = apt_watcher_new (session_dbus,
127 software_updates_menuitem);
129 +#endif /* HAVE_APT */
130 return device_mgr;
132 diff -Naur indicator-session-0.3.7.1.orig/src/Makefile.am indicator-session-0.3.7.1/src/Makefile.am
133 --- indicator-session-0.3.7.1.orig/src/Makefile.am 2011-11-23 21:48:14.910919336 +0100
134 +++ indicator-session-0.3.7.1/src/Makefile.am 2011-11-23 21:44:28.718107022 +0100
135 @@ -107,13 +107,18 @@
136 user-menu-mgr.c \
137 device-menu-mgr.h \
138 device-menu-mgr.c \
139 - apt-watcher.h \
140 - apt-watcher.c \
141 - apt-transaction.h \
142 - apt-transaction.c \
143 udev-mgr.h \
144 udev-mgr.c \
145 sane-rules.h
147 +if BUILD_APT
148 +indicator_session_service_SOURCES += \
149 + apt-watcher.h \
150 + apt-watcher.c \
151 + apt-transaction.h \
152 + apt-transaction.c
153 +endif
155 indicator_session_service_CFLAGS = \
156 $(SESSIONSERVICE_CFLAGS) \
157 $(GCONF_CFLAGS) \