Add the autofoo needed to choose GTK+ status icon or app-indicator

Passing 'enable-appindicator=yes' to the configure script the GTK+ status icon will be disabled.
This commit is contained in:
Francesco Marella
2010-06-04 12:42:31 +02:00
parent 103c52c06c
commit a5b9ff65c4
4 changed files with 49 additions and 5 deletions
+24
View File
@@ -121,6 +121,27 @@ AS_IF([test "x$enable_gnome_clock" != xno], [
])
AM_CONDITIONAL([ENABLE_GNOME_CLOCK], [test "x$enable_gnome_clock" != xno])
# Check for application indicator
AC_MSG_CHECKING([whether to enable application indicator])
AC_ARG_ENABLE([appindicator], [AC_HELP_STRING([--enable-appindicator],
[enable application indicator])],
[enable_appindicator=$enableval],[enable_appindicator=no])
AS_IF([test "x$enable_appindicator" != xno], [
AS_IF([test $have_python = yes], [
AC_MSG_RESULT([yes])
enable_gtk=no
], [
AC_MSG_RESULT([missing dependencies])
AS_IF([test "x$enable_appindicator" = xyes], [
AC_MSG_ERROR([application indicator script requires Python 2.6])
])
enable_appindicator=no
])
], [
AC_MSG_RESULT([no])
])
AM_CONDITIONAL([ENABLE_APPINDICATOR], [test "x$enable_appindicator" != xno])
# Check for GTK+ status icon
AC_MSG_CHECKING([whether to enable GTK status icon])
AC_ARG_ENABLE([gtk], [AC_HELP_STRING([--enable-gtk],
@@ -168,4 +189,7 @@ echo "
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
gtk status icon: ${enable_gtk}
application indicator: ${enable_appindicator}
"
+22 -2
View File
@@ -1,5 +1,6 @@
if ENABLE_GTK
module=statusicon
gtk_redshift_PYTHON = \
__init__.py \
statusicon.py
@@ -8,12 +9,31 @@ nodist_gtk_redshift_PYTHON = \
gtk_redshiftdir = $(pythondir)/gtk_redshift
dist_bin_SCRIPTS = gtk-redshift
EXTRA_DIST = defs.py.in
EXTRA_DIST = gtk-redshift.in \
defs.py.in
endif
CLEANFILES = defs.py
if ENABLE_APPINDICATOR
module=rsappindicator
gtk_redshift_PYTHON = \
__init__.py \
rsappindicator.py
nodist_gtk_redshift_PYTHON = \
defs.py
gtk_redshiftdir = $(pythondir)/gtk_redshift
dist_bin_SCRIPTS = gtk-redshift
EXTRA_DIST = gtk-redshift.in \
defs.py.in
endif
CLEANFILES = defs.py \
gtk-redshift
# Local python definitions
gtk-redshift: gtk-redshift.in
sed -e "s|\@module\@|$(module)|g" $< > $@
defs.py: defs.py.in
sed -e "s|\@bindir\@|$(bindir)|g" \
-e "s|\@localedir\@|$(localedir)|g" $< > $@
@@ -19,5 +19,5 @@
if __name__ == '__main__':
from gtk_redshift.statusicon import run_statusicon
run_statusicon()
from gtk_redshift.@module@ import run
run()
+1 -1
View File
@@ -30,7 +30,7 @@ import gtk, glib
import defs
def run_statusicon():
def run():
# Internationalisation
gettext.bindtextdomain('redshift', defs.LOCALEDIR)
gettext.textdomain('redshift')