File libgail-no-applet.patch of Package libgail-gnome

commit 2aad6b418764a4783768d7800c43c8a6b9a85cb8
Author: Vincent Untz <vuntz@gnome.org>
Date:   Fri May 27 01:30:49 2011 +0200

    Make libpanel-applet dependency optional
    
    There might be a need for libgail-gnome in GNOME 3, in case there's
    still something using bonobo outside of the panel applets.
    
    To support libgail-gnome in GNOME 3, we need to make the libpanel-applet
    dependency optional.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651200

diff --git a/configure.in b/configure.in
index 1a2b0e2..dbf1a89 100644
--- a/configure.in
+++ b/configure.in
@@ -124,8 +124,11 @@ PKG_CHECK_MODULES([DEPS],[
 	$LIBBONOBO_PACKAGES >= $LIBBONOBO_REQUIRED_VERSION
 	$LIBBONOBOUI_PACKAGES >= $LIBBONOBO_REQUIRED_VERSION
 	$LIBGNOMEUI_PACKAGES >= $LIBGNOMEUI_REQUIRED_VERSION
-	$AT_SPI_PACKAGES >= $AT_SPI_REQUIRED_VERSION
-	$PANEL_APPLET_PACKAGES >= $PANEL_APPLET_REQUIRED_VERSION])
+	$AT_SPI_PACKAGES >= $AT_SPI_REQUIRED_VERSION])
+
+PKG_CHECK_MODULES([PANEL_APPLET],
+		  [$PANEL_APPLET_PACKAGES >= $PANEL_APPLET_REQUIRED_VERSION],
+		  [have_panel_applet=yes], [have_panel_applet=no])
 
 PKG_CHECK_MODULES([TEST],[
 	$ATK_PACKAGES >= $ATK_REQUIRED_VERSION
@@ -134,14 +137,20 @@ PKG_CHECK_MODULES([TEST],[
 	$LIBBONOBOUI_PACKAGES >= $LIBBONOBO_REQUIRED_VERSION
 	$LIBGNOMEUI_PACKAGES >= $LIBGNOMEUI_REQUIRED_VERSION
 	$AT_SPI_PACKAGES >= $AT_SPI_REQUIRED_VERSION
-	$CSPI_PACKAGES >= $CSPI_REQUIRED_VERSION
-	$PANEL_APPLET_PACKAGES >= $PANEL_APPLET_REQUIRED_VERSION])
+	$CSPI_PACKAGES >= $CSPI_REQUIRED_VERSION])
 
 AC_SUBST([DEPS_CFLAGS])
 AC_SUBST([DEPS_LIBS])
+AC_SUBST([PANEL_APPLET_CFLAGS])
+AC_SUBST([PANEL_APPLET_LIBS])
 AC_SUBST([TEST_CFLAGS])
 AC_SUBST([TEST_LIBS])
 
+AM_CONDITIONAL(HAVE_PANEL_APPLET, test "x$have_panel_applet" = "xyes")
+if test "x$have_panel_applet" = "xyes" ; then
+    AC_DEFINE(HAVE_PANEL_APPLET, 1, [Defined if libpanel-applet support is enabled])
+fi
+
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_LDFLAGS])
diff --git a/gail-gnome/Makefile.am b/gail-gnome/Makefile.am
index cacfc86..6242d79 100644
--- a/gail-gnome/Makefile.am
+++ b/gail-gnome/Makefile.am
@@ -8,8 +8,6 @@ gailgnome_c_sources =				\
 	bonobo_plug_atk_object_factory.c 	\
 	bonobo_socket_atk_object.c		\
 	bonobo_socket_atk_object_factory.c	\
-	panel-applet-atk-object-factory.c	\
-	panel-applet-atk-object.c		\
 	bonobo-accessibility-init.c		
 
 gailgnome_private_h_sources =			\
@@ -19,10 +17,18 @@ gailgnome_private_h_sources =			\
 	bonobo_plug_atk_object_factory.h 	\
 	bonobo_socket_atk_object.h		\
 	bonobo_socket_atk_object_factory.h	\
-	panel-applet-atk-object.h		\
-	panel-applet-atk-object-factory.h	\
         gail-gnome-debug.h
 
+if HAVE_PANEL_APPLET
+gailgnome_c_sources +=				\
+	panel-applet-atk-object-factory.c	\
+	panel-applet-atk-object.c
+
+gailgnome_private_h_sources +=			\
+	panel-applet-atk-object.h		\
+	panel-applet-atk-object-factory.h
+endif
+
 gailgnome_public_h_sources =
 
 libgail_gnome_la_SOURCES = 			\
@@ -36,6 +42,7 @@ libgail_gnome_la_CPPFLAGS = \
 
 libgail_gnome_la_CFLAGS = \
 	$(DEPS_CFLAGS)			\
+	$(PANEL_APPLET_CFLAGS)		\
 	$(GAIL_GNOME_DEBUG_CFLAGS)	\
 	$(WARN_CFLAGS)			\
 	$(AM_CFLAGS)
@@ -46,4 +53,5 @@ libgail_gnome_la_LDFLAGS = \
 	$(AM_LDFLAGS)
 
 libgail_gnome_la_LIBADD = \
-        $(DEPS_LIBS)
+        $(DEPS_LIBS)	\
+        $(PANEL_APPLET_LIBS)
diff --git a/gail-gnome/bonobo-accessibility-init.c b/gail-gnome/bonobo-accessibility-init.c
index f3658d0..fe2ba32 100644
--- a/gail-gnome/bonobo-accessibility-init.c
+++ b/gail-gnome/bonobo-accessibility-init.c
@@ -26,13 +26,17 @@
 #include <bonobo/bonobo-control.h>
 #include <bonobo/bonobo-exception.h>
 #include <bonobo/bonobo-control-frame.h>
+#ifdef HAVE_PANEL_APPLET
 #include <panel-applet.h>
+#endif
 #include <libspi/accessible.h>
 #include "bonobo-control-accessible.h"
 #include "bonobo-control-frame-accessible.h"
 #include "bonobo_plug_atk_object_factory.h"
 #include "bonobo_socket_atk_object_factory.h"
+#ifdef HAVE_PANEL_APPLET
 #include "panel-applet-atk-object-factory.h"
+#endif
 #include "gail-gnome-debug.h"
 
 #define GNOME_ACCESSIBILITY_ENV "GNOME_ACCESSIBILITY"
@@ -93,7 +97,9 @@ gail_bonobo_ui_register_atk_factories (void)
   AtkRegistry *registry = atk_get_default_registry ();	
   atk_registry_set_factory_type (registry, BONOBO_TYPE_PLUG, BONOBO_TYPE_PLUG_ATK_OBJECT_FACTORY);
   atk_registry_set_factory_type (registry, BONOBO_TYPE_SOCKET, BONOBO_TYPE_SOCKET_ATK_OBJECT_FACTORY);   
+#ifdef HAVE_PANEL_APPLET
   atk_registry_set_factory_type (registry, PANEL_TYPE_APPLET, PANEL_APPLET_TYPE_ATK_OBJECT_FACTORY);
+#endif
 }
 
 static void
openSUSE Build Service is sponsored by