[ontv] Make gnome applet frontend optional



commit 017fe24b0997534876ad87aa3661da4acc323104
Author: Olof Kindgren <olki src gnome org>
Date:   Mon Sep 6 18:47:31 2010 +0200

    Make gnome applet frontend optional
    
    The gnome applet is disabled by default but can be enabled by passing
    --enable-gnome-applet to configure. This will be default until the
    applet is ported to the new DBus applet infrastructure.
    Also note that an empty libexec dir is still installed if the applet
    is disabled. Patches are welcome

 bin/Makefile.am  |   14 ++++++++++----
 configure.ac     |   11 ++++++++++-
 data/Makefile.am |   11 +++++++++--
 ontv/Makefile.am |    5 ++++-
 4 files changed, 33 insertions(+), 8 deletions(-)
---
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 6fd7ddc..01bc1ca 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,15 +1,21 @@
-dist_libexec_SCRIPTS = ontv-applet
-dist_bin_SCRIPTS = ontv ontv-dbus
-
+if GNOME_APPLET
 ontv_applet_in_file = ontv-applet.in
-ontv_in_file = ontv.in
+dist_libexec_SCRIPTS = ontv-applet
 
 $(dist_libexec_SCRIPTS): $(ontv_applet_in_file)
 	sed -e "s|\ PYTHONDIR\@|$(pythondir)|" < $< > $@
 	chmod a+x $(dist_libexec_SCRIPTS)
 
+endif
+
+dist_bin_SCRIPTS = ontv ontv-dbus
+
+ontv_in_file = ontv.in
+
 ontv: $(ontv_in_file)
 	sed -e "s|\ PYTHONDIR\@|$(pythondir)|" < $< > $@
 
+if GNOME_APPLET
 DISTCLEANFILES = $(dist_libexec_SCRIPTS)
+endif
 EXTRA_DIST = $(ontv_in_file) $(ontv_applet_in_file)
diff --git a/configure.ac b/configure.ac
index 402244f..30ebb9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,9 +52,18 @@ PKG_CHECK_MODULES(ONTV,
 	gtk+-2.0 >= 2.10.0
 	pygtk-2.0 >= 2.10.0
 	pygobject-2.0 >= 2.12.0
-	gnome-python-2.0 >= 2.16.0
 	notify-python >= 0.1.1)
 
+AC_ARG_ENABLE([gnome-applet],
+  AS_HELP_STRING([--enable-gnome-applet], [Build applet for gnome panel]),
+  [gnome_applet_enable="${enableval}"],
+  [gnome_applet_enable="no"])
+
+AS_IF([test "x$gnome_applet_enable" = "xyes"], [
+PKG_CHECK_MODULES([GNOME_PYTHON], [gnome-python-2.0 >= 2.16.0])
+])
+AM_CONDITIONAL(GNOME_APPLET, [test "x$gnome_applet_enable" = "xyes"])
+
 AC_MSG_CHECKING([for vte module])
 if AC_RUN_LOG([$PYTHON -c '
 try:
diff --git a/data/Makefile.am b/data/Makefile.am
index 863c4a4..e0613b4 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -16,14 +16,18 @@ install-data-local:
 	$(GCONFTOOL) --makefile-install-rule $(schema_DATA)
 endif
 
+if GNOME_APPLET
 serverdir       = $(libdir)/bonobo/servers
-server_in_files = GNOME_OnTVApplet.server.in
+applet_server_files = GNOME_OnTVApplet.server.in
+server_in_files = $(applet_server_files)
 server_DATA     = $(server_in_files:.server.in=.server)
 
 $(server_in_files): $(server_in_files:.server.in=.server.in.in)
 	sed -e "s|\ LIBEXECDIR\@|$(libexecdir)|"	\
 	    -e "s|\ DATADIR\@|$(datadir)|" < $< > $@
 
+endif
+
 @INTLTOOL_SERVER_RULE@
 
 gladedir   = $(datadir)/ontv
@@ -35,8 +39,11 @@ glade_DATA = 		      \
 	preferences_dialog.ui \
 	status_icon.ui
 
+if GNOME_APPLET
 uidir   = $(datadir)/gnome-2.0/ui
-ui_DATA = GNOME_OnTVApplet.xml
+gnome_ui_files = GNOME_OnTVApplet.xml
+ui_DATA = $(gnome_ui_files)
+endif
 
 $(schema_in_files): $(schema_in_files:.schemas.in=.schemas.in.in)
 	sed -e "s|\ BINDIR\@|$(bindir)|" < $< > $@
diff --git a/ontv/Makefile.am b/ontv/Makefile.am
index d7fa1d3..033724f 100644
--- a/ontv/Makefile.am
+++ b/ontv/Makefile.am
@@ -1,7 +1,10 @@
 ontvdir = $(pythondir)/ontv
 
+if GNOME_APPLET
+gnome_applet_files = applet.py
+endif
 ontv_PYTHON =			\
-	applet.py		\
+	$(gnome_applet_files)	\
 	assistant.py		\
 	channel.py		\
 	config.py		\



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]