[mate-indicator-applet] 01/04: debian/patches: Add 2001_AyatanaIndicators-support.patch. Support building against Ayatana Indicators and Ubuntu Indicators alike.
Mike Gabriel
sunweaver at debian.org
Wed Dec 6 21:37:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
sunweaver pushed a commit to branch master
in repository mate-indicator-applet.
commit 0316663eb9eed56d50c8670a6577c092e1e823aa
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Dec 4 15:27:21 2017 +0100
debian/patches: Add 2001_AyatanaIndicators-support.patch. Support building against Ayatana Indicators and Ubuntu Indicators alike.
---
.../patches/2001_AyatanaIndicators-support.patch | 210 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 211 insertions(+)
diff --git a/debian/patches/2001_AyatanaIndicators-support.patch b/debian/patches/2001_AyatanaIndicators-support.patch
new file mode 100644
index 0000000..443b70b
--- /dev/null
+++ b/debian/patches/2001_AyatanaIndicators-support.patch
@@ -0,0 +1,210 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,8 +26,12 @@
+
+ GTK_REQUIRED_VERSION=3.14.0
+ PANEL_REQUIRED_VERSION=1.17.0
+-INDICATOR_REQUIRED_VERSION=0.3.90
+-INDICATOR_NG_VERSION=12.10.2
++
++UBUNTU_INDICATOR_REQUIRED_VERSION=0.3.90
++UBUNTU_INDICATOR_NG_VERSION=12.10.2
++
++AYATANA_INDICATOR_REQUIRED_VERSION=0.6.0
++AYATANA_INDICATOR_NG_VERSION=0.6.0
+
+ PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK_REQUIRED_VERSION
+ x11
+@@ -37,16 +41,56 @@
+ AC_SUBST(APPLET_CFLAGS)
+ AC_SUBST(APPLET_LIBS)
+
+-PKG_CHECK_EXISTS(indicator3-0.4 >= $INDICATOR_NG_VERSION,
+- [have_indicator_ng="yes"],
+- [have_indicator_ng="no"])
++# Which Indicator implementation shall we use?
+
+-if test "x$have_indicator_ng" = "xyes"; then
+- PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $INDICATOR_NG_VERSION
++###
++### Look for Ubuntu Indicators first
++###
++
++PKG_CHECK_EXISTS(indicator3-0.4,
++ [have_ubuntuindicator="yes"],
++ [have_ubuntuindicator="no"])
++
++PKG_CHECK_EXISTS(indicator3-0.4 >= $UBUNTU_INDICATOR_NG_VERSION,
++ [have_ubuntuindicator_ng="yes"],
++ [have_ubuntuindicator_ng="no"])
++
++if test "x$have_ubuntuindicator_ng" = "xyes"; then
++ PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $UBUNTU_INDICATOR_NG_VERSION
+ libido3-0.1 >= 13.10,
+ [AC_DEFINE(HAVE_INDICATOR_NG, 1, "New style indicators support")])
++elif test "x$have_ubuntuindicator" = "xyes"; then
++ PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $UBUNTU_INDICATOR_REQUIRED_VERSION)
++
++else
++
++ ###
++ ### If we lack Ubuntu Indicators, look for Ayatana Indicators, alternatively.
++ ###
++
++ PKG_CHECK_EXISTS(ayatana-indicator3-0.4,
++ [have_ayatanaindicator="yes"],
++ [have_ayatanaindicator="no"])
++
++ PKG_CHECK_EXISTS(ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_NG_VERSION,
++ [have_ayatanaindicator_ng="yes"],
++ [have_ayatanaindicator_ng="no"])
++
++ if test "x$have_ayatanaindicator_ng" = "xyes"; then
++ PKG_CHECK_MODULES(INDICATOR, ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_NG_VERSION
++ libayatana-ido3-0.4 >= 0.4.0,
++ [AC_DEFINE(HAVE_INDICATOR_NG, 1, "New style indicators support")])
++ elif test "x$have_ayatanaindicator" = "xyes"; then
++ PKG_CHECK_MODULES(INDICATOR, ayatana-indicator3-0.4 >= $AYATANA_INDICATOR_REQUIRED_VERSION)
++ fi
++fi
++
++if test "x$have_ayatanaindicator" == "xyes"; then
++ AC_DEFINE(HAVE_AYATANA_INDICATORS, 1, "Ayatana Indicators Support")
++elif test "x$have_ubuntuindicator" == "xyes"; then
++ AC_DEFINE(HAVE_UBUNTU_INDICATORS, 1, "Ubuntu Indicators Support")
+ else
+- PKG_CHECK_MODULES(INDICATOR, indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION)
++ AC_MSG_ERROR([Either Ayatana Indicators or Ubuntu Indicators are required to build mate-indicator-applet.])
+ fi
+
+ AC_SUBST(INDICATOR_CFLAGS)
+--- a/src/applet-main.c
++++ b/src/applet-main.c
+@@ -28,22 +28,69 @@
+ #include <gdk/gdkkeysyms.h>
+ #include <gtk/gtk.h>
+
++#if HAVE_UBUNTU_INDICATORS
++
++#define INDICATOR_SERVICE_APPMENU "libappmenu.so"
++#define INDICATOR_SERVICE_ME "libme.so"
++#define INDICATOR_SERVICE_DATETIME "libdatetime.so"
++
++#define INDICATOR_SERVICE_APPMENU_NG "com.canonical.indicator.appmenu"
++#define INDICATOR_SERVICE_ME_NG "com.canonical.indicator.me"
++#define INDICATOR_SERVICE_DATETIME_NG "com.canonical.indicator.datetime"
++
+ #include <libindicator/indicator-object.h>
++#endif
++
++#if HAVE_AYATANA_INDICATORS
++
++#define INDICATOR_SERVICE_APPMENU "libayatana-appmenu.so"
++#define INDICATOR_SERVICE_ME "libayatana-me.so"
++#define INDICATOR_SERVICE_DATETIME "libayatana-datetime.so"
++
++#define INDICATOR_SERVICE_APPMENU_NG "org.ayatana.indicator.appmenu"
++#define INDICATOR_SERVICE_ME_NG "org.ayatana.indicator.me"
++#define INDICATOR_SERVICE_DATETIME_NG "org.ayatana.indicator.datetime"
++
++#include <libayatana-indicator/indicator-object.h>
++#endif
+
+ /* For new style indicators */
+-#if HAVE_INDICATOR_NG
++
++#if HAVE_UBUNTU_INDICATORS && HAVE_INDICATOR_NG
++
+ #include <libido/libido.h>
+ #include <libindicator/indicator-ng.h>
++
++#define INDICATOR_SERVICE_DIR "/usr/share/unity/indicators"
++
++#endif
++
++#if HAVE_AYATANA_INDICATORS && HAVE_INDICATOR_NG
++
++#include <libayatana-ido/libayatana-ido.h>
++#include <libayatana-indicator/indicator-ng.h>
++
++#define INDICATOR_SERVICE_DIR "/usr/share/ayatana/indicators"
++
+ #endif
+
+ #include "tomboykeybinder.h"
+
+ static gchar * indicator_order[] = {
++#if HAVE_UBUNTU_INDICATORS
+ "libapplication.so",
+ "libmessaging.so",
+ "libsoundmenu.so",
+ "libdatetime.so",
+ "libsession.so",
++#endif
++#if HAVE_AYATANA_INDICATORS
++ "libayatana-application.so",
++ "libayatana-messaging.so",
++ "libayatana-soundmenu.so",
++ "libayatana-datetime.so",
++ "libayatana-session.so",
++#endif
+ NULL
+ };
+
+@@ -573,19 +620,19 @@
+ gint count = 0;
+ while ((name = g_dir_read_name(dir)) != NULL) {
+ #ifdef INDICATOR_APPLET_APPMENU
+- if (g_strcmp0(name, "libappmenu.so")) {
++ if (g_strcmp0(name, INDICATOR_SERVICE_APPMENU)) {
+ continue;
+ }
+ #else
+- if (!g_strcmp0(name, "libappmenu.so")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_APPMENU)) {
+ continue;
+ }
+ #endif
+ #ifdef INDICATOR_APPLET
+- if (!g_strcmp0(name, "libme.so")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_ME)) {
+ continue;
+ }
+- if (!g_strcmp0(name, "libdatetime.so")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_DATETIME)) {
+ continue;
+ }
+ #endif
+@@ -602,8 +649,6 @@
+
+ #if HAVE_INDICATOR_NG
+
+-#define INDICATOR_SERVICE_DIR "/usr/share/unity/indicators"
+-
+ static void
+ load_indicators_from_indicator_files (GtkWidget *menubar, gint *indicators_loaded)
+ {
+@@ -630,19 +675,19 @@
+ g_free (filename);
+
+ #ifdef INDICATOR_APPLET_APPMENU
+- if (g_strcmp0(name, "com.canonical.indicator.appmenu")) {
++ if (g_strcmp0(name, INDICATOR_SERVICE_APPMENU_NG)) {
+ continue;
+ }
+ #else
+- if (!g_strcmp0(name, "com.canonical.indicator.appmenu")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_APPMENU_NG)) {
+ continue;
+ }
+ #endif
+ #ifdef INDICATOR_APPLET
+- if (!g_strcmp0(name, "com.canonical.indicator.me")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_ME_NG)) {
+ continue;
+ }
+- if (!g_strcmp0(name, "com.canonical.indicator.datetime")) {
++ if (!g_strcmp0(name, INDICATOR_SERVICE_DATETIME_NG)) {
+ continue;
+ }
+ #endif
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..144ae70
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+2001_AyatanaIndicators-support.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-indicator-applet.git
More information about the pkg-mate-commits
mailing list