summary refs log tree commit diff stats
path: root/src/common/dbus/meson.build
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2018-02-18 04:44:59 -0500
committerPatrick Griffis <tingping@tingping.se>2018-02-18 04:44:59 -0500
commit8aa3b0326146840b7c01c4d353b5526c3e2a07f4 (patch)
tree9a2714b847bfda8c7f88b202ba226db4e10ffbb2 /src/common/dbus/meson.build
parent23c7e7c3dac420788c23470c5161ab1ecd13bac8 (diff)
dbus: Add option to use app-id for bus name
This is required for Flatpak but is an API break so it is opt-in
for now.
Diffstat (limited to 'src/common/dbus/meson.build')
-rw-r--r--src/common/dbus/meson.build14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/common/dbus/meson.build b/src/common/dbus/meson.build
index 56443377..69066be0 100644
--- a/src/common/dbus/meson.build
+++ b/src/common/dbus/meson.build
@@ -14,11 +14,22 @@ dbus_includes = [
 
 dbus_service_dir = join_paths(get_option('datadir'), 'dbus-1/services')
 
+if get_option('dbus-service-use-appid')
+  dbus_service_name = 'io.github.Hexchat'
+  dbus_output_file = 'io.github.Hexchat.service'
+  dbus_cargs = '-DDBUS_SERVICE="io.github.Hexchat"'
+else
+  dbus_service_name = 'org.hexchat.service'
+  dbus_output_file = 'org.hexchat.service.service'
+  dbus_cargs = '-DDBUS_SERVICE="org.hexchat.service"'
+endif
+
 dbus_conf = configuration_data()
 dbus_conf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
+dbus_conf.set('service_name', dbus_service_name)
 configure_file(
   input: 'org.hexchat.service.service.in',
-  output: 'org.hexchat.service.service',
+  output: dbus_output_file,
   configuration: dbus_conf,
   install: true,
   install_dir: dbus_service_dir
@@ -34,6 +45,7 @@ dbus_remote_object = custom_target('remote-object-glue',
 
 hexchat_dbus = static_library('hexchatdbus',
   sources: [dbus_remote_object, marshal] + dbus_sources,
+  c_args: dbus_cargs,
   dependencies: common_deps + dbus_deps,
   include_directories: dbus_includes,
   pic: true