Skip to content

Commit

Permalink
Merge pull request #28 from alexmurray/ayatana-appindicator
Browse files Browse the repository at this point in the history
Switch from libappindicator to libayatana-appindicator
  • Loading branch information
alexmurray authored Dec 4, 2019
2 parents 2a00714 + 1514ec5 commit 8ba2e58
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 46 deletions.
14 changes: 7 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ AC_SUBST(LIBS)
GLIB_REQUIRED=2.28.0
GIO_REQUIRED=2.26.0
GTK_REQUIRED=3.0.0
APPINDICATOR_REQUIRED=0.0.7
AYATANA_APPINDICATOR_REQUIRED=0.0.7
LIBPEAS_REQUIRED=0.7.2
LIBNOTIFY_REQUIRED=0.7.2
LIBUDISKS2_REQUIRED=2.0.0
Expand Down Expand Up @@ -70,13 +70,13 @@ PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED)
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)

PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1 >= $APPINDICATOR_REQUIRED,
AC_DEFINE(HAVE_APPINDICATOR, 1, [appindicator is available]),
AC_DEFINE(HAVE_APPINDICATOR, 0, [appindicator is not available]))
AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
PKG_CHECK_MODULES(AYATANA_APPINDICATOR, ayatana-appindicator3-0.1 >= $AYATANA_APPINDICATOR_REQUIRED,
AC_DEFINE(HAVE_AYATANA_APPINDICATOR, 1, [ayatana-appindicator is available]),
AC_DEFINE(HAVE_AYATANA_APPINDICATOR, 0, [ayatana-appindicator is not available]))
AM_CONDITIONAL(AYATANA_APPINDICATOR, test -n "$AYATANA_AYATANA_APPINDICATOR_LIBS")

AC_SUBST(APPINDICATOR_CFLAGS)
AC_SUBST(APPINDICATOR_LIBS)
AC_SUBST(AYATANA_AYATANA_APPINDICATOR_CFLAGS)
AC_SUBST(AYATANA_AYATANA_APPINDICATOR_LIBS)

GLIB_GSETTINGS

Expand Down
4 changes: 2 additions & 2 deletions indicator-sensors/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ AM_CPPFLAGS = -DGNOMELOCALEDIR=\""$(datadir)/locale/"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DPREFIX=\""$(prefix)"\" \
-I$(top_srcdir) \
$(GLIB_CFLAGS) $(GIO_CFLAGS) $(GTK_CFLAGS) $(APPINDICATOR_CFLAGS) $(LIBPEAS_CFLAGS) $(LIBPEASGTK_CFLAGS) $(LIBNOTIFY_CFLAGS) $(DEBUG_CFLAGS)
$(GLIB_CFLAGS) $(GIO_CFLAGS) $(GTK_CFLAGS) $(AYATANA_APPINDICATOR_CFLAGS) $(LIBPEAS_CFLAGS) $(LIBPEASGTK_CFLAGS) $(LIBNOTIFY_CFLAGS) $(DEBUG_CFLAGS)


LIBS = $(GLIB_LIBS) $(GIO_LIBS) $(GTK_LIBS) $(APPINDICATOR_LIBS) $(LIBPEAS_LIBS) $(LIBPEASGTK_LIBS) $(LIBNOTIFY_LIBS)
LIBS = $(GLIB_LIBS) $(GIO_LIBS) $(GTK_LIBS) $(AYATANA_APPINDICATOR_LIBS) $(LIBPEAS_LIBS) $(LIBPEASGTK_LIBS) $(LIBNOTIFY_LIBS)

marshallers.h: marshallers.list
glib-genmarshal --header $< > $@
Expand Down
26 changes: 13 additions & 13 deletions indicator-sensors/is-indicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void is_indicator_get_property(GObject *object,
guint property_id, GValue *value, GParamSpec *pspec);
static void is_indicator_set_property(GObject *object,
guint property_id, const GValue *value, GParamSpec *pspec);
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
static void is_indicator_connection_changed(AppIndicator *indicator,
gboolean connected,
gpointer data);
Expand Down Expand Up @@ -84,15 +84,15 @@ is_indicator_get_menu(IsIndicator *self)
{
GtkMenu *menu;

#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
menu = app_indicator_get_menu(APP_INDICATOR(self));
#else
menu = GTK_MENU(g_object_get_data(G_OBJECT(self), "indicator-menu"));
#endif
return menu;
}

