Skip to content

Commit

Permalink
typing-break: Force dependency on appindicator and remove deprecated …
Browse files Browse the repository at this point in the history
…GtkStatusIcon
  • Loading branch information
zhuyaliang authored and raveit65 committed Oct 24, 2023
1 parent f27d27e commit 1a837cc
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 332 deletions.
2 changes: 2 additions & 0 deletions .build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ requires:
- intltool
- libcanberra-gtk3-dev
- libdconf-dev
- libayatana-appindicator3-dev
- libglib2.0-dev
- libgtk-3-dev
- libgtop2-dev
Expand Down Expand Up @@ -83,6 +84,7 @@ requires:
- gtk3-devel
- iso-codes-devel
- itstool
- libappindicator-gtk3-devel
- libSM-devel
- libXScrnSaver-devel
- libcanberra-devel
Expand Down
50 changes: 24 additions & 26 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,6 @@ AM_CONDITIONAL(HAVE_LIBCANBERRA_GTK, test "x$CANBERRA_GTK" = "x1")

AM_CONDITIONAL(HAVE_TYPING_BREAK, test "x$TYPING_BREAK" = xtyping-break)

dnl app indicator
APPINDICATOR_PKG=appindicator3-0.1

AC_ARG_ENABLE(appindicator,
AS_HELP_STRING([--enable-appindicator[=@<:@no/auto/yes@:>@]],[Build support for application indicators ]),
[enable_appindicator=$enableval],
[enable_appindicator="auto"])

if test x$enable_appindicator = xauto ; then
PKG_CHECK_EXISTS([$APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
enable_appindicator="yes",
enable_appindicator="no")
fi

if test x$enable_appindicator = xyes ; then
PKG_CHECK_EXISTS([$APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],,
AC_MSG_ERROR([appindicator-0.1 is not installed]))
PKG_CHECK_MODULES(APP_INDICATOR,
$APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED)
AC_SUBST(APP_INDICATOR_CFLAGS)
AC_SUBST(APP_INDICATOR_LIBS)
AC_DEFINE(HAVE_APP_INDICATOR, 1, [Have AppIndicator])
fi
AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)

dnl keyboard-properties-capplet
savecppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
Expand Down Expand Up @@ -193,6 +168,27 @@ fi

AM_CONDITIONAL([HAVE_ACCOUNTSSERVICE], [test "x$have_accountsservice" = xyes])

AYATANA_APPINDICATOR_PKG=ayatana-appindicator3-0.1
UBUNTU_APPINDICATOR_PKG=appindicator3-0.1

AC_ARG_ENABLE([libappindicator],
[AS_HELP_STRING([--enable-libappindicator[=@<:@no/auto/yes@:>@]],[Use libappindicator instead of ayatana-indicator @<:@default=auto@:>@])],
[enable_appindicator=$enableval],
[PKG_CHECK_EXISTS([$AYATANA_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
[enable_appindicator=no],
[PKG_CHECK_EXISTS([$UBUNTU_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
[enable_appindicator=yes],
[enable_appindicator=no])])])

AS_IF([test "x$enable_appindicator" = xyes],
[AC_MSG_NOTICE([Buidling against Ubuntu AppIndicator.])
PKG_CHECK_MODULES([APPINDICATOR],
[$UBUNTU_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
[AC_DEFINE(HAVE_UBUNTU_APPINDICATOR, 1, [Have Ubuntu AppIndicator])])],
[AC_MSG_NOTICE([Buidling against Ayatana AppIndicator.])
PKG_CHECK_MODULES([APPINDICATOR],
[$AYATANA_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
[AC_DEFINE(HAVE_AYATANA_APPINDICATOR, 1, [Have Ayatana AppIndicator])])])

PKG_CHECK_MODULES(FONT_CAPPLET, $COMMON_MODULES pango)
PKG_CHECK_MODULES(FONT_VIEWER, $COMMON_MODULES fontconfig freetype2 mate-desktop-2.0)
Expand Down Expand Up @@ -329,7 +325,9 @@ Configure summary:
Warning flags: ${WARN_CFLAGS}
Linker flags: ${LDFLAGS}

Appindicator: ${enable_appindicator}
Ayatana AppIndicator (preferred) $(test "x$enable_appindicator" = xyes && echo no || echo yes)
Ubuntu AppIndicator (legacy) $(test "x$enable_appindicator" = xyes && echo yes || echo no)

Libmate-slab: ${have_libmateslab}
Accountsservice: ${have_accountsservice}
Native Language support: ${USE_NLS}
Expand Down
8 changes: 2 additions & 6 deletions typing-break/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,18 @@ mate_typing_monitor_CPPFLAGS = \
$(AM_CPPFLAGS)
mate_typing_monitor_CFLAGS = \
@TYPING_CFLAGS@ \
@APPINDICATOR_CFLAGS@ \
@MATE_DESKTOP_CFLAGS@ \
$(WARN_CFLAGS) \
$(AM_CFLAGS)

mate_typing_monitor_LDADD = @TYPING_LIBS@ @MATE_DESKTOP_LIBS@ @SCREENSAVER_LIBS@
mate_typing_monitor_LDADD = @TYPING_LIBS@ @APPINDICATOR_LIBS@ @MATE_DESKTOP_LIBS@ @SCREENSAVER_LIBS@

if HAVE_LIBCANBERRA_GTK
mate_typing_monitor_CFLAGS += -DHAVE_CANBERRA_GTK @LIBCANBERRA_GTK_CFLAGS@
mate_typing_monitor_LDADD += @LIBCANBERRA_GTK_LIBS@
endif

if HAVE_APP_INDICATOR
mate_typing_monitor_CFLAGS += -DHAVE_APP_INDICATOR @APP_INDICATOR_CFLAGS@
mate_typing_monitor_LDADD += @APP_INDICATOR_LIBS@
endif

imagedir = $(pkgdatadir)/pixmaps
dist_image_DATA = bar.png bar-red.png bar-green.png bar-disabled.png ocean-stripes.png

Expand Down
Loading

0 comments on commit 1a837cc

Please sign in to comment.