0001-meson-Avoid-requiring-libsystemd-when-configured-to-.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From aeb14ffccaabe65a64e976576d71f30eb2165f43 Mon Sep 17 00:00:00 2001
  2. From: Adrian Perez de Castro <aperez@igalia.com>
  3. Date: Mon, 24 Apr 2023 12:09:50 +0300
  4. Subject: [PATCH] meson: Avoid requiring libsystemd when configured to use
  5. dbus-daemon
  6. Checks for dbus-daemon and dbus-broker only when they are chosen
  7. with default_bus. This avoids requiring the systemd libraries if
  8. one wants the built at-spi2-core to use dbus-daemon, but dbus-worker
  9. is somehow available in the $PATH. A typical scenario is cross
  10. compilation, where the build host may have a dbus-broker program
  11. available, but the target system may not have it (or may not have
  12. nor want to use the systemd libraries).
  13. Upstream: https://gitlab.gnome.org/GNOME/at-spi2-core/-/merge_requests/134
  14. Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
  15. ---
  16. bus/meson.build | 53 ++++++++++++++++++++++++-------------------------
  17. 1 file changed, 26 insertions(+), 27 deletions(-)
  18. diff --git a/bus/meson.build b/bus/meson.build
  19. index 22a1bce6..2f3c5621 100644
  20. --- a/bus/meson.build
  21. +++ b/bus/meson.build
  22. @@ -46,39 +46,38 @@ launcher_args = [
  23. '-DDATADIR="@0@"'.format(atspi_datadir),
  24. ]
  25. -if get_option('dbus_daemon') != 'default'
  26. - launcher_args += '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon'))
  27. -else
  28. - dbus_daemon = find_program('dbus-daemon',
  29. - '/sbin/dbus-daemon',
  30. - '/usr/sbin/dbus-daemon',
  31. - '/libexec/dbus-daemon',
  32. - '/usr/libexec/dbus-daemon',
  33. - '/usr/lib/dbus-daemon',
  34. - '/usr/pkg/bin/dbus-daemon',
  35. - required: false)
  36. - if dbus_daemon.found()
  37. - launcher_args += '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.full_path())
  38. - endif
  39. -endif
  40. -
  41. needs_systemd = false
  42. -if get_option('dbus_broker') != 'default'
  43. - launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker'))
  44. - needs_systemd = true
  45. +if get_option('default_bus') == 'dbus-daemon'
  46. + if get_option('dbus_daemon') != 'default'
  47. + launcher_args += '-DDBUS_DAEMON="@0@"'.format(get_option('dbus_daemon'))
  48. + else
  49. + dbus_daemon = find_program('dbus-daemon',
  50. + '/sbin/dbus-daemon',
  51. + '/usr/sbin/dbus-daemon',
  52. + '/libexec/dbus-daemon',
  53. + '/usr/libexec/dbus-daemon',
  54. + '/usr/lib/dbus-daemon',
  55. + '/usr/pkg/bin/dbus-daemon',
  56. + required: false)
  57. + if dbus_daemon.found()
  58. + launcher_args += '-DDBUS_DAEMON="@0@"'.format(dbus_daemon.full_path())
  59. + endif
  60. + endif
  61. else
  62. - dbus_broker = find_program('dbus-broker-launch',
  63. - required: false)
  64. - if dbus_broker.found()
  65. - launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.full_path())
  66. + launcher_args += '-DWANT_DBUS_BROKER'
  67. + if get_option('dbus_broker') != 'default'
  68. + launcher_args += '-DDBUS_BROKER="@0@"'.format(get_option('dbus_broker'))
  69. needs_systemd = true
  70. + else
  71. + dbus_broker = find_program('dbus-broker-launch',
  72. + required: false)
  73. + if dbus_broker.found()
  74. + launcher_args += '-DDBUS_BROKER="@0@"'.format(dbus_broker.full_path())
  75. + needs_systemd = true
  76. + endif
  77. endif
  78. endif
  79. -if get_option('default_bus') == 'dbus-broker'
  80. - launcher_args += '-DWANT_DBUS_BROKER'
  81. -endif
  82. -
  83. if needs_systemd
  84. systemd_dep = dependency('libsystemd')
  85. else
  86. --
  87. 2.34.1