#if !HAVE_APPINDICATOR
#if !HAVE_AYATANA_APPINDICATOR
static void
popup_menu(GtkStatusIcon *status_icon,
guint button,
Expand All @@ -110,7 +110,7 @@ static void
is_indicator_set_menu(IsIndicator *self,
GtkMenu *menu)
{
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
app_indicator_set_menu(APP_INDICATOR(self), menu);
#else
g_object_set_data_full(G_OBJECT(self), "indicator-menu", menu,
Expand Down Expand Up @@ -207,7 +207,7 @@ static void
is_indicator_set_label(IsIndicator *self,
const gchar *label)
{
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
app_indicator_set_label(APP_INDICATOR(self), label, label);
#else
gtk_status_icon_set_tooltip_text(GTK_STATUS_ICON(self), label);
Expand Down Expand Up @@ -247,7 +247,7 @@ is_indicator_constructed(GObject *object)

is_indicator_set_label(self, _("No Sensors"));
is_indicator_set_menu(self, GTK_MENU(menu));
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
app_indicator_set_status(APP_INDICATOR(self), APP_INDICATOR_STATUS_ACTIVE);
#endif

Expand All @@ -266,7 +266,7 @@ is_indicator_class_init(IsIndicatorClass *klass)
gobject_class->constructed = is_indicator_constructed;
gobject_class->dispose = is_indicator_dispose;
gobject_class->finalize = is_indicator_finalize;
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
APP_INDICATOR_CLASS(klass)->connection_changed = is_indicator_connection_changed;
#endif

Expand Down Expand Up @@ -360,7 +360,7 @@ is_indicator_set_property(GObject *object,
}
}

#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
static void is_indicator_connection_changed(AppIndicator *indicator,
gboolean connected,
gpointer data)
Expand Down Expand Up @@ -414,7 +414,7 @@ is_indicator_dispose(GObject *object)
}
g_slist_free(sensors);

#if !HAVE_APPINDICATOR
#if !HAVE_AYATANA_APPINDICATOR
g_object_set_data(G_OBJECT(self), "indicator-menu", NULL);
#endif
G_OBJECT_CLASS(is_indicator_parent_class)->dispose(object);
Expand Down Expand Up @@ -447,7 +447,7 @@ update_sensor_menu_item_label(IsIndicator *self,
g_free(text);
text = NULL;

#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
if (sensor == self->priv->primary)
{
IsIndicatorPrivate *priv = self->priv;
Expand Down Expand Up @@ -574,7 +574,7 @@ sensor_disabled(IsManager *manager,
else
{
is_indicator_set_label(self, _("No active sensors"));
#if !HAVE_APPINDICATOR
#if !HAVE_AYATANA_APPINDICATOR
gtk_status_icon_set_from_stock(GTK_STATUS_ICON(self),
GTK_STOCK_DIALOG_WARNING);
#endif
Expand Down Expand Up @@ -708,7 +708,7 @@ sensor_added(IsManager *manager,
if (!self->priv->menu_items)
{
is_indicator_set_label(self, _("No active sensors"));
#if !HAVE_APPINDICATOR
#if !HAVE_AYATANA_APPINDICATOR
gtk_status_icon_set_from_stock(GTK_STATUS_ICON(self),
GTK_STOCK_DIALOG_WARNING);
#endif
Expand All @@ -719,7 +719,7 @@ IsIndicator *
is_indicator_new(IsApplication *application)
{
IsIndicator *self = g_object_new(IS_TYPE_INDICATOR,
#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
"id", PACKAGE,
"category", "Hardware",
#endif
Expand Down
6 changes: 3 additions & 3 deletions indicator-sensors/is-indicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#ifndef __IS_INDICATOR_H__
#define __IS_INDICATOR_H__

#if HAVE_APPINDICATOR
#include <libappindicator/app-indicator.h>
#if HAVE_AYATANA_APPINDICATOR
#include <libayatana-appindicator/app-indicator.h>
#else
#include <gtk/gtk.h>
#endif
Expand Down Expand Up @@ -53,7 +53,7 @@ typedef struct _IsIndicator IsIndicator;
typedef struct _IsIndicatorClass IsIndicatorClass;
typedef struct _IsIndicatorPrivate IsIndicatorPrivate;

#if HAVE_APPINDICATOR
#if HAVE_AYATANA_APPINDICATOR
#define IsIndicatorParentClass AppIndicatorClass
#define IsIndicatorParent AppIndicator
#define IS_INDICATOR_PARENT_TYPE APP_INDICATOR_TYPE
Expand Down
4 changes: 2 additions & 2 deletions plugins/aticonfig/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(ATICONFIG_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -19,7 +19,7 @@ libaticonfig_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libaticonfig_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(ATICONFIG_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/dbus/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(GIO_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -23,7 +23,7 @@ libdbus_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libdbus_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(GIO_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/dynamic/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(DYNAMIC_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -19,7 +19,7 @@ libdynamic_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libdynamic_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(DYNAMIC_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/fake/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(DEBUG_CFLAGS)

Expand All @@ -18,7 +18,7 @@ libfake_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libfake_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS)

plugin_DATA = fake.plugin
Expand Down
4 changes: 2 additions & 2 deletions plugins/libsensors/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(LIBSENSORS_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -19,7 +19,7 @@ liblibsensors_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
liblibsensors_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(LIBSENSORS_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/max/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(MAX_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -19,7 +19,7 @@ libmax_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libmax_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(MAX_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/nvidia/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(NVIDIA_CFLAGS) \
$(DEBUG_CFLAGS)
Expand All @@ -19,7 +19,7 @@ libnvidia_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libnvidia_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(NVIDIA_LIBS)

Expand Down
4 changes: 2 additions & 2 deletions plugins/udisks/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(GIO_CFLAGS) \
$(LIBATASMART_CFLAGS) \
Expand All @@ -20,7 +20,7 @@ libudisks_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libudisks_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(GIO_LIBS) \
$(LIBATASMART_LIBS)
Expand Down
4 changes: 2 additions & 2 deletions plugins/udisks2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(APPINDICATOR_CFLAGS) \
$(AYATANA_APPINDICATOR_CFLAGS) \
$(LIBPEAS_CFLAGS) \
$(GIO_CFLAGS) \
$(LIBUDISKS2_CFLAGS) \
Expand All @@ -20,7 +20,7 @@ libudisks2_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
libudisks2_la_LIBADD = \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(APPINDICATOR_LIBS) \
$(AYATANA_APPINDICATOR_LIBS) \
$(LIBPEAS_LIBS) \
$(GIO_LIBS) \
$(LIBUDISKS2_LIBS)
Expand Down
8 changes: 5 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ parts:
- libgtk-3-dev
- libpeas-dev
- libnotify-dev
- libappindicator3-dev
- libayatana-appindicator3-dev
- libsensors4-dev
- gobject-introspection
- libgirepository1.0-dev
Expand Down Expand Up @@ -101,7 +101,8 @@ parts:
plugin: nil
stage-packages:
- libsensors4
- libappindicator3-1
- libayatana-appindicator3-1
- libayatana-indicator3-7
- libudisks2-0
- libnotify4
- libpeas-1.0-0
Expand All @@ -111,7 +112,8 @@ parts:
# keep the snap size as small as possible
- etc/sensors3.conf
- etc/sensors.d/*
- usr/lib/*/libappindicator3.so.*
- usr/lib/*/libayatana-appindicator3.so.*
- usr/lib/*/libayatana-indicator3.so.*
- usr/lib/*/libdbusmenu-glib.so.*
- usr/lib/*/libdbusmenu-gtk3.so.*
- usr/lib/*/libindicator3.so.*
Expand Down

0 comments on commit 8ba2e58

Please sign in to comment.