1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
From 2ca59eb6e8ca9ba76757ede04e734c743aa21769 Mon Sep 17 00:00:00 2001
From: Gilles Dartiguelongue <eva@gentoo.org>
Date: Tue, 10 Dec 2013 23:37:08 +0100
Subject: [PATCH 3/3] Make networkmanager support optional
* use config.js (and AC_SUBST HAVE_NETWORKMANAGER appropriately);
* take care to not import ui.status.network if nm is disabled;
* do not try to reassign to const variables;
* no point really in fiddling with the list of installed js
* files;
* don't build shell-mobile-providers if nm is disabled;
* use "networkmanager" instead of "network_manager" because THE
BIKESHED SHOULD BE BLUE, also because the upstream package name is
NetworkManager, not Network_Manager.
---
configure.ac | 46 ++++++++++++++++++++++++++++++++++++++++++++--
js/Makefile.am | 1 +
js/misc/config.js.in | 2 ++
js/ui/panel.js | 15 ++++++++++++---
js/ui/sessionMode.js | 7 ++++++-
src/Makefile.am | 12 +++++++++---
6 files changed, 74 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index e749ca6..5044302 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,8 +91,6 @@ SHARED_PCS="gio-unix-2.0 >= $GIO_MIN_VERSION
libcanberra libcanberra-gtk3
telepathy-glib >= $TELEPATHY_GLIB_MIN_VERSION
polkit-agent-1 >= $POLKIT_MIN_VERSION
- libnm-glib libnm-util >= $NETWORKMANAGER_MIN_VERSION
- libnm-gtk >= $NETWORKMANAGER_MIN_VERSION
libsecret-unstable gcr-base-3 >= $GCR_MIN_VERSION"
PKG_CHECK_MODULES(GNOME_SHELL, $SHARED_PCS)
@@ -169,6 +167,38 @@ if test "$langinfo_ok" = "yes"; then
[Define if _NL_TIME_FIRST_WEEKDAY is available])
fi
+AC_ARG_ENABLE(networkmanager,
+ AS_HELP_STRING([--disable-networkmanager],
+ [disable NetworkManager support @<:@default=auto@:>@]),,
+ [enable_networkmanager=auto])
+
+if test "x$enable_networkmanager" != "xno"; then
+ PKG_CHECK_MODULES(NETWORKMANAGER,
+ [libnm-glib
+ libnm-util >= $NETWORKMANAGER_MIN_VERSION
+ libnm-gtk >= $NETWORKMANAGER_MIN_VERSION
+ gnome-keyring-1],
+ [have_networkmanager=yes],
+ [have_networkmanager=no])
+
+ GNOME_SHELL_CFLAGS="$GNOME_SHELL_CFLAGS $NETWORKMANAGER_CFLAGS"
+ GNOME_SHELL_LIBS="$GNOME_SHELL_LIBS $NETWORKMANAGER_LIBS"
+else
+ have_networkmanager="no (disabled)"
+fi
+
+if test "x$have_networkmanager" = "xyes"; then
+ AC_DEFINE(HAVE_NETWORKMANAGER, [1], [Define if we have NetworkManager])
+ AC_SUBST([HAVE_NETWORKMANAGER], [1])
+else
+ if test "x$enable_networkmanager" = "xyes"; then
+ AC_MSG_ERROR([Couldn't find NetworkManager.])
+ fi
+ AC_SUBST([HAVE_NETWORKMANAGER], [0])
+fi
+
+AM_CONDITIONAL(HAVE_NETWORKMANAGER, test "$have_networkmanager" = "yes")
+
# Sets GLIB_GENMARSHAL and GLIB_MKENUMS
AM_PATH_GLIB_2_0()
@@ -210,3 +240,15 @@ AC_CONFIG_FILES([
man/Makefile
])
AC_OUTPUT
+
+echo "
+Build configuration:
+
+ Prefix: ${prefix}
+ Source code location: ${srcdir}
+ Compiler: ${CC}
+ Compiler Warnings: $enable_compile_warnings
+
+ Support for NetworkManager: $have_networkmanager
+ Support for GStreamer recording: $build_recorder
+"
diff --git a/js/Makefile.am b/js/Makefile.am
index d614f4f..88a3887 100644
--- a/js/Makefile.am
+++ b/js/Makefile.am
@@ -8,6 +8,7 @@ misc/config.js: misc/config.js.in Makefile
sed -e "s|[@]PACKAGE_NAME@|$(PACKAGE_NAME)|g" \
-e "s|[@]PACKAGE_VERSION@|$(PACKAGE_VERSION)|g" \
-e "s|[@]HAVE_BLUETOOTH@|$(HAVE_BLUETOOTH)|g" \
+ -e "s|[@]HAVE_NETWORKMANAGER@|$(HAVE_NETWORKMANAGER)|g" \
-e "s|[@]GETTEXT_PACKAGE@|$(GETTEXT_PACKAGE)|g" \
-e "s|[@]datadir@|$(datadir)|g" \
-e "s|[@]libexecdir@|$(libexecdir)|g" \
diff --git a/js/misc/config.js.in b/js/misc/config.js.in
index 9769104..9c4795d 100644
--- a/js/misc/config.js.in
+++ b/js/misc/config.js.in
@@ -6,6 +6,8 @@ const PACKAGE_NAME = '@PACKAGE_NAME@';
const PACKAGE_VERSION = '@PACKAGE_VERSION@';
/* 1 if gnome-bluetooth is available, 0 otherwise */
const HAVE_BLUETOOTH = @HAVE_BLUETOOTH@;
+/* 1 if networkmanager is available, 0 otherwise */
+const HAVE_NETWORKMANAGER = @HAVE_NETWORKMANAGER@;
/* gettext package */
const GETTEXT_PACKAGE = '@GETTEXT_PACKAGE@';
/* locale dir */
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 2337a63..17e4f10 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -809,7 +809,12 @@ const AggregateMenu = new Lang.Class({
this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' });
this.actor.add_child(this._indicators);
- this._network = new imports.ui.status.network.NMApplet();
+ if (Config.HAVE_NETWORKMANAGER) {
+ this._network = new imports.ui.status.network.NMApplet();
+ } else {
+ this._network = null;
+ }
+
if (Config.HAVE_BLUETOOTH) {
this._bluetooth = new imports.ui.status.bluetooth.Indicator();
} else {
@@ -824,7 +829,9 @@ const AggregateMenu = new Lang.Class({
this._screencast = new imports.ui.status.screencast.Indicator();
this._indicators.add_child(this._screencast.indicators);
- this._indicators.add_child(this._network.indicators);
+ if (this._network) {
+ this._indicators.add_child(this._network.indicators);
+ }
if (this._bluetooth) {
this._indicators.add_child(this._bluetooth.indicators);
}
@@ -836,7 +843,9 @@ const AggregateMenu = new Lang.Class({
this.menu.addMenuItem(this._volume.menu);
this.menu.addMenuItem(this._brightness.menu);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- this.menu.addMenuItem(this._network.menu);
+ if (this._network) {
+ this.menu.addMenuItem(this._network.menu);
+ }
if (this._bluetooth) {
this.menu.addMenuItem(this._bluetooth.menu);
}
diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js
index eb04c62..b882364 100644
--- a/js/ui/sessionMode.js
+++ b/js/ui/sessionMode.js
@@ -10,6 +10,8 @@ const FileUtils = imports.misc.fileUtils;
const Main = imports.ui.main;
const Params = imports.misc.params;
+const Config = imports.misc.config;
+
const DEFAULT_MODE = 'restrictive';
const _modes = {
@@ -92,7 +94,10 @@ const _modes = {
isLocked: false,
isPrimary: true,
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
- components: ['networkAgent', 'polkitAgent', 'telepathyClient',
+ components: Config.HAVE_NETWORKMANAGER ?
+ ['networkAgent', 'polkitAgent', 'telepathyClient',
+ 'keyring', 'autorunManager', 'automountManager'] :
+ ['polkitAgent', 'telepathyClient',
'keyring', 'autorunManager', 'automountManager'],
panel: {
left: ['activities', 'appMenu'],
diff --git a/src/Makefile.am b/src/Makefile.am
index 8041052..b5da6aa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -103,7 +103,6 @@ shell_public_headers_h = \
shell-invert-lightness-effect.h \
shell-keybinding-modes.h \
shell-mount-operation.h \
- shell-network-agent.h \
shell-perf-log.h \
shell-screenshot.h \
shell-slicer.h \
@@ -140,7 +139,6 @@ libgnome_shell_base_la_SOURCES = \
shell-menu-tracker.c \
shell-menu-tracker.h \
shell-mount-operation.c \
- shell-network-agent.c \
shell-perf-log.c \
shell-polkit-authentication-agent.h \
shell-polkit-authentication-agent.c \
@@ -175,6 +173,11 @@ libgnome_shell_sources = \
libgnome_shell_la_SOURCES = $(libgnome_shell_sources)
+if HAVE_NETWORKMANAGER
+libgnome_shell_la_SOURCES += shell-network-agent.c
+shell_public_headers_h += shell-network-agent.h
+endif
+
libgnome_shell_la_gir_sources = \
$(filter-out %-private.h $(shell_private_sources), $(shell_public_headers_h) $(libgnome_shell_base_la_SOURCES) $(libgnome_shell_sources))
@@ -331,7 +334,10 @@ INTROSPECTION_GIRS += ShellMenu-0.1.gir
CLEANFILES += ShellMenu-0.1.gir
Shell-0.1.gir: gnome-shell St-1.0.gir ShellMenu-0.1.gir
-Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 Soup-2.4 GMenu-3.0 NetworkManager-1.0 NMClient-1.0
+Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-3.0 TelepathyGLib-0.12 Soup-2.4 GMenu-3.0
+if HAVE_NETWORKMANAGER
+Shell_0_1_gir_INCLUDES += NetworkManager-1.0 NMClient-1.0
+endif HAVE_NETWORKMANAGER
Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir)
# Hack! we use PROGRAM instead of LIBS so that the soname is not included
# in the typelib. This way the symbols will be resolved with the libgnome-shell
--
1.8.5.1
|