$OpenBSD: patch-src_Makefile_am,v 1.8 2013/10/12 14:39:38 ajacoutot Exp $

https://bugzilla.gnome.org/show_bug.cgi?id=669495
http://sources.debian.net/src/gnome-shell/3.8.4-3/debian/patches/10-make-NetworkManager-optional.patch
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/gnome-base/gnome-shell/files/gnome-shell-3.8.3-networkmanager-flag.patch

--- src/Makefile.am.orig	Thu Sep 12 20:09:56 2013
+++ src/Makefile.am	Fri Oct 11 14:05:14 2013
@@ -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			\
@@ -115,6 +114,10 @@ shell_public_headers_h =		\
 	shell-window-tracker.h		\
 	shell-wm.h
 
+if HAVE_NETWORKMANAGER
+shell_public_headers_h +=  shell-network-agent.h
+endif
+
 libgnome_shell_menu_la_SOURCES = 	\
 	gtkactionmuxer.h		\
 	gtkactionmuxer.c		\
@@ -140,7 +143,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	\
@@ -151,6 +153,10 @@ libgnome_shell_base_la_SOURCES = 	\
 	shell-tp-client.c		\
 	$(NULL)
 
+if HAVE_NETWORKMANAGER
+libgnome_shell_base_la_SOURCES +=  shell-network-agent.c
+endif
+
 libgnome_shell_sources =		\
 	$(shell_built_sources)		\
 	$(shell_public_headers_h)	\
@@ -331,7 +337,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
 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
