aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gnome-extra/extension-manager/files/extension-manager-0.4.1-make-libbacktrace-optional.patch')
-rw-r--r--gnome-extra/extension-manager/files/extension-manager-0.4.1-make-libbacktrace-optional.patch153
1 files changed, 153 insertions, 0 deletions
diff --git a/gnome-extra/extension-manager/files/extension-manager-0.4.1-make-libbacktrace-optional.patch b/gnome-extra/extension-manager/files/extension-manager-0.4.1-make-libbacktrace-optional.patch
new file mode 100644
index 000000000..66c1a20c0
--- /dev/null
+++ b/gnome-extra/extension-manager/files/extension-manager-0.4.1-make-libbacktrace-optional.patch
@@ -0,0 +1,153 @@
+From 6365d56e120c7522bc5a2ba515a3cd6efac1b184 Mon Sep 17 00:00:00 2001
+From: Yuan Liao <liaoyuan@gmail.com>
+Date: Sat, 3 Jun 2023 09:55:38 -0700
+Subject: [PATCH 2/2] Make libbacktrace an optional dependency
+
+Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
+---
+ meson.build | 1 +
+ meson_options.txt | 5 +++++
+ src/exm-application.c | 2 ++
+ src/exm-backtrace.c | 17 +++++++++++++++++
+ src/meson.build | 9 ++++++---
+ 5 files changed, 31 insertions(+), 3 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 536cd97..d7b0eb5 100644
+--- a/meson.build
++++ b/meson.build
+@@ -25,6 +25,7 @@ config_h.set_quoted('PKG_NAME', get_option('package'))
+ config_h.set_quoted('PKG_DISTRIBUTOR', get_option('distributor'))
+ config_h.set10('IS_OFFICIAL', get_option('official'))
+ config_h.set10('IS_DEVEL', get_option('development'))
++config_h.set10('WITH_BACKTRACE', get_option('backtrace'))
+ configure_file(
+ output: 'exm-config.h',
+ configuration: config_h,
+diff --git a/meson_options.txt b/meson_options.txt
+index b604dda..3f54b77 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -8,6 +8,11 @@ option('official',
+ value: false,
+ description: 'Whether this is an official upstream package')
+
++option('backtrace',
++ type: 'boolean',
++ value: true,
++ description: 'Whether the package is built with backtrace support')
++
+ # Will be shown in error messages
+ option('package',
+ type: 'string',
+diff --git a/src/exm-application.c b/src/exm-application.c
+index 5b56295..d062627 100644
+--- a/src/exm-application.c
++++ b/src/exm-application.c
+@@ -201,11 +201,13 @@ exm_application_show_about (GSimpleAction *action,
+ GTK_LICENSE_MPL_2_0,
+ NULL);
+
++#if WITH_BACKTRACE
+ adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about_window),
+ "libbacktrace",
+ "Copyright (C) 2012-2016 Free Software Foundation, Inc.",
+ GTK_LICENSE_BSD_3,
+ NULL);
++#endif
+
+ adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about_window),
+ "blueprint",
+diff --git a/src/exm-backtrace.c b/src/exm-backtrace.c
+index 4951394..3cf09b7 100644
+--- a/src/exm-backtrace.c
++++ b/src/exm-backtrace.c
+@@ -18,15 +18,21 @@
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
++#include "exm-config.h"
++
+ #include "exm-backtrace.h"
+
+ #include <glib.h>
+ #include <stdint.h>
+
++#if WITH_BACKTRACE
+ #include <backtrace-supported.h>
+ #include <backtrace.h>
++#endif
+
++#if WITH_BACKTRACE
+ static struct backtrace_state *state = NULL;
++#endif
+
+ static void
+ exm_backtrace_error_cb (void *data,
+@@ -54,6 +60,8 @@ exm_backtrace_full_cb (GString *string_builder,
+ void
+ exm_backtrace_init (char *filename)
+ {
++#if WITH_BACKTRACE
++
+ #ifdef BACKTRACE_SUPPORTED
+ state = backtrace_create_state (filename, 0,
+ exm_backtrace_error_cb,
+@@ -61,11 +69,16 @@ exm_backtrace_init (char *filename)
+ #else
+ g_warning ("Backtraces are not supported.\n");
+ #endif
++
++#else
++ g_warning ("Backtraces were not enabled at build time.\n");
++#endif
+ }
+
+ char *
+ exm_backtrace_print ()
+ {
++#if WITH_BACKTRACE
+ GString *string_builder;
+
+ if (!state)
+@@ -82,4 +95,8 @@ exm_backtrace_print ()
+ string_builder);
+
+ return g_string_free (string_builder, FALSE);
++#else
++ g_critical ("Backtraces were not enabled at build time.\n");
++ return NULL;
++#endif
+ }
+diff --git a/src/meson.build b/src/meson.build
+index 8599a8f..2adde2d 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -29,7 +29,7 @@ exm_sources = [
+ ]
+
+ cc = meson.get_compiler('c')
+-libbacktrace_dep = cc.find_library('backtrace', required: true)
++libbacktrace_dep = cc.find_library('backtrace', required: get_option('backtrace'))
+
+ exm_deps = [
+ dependency('gtk4'),
+@@ -37,10 +37,13 @@ exm_deps = [
+ dependency('gio-unix-2.0'),
+ dependency('json-glib-1.0'),
+ dependency('libsoup-3.0'),
+- dependency('text-engine-0.1'),
+- libbacktrace_dep
++ dependency('text-engine-0.1')
+ ]
+
++if libbacktrace_dep.found()
++ exm_deps += libbacktrace_dep
++endif
++
+ gnome = import('gnome')
+
+ subdir('local')
+--
+2.39.3
+