summaryrefslogtreecommitdiff
path: root/app-accessibility/at-spi2-core/files/at-spi2-core-2.48.2-more-build-fixes.patch
blob: 1508bb88c6be647abb9b3d7dd8bb9fd6e736f363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
https://bugs.gentoo.org/906235
https://gitlab.gnome.org/GNOME/at-spi2-core/-/commit/eaf7a1c931bc9a2016ac23a856bee7c7176de823

From eaf7a1c931bc9a2016ac23a856bee7c7176de823 Mon Sep 17 00:00:00 2001
From: Mike Gorse <mgorse@suse.com>
Date: Thu, 11 May 2023 15:18:54 -0500
Subject: [PATCH] More build fixes

My last commit broke the build where dbus-daemon was set to be used by default.

Added a use_systemd option that can be set to false to disable systemd. This
cannot be used in combination with dbus-broker and results in dbus-broker
support being disabled. If this option is left set to true, then dbus-broker
support will be enabled if dbus-broker-launch is found on the system, although
dbus-daemon will still be used when available unless default_bus is set to
dbus-broker.

Fixes #116
--- a/bus/meson.build
+++ b/bus/meson.build
@@ -47,7 +47,7 @@ launcher_args = [
            ]
 
 if get_option('dbus_daemon') != 'default'
-  launcher_args += '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon'))
+  dbus_daemon_arg = '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon'))
 else
   dbus_daemon = find_program('dbus-daemon',
                              '/sbin/dbus-daemon',
@@ -58,37 +58,58 @@ else
                              '/usr/pkg/bin/dbus-daemon',
                              required: false)
   if dbus_daemon.found()
-    launcher_args += '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.full_path())
+    dbus_daemon_arg = '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.full_path())
+  else
+    dbus_daemon_arg = ''
   endif
 endif
 
 needs_systemd = false
 if get_option('dbus_broker') != 'default'
-  launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker'))
-  if get_option('default_bus') != 'dbus-daemon'
-    needs_systemd = true
-  endif
+  dbus_broker_arg = '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker'))
+  needs_systemd = true
 else
   dbus_broker = find_program('dbus-broker-launch',
                              required: false)
   if dbus_broker.found()
-    launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.full_path())
+    dbus_broker_arg = '-DDBUS_BROKER="@0@"'.format(dbus_broker.full_path())
     if get_option('default_bus') != 'dbus-daemon'
       needs_systemd = true
     endif
   endif
 endif
 
-if get_option('default_bus') == 'dbus-broker'
-  launcher_args += '-DWANT_DBUS_BROKER'
+if not get_option('use_systemd')
+  if needs_systemd
+    error('Systemd is required for dbus-broker, but use_systemd is set to false.')
+  endif
+  dbus_broker_arg = ''
 endif
 
-if needs_systemd
-  systemd_dep = dependency('libsystemd')
+if dbus_broker_arg != ''
+  if needs_systemd
+    systemd_dep = dependency('libsystemd')
+  else
+    systemd_dep = dependency('libsystemd', required: false)
+    if not systemd_dep.found()
+      dbus_broker_arg = ''
+    endif
+  endif
 else
   systemd_dep = dependency('', required: false)
 endif
 
+if dbus_daemon_arg != ''
+  launcher_args += dbus_daemon_arg
+endif
+if dbus_broker_arg != ''
+  launcher_args += dbus_broker_arg
+endif
+
+if get_option('default_bus') == 'dbus-broker'
+  launcher_args += '-DWANT_DBUS_BROKER'
+endif
+
 executable('at-spi-bus-launcher', 'at-spi-bus-launcher.c',
            include_directories: [ root_inc, include_directories('.') ],
            dependencies: [ gio_dep, systemd_dep, x11_deps ],
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -15,6 +15,10 @@ option('default_bus',
        type: 'combo',
        choices: ['dbus-daemon', 'dbus-broker'],
        value: 'dbus-daemon')
+option('use_systemd',
+       description: 'Use systemd if available (needed for dbus-broker)',
+       type: 'boolean',
+       value: true)
 option('systemd_user_dir',
        description: 'Location of the systemd user services',
        type: 'string',
-- 
GitLab