summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mate-base/mate-control-center/files')
-rw-r--r--mate-base/mate-control-center/files/mate-control-center-1.26.0-ayatana-detection.patch435
-rw-r--r--mate-base/mate-control-center/files/mate-control-center-1.28.0-optional-systemd.patch250
2 files changed, 685 insertions, 0 deletions
diff --git a/mate-base/mate-control-center/files/mate-control-center-1.26.0-ayatana-detection.patch b/mate-base/mate-control-center/files/mate-control-center-1.26.0-ayatana-detection.patch
new file mode 100644
index 000000000000..ed1c8aec619e
--- /dev/null
+++ b/mate-base/mate-control-center/files/mate-control-center-1.26.0-ayatana-detection.patch
@@ -0,0 +1,435 @@
+--- mate-control-center-1.26.0.old/configure.ac 2023-04-28 16:12:05.281295458 +0200
++++ mate-control-center-1.26.0/configure.ac 2023-04-28 16:48:44.374329792 +0200
+@@ -84,30 +84,50 @@
+
+ AM_CONDITIONAL(HAVE_TYPING_BREAK, test "x$TYPING_BREAK" = xtyping-break)
+
+-dnl app indicator
+-APPINDICATOR_PKG=appindicator3-0.1
++dnl app indicator (Ubuntu and Ayatana implementation)
++AYATANA_APPINDICATOR_PKG=ayatana-appindicator3-0.1
++UBUNTU_APPINDICATOR_PKG=appindicator3-0.1
++
++PKG_CHECK_EXISTS($AYATANA_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED,
++ [have_appindicator_ayatana="yes"],
++ [have_appindicator_ayatana="no"])
++PKG_CHECK_EXISTS($UBUNTU_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED,
++ [have_appindicator_ubuntu="yes"],
++ [have_appindicator_ubuntu="no"])
+
+ 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")
++if test "x$enable_appindicator" = "xauto" &&
++ (test "x$have_appindicator_ayatana" = "xyes" ||
++ test "x$have_appindicator_ubuntu" = "xyes"); then
++ AC_MSG_NOTICE([Enabling AppIndicator support (as --enable-appindicator=auto was used).])
++ enable_appindicator="yes"
+ 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])
++if test "x$enable_appindicator" = "xyes"; then
++ if test "x$have_appindicator_ayatana" = "xyes"; then
++ AC_MSG_NOTICE([Buidling against Ayatana AppIndicator.])
++ PKG_CHECK_MODULES(AYATANA_APPINDICATOR,
++ [$AYATANA_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
++ [AC_DEFINE(HAVE_AYATANA_APPINDICATOR, 1, [Have Ayatana AppIndicator])])
++ AC_SUBST(AYATANA_APPINDICATOR_CFLAGS)
++ AC_SUBST(AYATANA_APPINDICATOR_LIBS)
++ elif test "x$have_appindicator_ubuntu" = "xyes"; then
++ AC_MSG_NOTICE([Buidling against Ubuntu AppIndicator.])
++ PKG_CHECK_MODULES(UBUNTU_APPINDICATOR,
++ [$UBUNTU_APPINDICATOR_PKG >= $APPINDICATOR_REQUIRED],
++ [AC_DEFINE(HAVE_UBUNTU_APPINDICATOR, 1, [Have Ubuntu AppIndicator])])
++ AC_SUBST(UBUNTU_APPINDICATOR_CFLAGS)
++ AC_SUBST(UBUNTU_APPINDICATOR_LIBS)
++ else
++ AC_MSG_ERROR([Neither Ayatana AppIndicator nor Ubuntu AppIndicator library is present, but you enabled AppIndicator support.])
++ fi
+ fi
+-AM_CONDITIONAL(HAVE_APP_INDICATOR, test x"$enable_appindicator" = xyes)
++AM_CONDITIONAL(HAVE_AYATANA_APPINDICATOR, test x"$have_appindicator_ayatana" = xyes -a x"$enable_appindicator" = xyes)
++AM_CONDITIONAL(HAVE_UBUNTU_APPINDICATOR, test x"$have_appindicator_ubuntu" = xyes -a x"$enable_appindicator" = xyes)
+
+ dnl keyboard-properties-capplet
+ savecppflags=$CPPFLAGS
+@@ -322,7 +342,10 @@
+ Warning flags: ${WARN_CFLAGS}
+ Linker flags: ${LDFLAGS}
+
+- Appindicator: ${enable_appindicator}
++ AppIndicator enabled: ${enable_appindicator}
++ Ayatana AppIndicator (preferred) ${have_appindicator_ayatana}
++ Ubuntu AppIndicator (legacy) ${have_appindicator_ubuntu}
++
+ Libmate-slab: ${have_libmateslab}
+ Accountsservice: ${have_accountsservice}
+ Native Language support: ${USE_NLS}
+--- mate-control-center-1.26.0.old/typing-break/drwright.c 2023-04-28 16:12:05.282295452 +0200
++++ mate-control-center-1.26.0/typing-break/drwright.c 2023-04-28 16:27:03.082651572 +0200
+@@ -30,9 +30,11 @@
+ #include <gtk/gtk.h>
+ #include <gio/gio.h>
+
+-#ifdef HAVE_APP_INDICATOR
+-#include <libappindicator/app-indicator.h>
+-#endif /* HAVE_APP_INDICATOR */
++#if defined(HAVE_AYATANA_APPINDICATOR)
++# include <libayatana-appindicator/app-indicator.h>
++#elif defined(HAVE_UBUNTU_APPINDICATOR)
++# include <libappindicator/app-indicator.h>
++#endif
+
+ #define MATE_DESKTOP_USE_UNSTABLE_API
+ #include <libmate-desktop/mate-desktop-utils.h>
+@@ -43,11 +45,11 @@
+ #include "drw-utils.h"
+ #include "drw-timer.h"
+
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ #define BLINK_TIMEOUT 200
+ #define BLINK_TIMEOUT_MIN 120
+ #define BLINK_TIMEOUT_FACTOR 100
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ typedef enum {
+ STATE_START,
+@@ -59,10 +61,10 @@
+ STATE_BREAK_DONE
+ } DrwState;
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ #define TYPING_MONITOR_ACTIVE_ICON "bar-green"
+ #define TYPING_MONITOR_ATTENTION_ICON "bar-red"
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ struct _DrWright {
+ /* Widgets. */
+@@ -88,7 +90,7 @@
+ gboolean enabled;
+
+ guint clock_timeout_id;
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ AppIndicator *indicator;
+ #else
+ guint blink_timeout_id;
+@@ -102,7 +104,7 @@
+ cairo_surface_t *green_bar;
+ cairo_surface_t *disabled_bar;
+ GdkPixbuf *composite_bar;
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ GtkWidget *warn_dialog;
+ };
+@@ -124,11 +126,11 @@
+ DrWright *dr);
+ static void popup_about_cb (GtkAction *action,
+ DrWright *dr);
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ static void init_app_indicator (DrWright *dr);
+ #else
+ static void init_tray_icon (DrWright *dr);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ static GList * create_secondary_break_windows (void);
+
+ static const GtkActionEntry actions[] = {
+@@ -147,7 +149,7 @@
+ dr->break_time = 10;
+ }
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ static void
+ update_app_indicator (DrWright *dr)
+ {
+@@ -304,32 +306,32 @@
+
+ return FALSE;
+ }
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ static void
+ start_blinking (DrWright *dr)
+ {
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ if (!dr->blink_timeout_id) {
+ dr->blink_on = TRUE;
+ blink_timeout_cb (dr);
+ }
+
+ /*gtk_widget_show (GTK_WIDGET (dr->icon));*/
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ }
+
+ static void
+ stop_blinking (DrWright *dr)
+ {
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ if (dr->blink_timeout_id) {
+ g_source_remove (dr->blink_timeout_id);
+ dr->blink_timeout_id = 0;
+ }
+
+ /*gtk_widget_hide (GTK_WIDGET (dr->icon));*/
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ }
+
+ static gboolean
+@@ -397,9 +399,9 @@
+ dr->break_window = NULL;
+ }
+
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ set_status_icon (dr->icon, dr->neutral_bar);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ dr->save_last_time = 0;
+
+@@ -437,9 +439,9 @@
+ }
+
+ stop_blinking (dr);
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ set_status_icon (dr->icon, dr->red_bar);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ drw_timer_start (dr->timer);
+
+@@ -480,9 +482,9 @@
+
+ case STATE_BREAK_DONE_SETUP:
+ stop_blinking (dr);
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ set_status_icon (dr->icon, dr->green_bar);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ dr->state = STATE_BREAK_DONE;
+ break;
+@@ -498,11 +500,11 @@
+
+ dr->last_elapsed_time = elapsed_time;
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ update_app_indicator (dr);
+ #else
+ update_icon (dr);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ return TRUE;
+ }
+@@ -512,45 +514,45 @@
+ {
+ gint min;
+ gchar *str;
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ GtkWidget *item;
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ if (!dr->enabled) {
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ app_indicator_set_status (dr->indicator,
+ APP_INDICATOR_STATUS_PASSIVE);
+ #else
+ gtk_status_icon_set_tooltip_text (dr->icon,
+ _("Disabled"));
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ return TRUE;
+ }
+
+ min = get_time_left (dr);
+
+ if (min >= 1) {
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ str = g_strdup_printf (_("Take a break now (next in %dm)"), min);
+ #else
+ str = g_strdup_printf (ngettext("%d minute until the next break",
+ "%d minutes until the next break",
+ min), min);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ } else {
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ str = g_strdup_printf (_("Take a break now (next in less than one minute)"));
+ #else
+ str = g_strdup_printf (_("Less than one minute until the next break"));
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ }
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ item = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop/TakeABreak");
+ gtk_menu_item_set_label (GTK_MENU_ITEM (item), str);
+ #else
+ gtk_status_icon_set_tooltip_text (dr->icon, str);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ g_free (str);
+
+@@ -665,7 +667,7 @@
+ NULL);
+ }
+
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ static void
+ popup_menu_cb (GtkWidget *widget,
+ guint button,
+@@ -684,7 +686,7 @@
+ 0,
+ gtk_get_current_event_time ());
+ }
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ static void
+ break_window_done_cb (GtkWidget *window,
+@@ -724,11 +726,11 @@
+ drw_timer_start (dr->timer);
+ maybe_change_state (dr);
+ update_status (dr);
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ update_app_indicator (dr);
+ #else
+ update_icon (dr);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+ }
+
+ static void
+@@ -745,7 +747,7 @@
+ dr->secondary_break_windows = NULL;
+ }
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ static void
+ init_app_indicator (DrWright *dr)
+ {
+@@ -792,7 +794,7 @@
+ G_CALLBACK (popup_menu_cb),
+ dr);
+ }
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ static GList *
+ create_secondary_break_windows (void)
+@@ -891,7 +893,7 @@
+ G_CALLBACK (activity_detected_cb),
+ dr);
+
+-#ifdef HAVE_APP_INDICATOR
++#if defined(HAVE_AYATANA_APPINDICATOR) || defined(HAVE_UBUNTU_APPINDICATOR)
+ init_app_indicator (dr);
+ #else
+ dr->neutral_bar = cairo_image_surface_create_from_png (IMAGEDIR "/bar.png");
+@@ -900,7 +902,7 @@
+ dr->disabled_bar = cairo_image_surface_create_from_png (IMAGEDIR "/bar-disabled.png");
+
+ init_tray_icon (dr);
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ g_timeout_add_seconds (12,
+ (GSourceFunc) update_status,
+--- mate-control-center-1.26.0.old/typing-break/Makefile.am 2023-04-28 16:12:05.283295447 +0200
++++ mate-control-center-1.26.0/typing-break/Makefile.am 2023-04-28 16:30:45.343491923 +0200
+@@ -32,9 +32,14 @@
+ 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@
++if HAVE_AYATANA_APPINDICATOR
++ mate_typing_monitor_CFLAGS += -DHAVE_AYATANA_APPINDICATOR @AYATANA_APPINDICATOR_CFLAGS@
++ mate_typing_monitor_LDADD += @AYATANA_APPINDICATOR_LIBS@
++endif
++
++if HAVE_UBUNTU_APPINDICATOR
++ mate_typing_monitor_CFLAGS += -DHAVE_UBUNTU_APPINDICATOR @UBUNTU_APPINDICATOR_CFLAGS@
++ mate_typing_monitor_LDADD += @UBUNTU_APPINDICATOR_LIBS@
+ endif
+
+ imagedir = $(pkgdatadir)/pixmaps
+--- mate-control-center-1.26.0.old/typing-break/main.c 2023-04-28 16:12:05.282295452 +0200
++++ mate-control-center-1.26.0/typing-break/main.c 2023-04-28 16:32:09.781067404 +0200
+@@ -31,7 +31,7 @@
+
+ gboolean debug = FALSE;
+
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ static gboolean
+ have_tray (void)
+ {
+@@ -50,7 +50,7 @@
+ return FALSE;
+ }
+ }
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ int
+ main (int argc, char *argv[])
+@@ -98,7 +98,7 @@
+ return 0;
+ }
+
+-#ifndef HAVE_APP_INDICATOR
++#if !defined(HAVE_AYATANA_APPINDICATOR) && !defined(HAVE_UBUNTU_APPINDICATOR)
+ if (!no_check && !have_tray ()) {
+ GtkWidget *dialog;
+
+@@ -116,7 +116,7 @@
+
+ gtk_widget_destroy (dialog);
+ }
+-#endif /* HAVE_APP_INDICATOR */
++#endif
+
+ drwright_new ();
+
diff --git a/mate-base/mate-control-center/files/mate-control-center-1.28.0-optional-systemd.patch b/mate-base/mate-control-center/files/mate-control-center-1.28.0-optional-systemd.patch
new file mode 100644
index 000000000000..11ecdc855382
--- /dev/null
+++ b/mate-base/mate-control-center/files/mate-control-center-1.28.0-optional-systemd.patch
@@ -0,0 +1,250 @@
+From 86a190c7b0ac8e5dbd5545d9aea30da771e34b31 Mon Sep 17 00:00:00 2001
+From: Oz Tiram <oz.tiram@gmail.com>
+Date: Sun, 3 Mar 2024 14:36:27 +0100
+Subject: [PATCH 1/2] Make systemd optional
+
+There is not much of direct systemd usage in the system-info plugin.
+This patch suggestion enables building this plugin on system like
+alpine, voidlinux or gentoo with openrc.
+
+Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
+---
+ capplets/system-info/mate-system-info.c | 12 ++++++++++--
+ configure.ac | 16 +++++++++++++++-
+ 2 files changed, 25 insertions(+), 3 deletions(-)
+
+diff --git a/capplets/system-info/mate-system-info.c b/capplets/system-info/mate-system-info.c
+index 36380678..180cdf3e 100644
+--- a/capplets/system-info/mate-system-info.c
++++ b/capplets/system-info/mate-system-info.c
+@@ -21,6 +21,7 @@
+ *
+ */
+ #include <gtk/gtk.h>
++#include <glib.h>
+ #include <glibtop/fsusage.h>
+ #include <glibtop/mountlist.h>
+ #include <glibtop/mem.h>
+@@ -159,6 +160,7 @@ mate_system_info_set_row (MateSystemInfo *info)
+ static char *
+ get_system_hostname (void)
+ {
++# ifdef HAVE_SYSTEMD
+ GDBusProxy *hostnamed_proxy;
+ g_autoptr(GVariant) variant = NULL;
+ g_autoptr(GError) error = NULL;
+@@ -206,6 +208,9 @@ get_system_hostname (void)
+ g_object_unref (hostnamed_proxy);
+ return g_variant_dup_string (variant, NULL);
+ }
++# else
++ return g_strdup (g_get_host_name ());
++# endif
+ }
+
+ static char *
+@@ -493,7 +498,9 @@ static struct {
+ { "openvz", "OpenVZ" },
+ { "lxc", "LXC" },
+ { "lxc-libvirt", "LXC (libvirt)" },
+- { "systemd-nspawn", "systemd (nspawn)" }
++# ifdef HAVE_SYSTEMD
++ { "systemd-nspawn", "systemd (nspawn)" },
++# endif
+ };
+
+ static char *
+@@ -666,7 +673,7 @@ mate_system_info_setup (MateSystemInfo *info)
+ kernel_text = get_kernel_vesrion ();
+ label = g_object_get_data (G_OBJECT (info->kernel_row), "labelvalue");
+ set_lable_style (label, "gray", 12, kernel_text, FALSE);
+-
++# ifdef HAVE_SYSTEMD
+ virt_text = get_system_virt ();
+ if (virt_text != NULL)
+ {
+@@ -674,6 +681,7 @@ mate_system_info_setup (MateSystemInfo *info)
+ label = g_object_get_data (G_OBJECT (info->virtualization_row), "labelvalue");
+ set_lable_style (label, "gray", 12, virt_text, FALSE);
+ }
++# endif
+ windowing_system_text = get_windowing_system ();
+ label = g_object_get_data (G_OBJECT (info->windowing_system_row), "labelvalue");
+ set_lable_style (label, "gray", 12, windowing_system_text, FALSE);
+diff --git a/configure.ac b/configure.ac
+index aa43d083..45d5365f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -121,7 +121,6 @@ PKG_CHECK_MODULES(TYPING, $GMODULE_ADD glib-2.0 >= $GLIB_REQUIRED gio-2.0 gtk+-3
+ PKG_CHECK_MODULES(GIO, gio-2.0)
+ PKG_CHECK_MODULES(GLIBTOP, libgtop-2.0)
+ PKG_CHECK_MODULES(UDISKS, udisks2)
+-PKG_CHECK_MODULES(SYSTEMD, systemd >= $SYSTEMD_REQUIRED)
+
+ PKG_CHECK_MODULES([DCONF], [dconf >= 0.13.4])
+ AC_SUBST(DCONF_CFLAGS)
+@@ -168,6 +167,20 @@ AC_ARG_ENABLE([libappindicator],
+ [enable_appindicator=yes],
+ [enable_appindicator=no])])])
+
++AC_ARG_ENABLE([systemd],
++ [AS_HELP_STRING([--enable-systemd[=@<:@no/auto/yes@:>@]],[Use systemd @<:@default=yes@:>@])],
++ [enable_systemd=$enableval],
++ [PKG_CHECK_EXISTS([$SYSTEMD >= $SYSTEMD_REQUIRED],
++ [enable_systemd=no],
++ ,
++ )])
++
++AS_IF([test "x$enable_systemd" = xyes],
++ [AC_MSG_NOTICE([Building with systemd support.])
++ PKG_CHECK_MODULES([SYSTEMD],
++ [systemd >= $SYSTEMD_REQUIRED],
++ [AC_DEFINE(HAVE_SYSTEMD, 1, [Have systemd])])])
++
+ AS_IF([test "x$enable_appindicator" = xyes],
+ [AC_MSG_NOTICE([Buidling against Ubuntu AppIndicator.])
+ PKG_CHECK_MODULES([APPINDICATOR],
+@@ -313,6 +326,7 @@ Configure summary:
+
+ Ayatana AppIndicator (preferred) $(test "x$enable_appindicator" = xyes && echo no || echo yes)
+ Ubuntu AppIndicator (legacy) $(test "x$enable_appindicator" = xyes && echo yes || echo no)
++ Systemd: $(test "x$enable_systemd" = xyes && echo yes || echo no)
+
+ Accountsservice: ${have_accountsservice}
+ Native Language support: ${USE_NLS}
+--
+2.43.0
+
+
+From 0f0f4f7151cce75e44fe3fef870e7120b17866a4 Mon Sep 17 00:00:00 2001
+From: Oz Tiram <oz.tiram@gmail.com>
+Date: Mon, 4 Mar 2024 08:03:40 +0100
+Subject: [PATCH 2/2] Disable function definitions if systemd isn't found
+
+Signed-off-by: Oz Tiram <oz.tiram@gmail.com>
+---
+ capplets/system-info/mate-system-info.c | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+diff --git a/capplets/system-info/mate-system-info.c b/capplets/system-info/mate-system-info.c
+index 180cdf3e..00b0d8a3 100644
+--- a/capplets/system-info/mate-system-info.c
++++ b/capplets/system-info/mate-system-info.c
+@@ -132,13 +132,15 @@ static void
+ mate_system_info_set_row (MateSystemInfo *info)
+ {
+ mate_system_info_row_fill (info->hostname_row, _("Device Name"), FALSE);
++# ifdef HAVE_SYSTEMD
+ mate_system_info_row_fill (info->hardware_model_row, _("Hardware Model"), TRUE);
++ mate_system_info_row_fill (info->virtualization_row, _("Virtualization"), TRUE);
++# endif
+ mate_system_info_row_fill (info->memory_row, _("Memory"), TRUE);
+ mate_system_info_row_fill (info->processor_row, _("Processor"), TRUE);
+ mate_system_info_row_fill (info->graphics_row, _("Graphics"), TRUE);
+ mate_system_info_row_fill (info->disk_row, _("Disk Capacity"), FALSE);
+ mate_system_info_row_fill (info->kernel_row, _("Kernel Version"), FALSE);
+- mate_system_info_row_fill (info->virtualization_row, _("Virtualization"), TRUE);
+ mate_system_info_row_fill (info->windowing_system_row, _("Windowing System"), TRUE);
+ mate_system_info_row_fill (info->mate_version_row, _("MATE Version"), TRUE);
+ mate_system_info_row_fill (info->os_name_row, _("OS Name"), TRUE);
+@@ -213,6 +215,7 @@ get_system_hostname (void)
+ # endif
+ }
+
++# ifdef HAVE_SYSTEMD
+ static char *
+ get_hardware_model (void)
+ {
+@@ -263,6 +266,7 @@ get_hardware_model (void)
+
+ return NULL;
+ }
++# endif
+
+ static char *
+ get_cpu_info (void)
+@@ -483,6 +487,7 @@ get_kernel_vesrion (void)
+ return g_strdup_printf ("%s %s", un.sysname, un.release);
+ }
+
++# ifdef HAVE_SYSTEMD
+ static struct {
+ const char *id;
+ const char *display;
+@@ -498,9 +503,7 @@ static struct {
+ { "openvz", "OpenVZ" },
+ { "lxc", "LXC" },
+ { "lxc-libvirt", "LXC (libvirt)" },
+-# ifdef HAVE_SYSTEMD
+- { "systemd-nspawn", "systemd (nspawn)" },
+-# endif
++ { "systemd-nspawn", "systemd (nspawn)" }
+ };
+
+ static char *
+@@ -567,6 +570,7 @@ get_system_virt (void)
+
+ return get_virtualization_label (g_variant_get_string (inner, NULL));
+ }
++# endif
+
+ static char *
+ get_mate_desktop_version ()
+@@ -622,7 +626,10 @@ mate_system_info_setup (MateSystemInfo *info)
+ {
+ g_autofree char *logo_name = NULL;
+ g_autofree char *hostname_text = NULL;
++# ifdef HAVE_SYSTEMD
+ g_autofree char *hw_model_text = NULL;
++ g_autofree char *virt_text = NULL;
++# endif
+ g_autofree char *memory_text = NULL;
+ g_autofree char *cpu_text = NULL;
+ g_autofree char *os_type_text = NULL;
+@@ -630,7 +637,6 @@ mate_system_info_setup (MateSystemInfo *info)
+ g_autofree char *disk_text = NULL;
+ g_autofree char *kernel_text = NULL;
+ g_autofree char *windowing_system_text = NULL;
+- g_autofree char *virt_text = NULL;
+ g_autofree char *de_text = NULL;
+ g_autofree char *graphics_hardware_string = NULL;
+
+@@ -645,6 +651,7 @@ mate_system_info_setup (MateSystemInfo *info)
+ label = g_object_get_data (G_OBJECT (info->hostname_row), "labelvalue");
+ set_lable_style (label, "gray", 12, hostname_text, FALSE);
+
++# if HAVE_SYSTEMD
+ hw_model_text = get_hardware_model ();
+ if (hw_model_text != NULL)
+ {
+@@ -652,7 +659,7 @@ mate_system_info_setup (MateSystemInfo *info)
+ label = g_object_get_data (G_OBJECT (info->hardware_model_row), "labelvalue");
+ set_lable_style (label, "gray", 12, hw_model_text, FALSE);
+ }
+-
++# endif
+ glibtop_get_mem (&mem);
+ memory_text = g_format_size_full (mem.total, G_FORMAT_SIZE_IEC_UNITS);
+ label = g_object_get_data (G_OBJECT (info->memory_row), "labelvalue");
+@@ -714,7 +721,10 @@ mate_system_info_class_init (MateSystemInfoClass *klass)
+ gtk_widget_class_set_template_from_resource (widget_class, "/org/mate/control-center/system-info/mate-system-info.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, hostname_row);
++# ifdef HAVE_SYSTEMD
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, hardware_box);
++ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, virtualization_row);
++# endif
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, disk_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, mate_version_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, graphics_row);
+@@ -725,7 +735,6 @@ mate_system_info_class_init (MateSystemInfoClass *klass)
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, os_name_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, os_type_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, processor_row);
+- gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, virtualization_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, kernel_row);
+ gtk_widget_class_bind_template_child (widget_class, MateSystemInfo, windowing_system_row);
+ }
+--
+2.43.0
+