From c16f69a98d3cfa52eae7f650cd2adfe95f5dea87 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Sun, 12 Jun 2022 23:23:49 +0200 Subject: meson: Install DBus services in the correct prefix We should use the pkg-config variable of the `dbus-1` package to check where we should install our D-Bus services, but we also need to make sure we don't pollute anything outside of $prefix, so make sure to get that case as well. --- gcr/meson.build | 2 +- meson.build | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcr/meson.build b/gcr/meson.build index 745dade..88428ee 100644 --- a/gcr/meson.build +++ b/gcr/meson.build @@ -311,7 +311,7 @@ foreach service_file : gcr_service_files configuration: { 'libexecdir': gcr_prefix / get_option('libexecdir'), }, - install_dir: get_option('datadir') / 'dbus-1' / 'services', + install_dir: dbus_services_dir, ) endforeach diff --git a/meson.build b/meson.build index c3d9ba3..a1e0882 100644 --- a/meson.build +++ b/meson.build @@ -73,6 +73,15 @@ if libsystemd.found() and systemd.found() with_systemd = true endif +dbus_dep = dependency('dbus-1', required: false) +if dbus_dep.found() + dbus_services_dir = dbus_dep.get_variable('session_bus_services_dir', + pkgconfig_define: [ 'datadir', get_option('datadir') ], + ) +else + dbus_services_dir = get_option('datadir') / 'dbus-1' / 'services' +endif + if get_option('gtk3') gtk3_min_version = '3.22' gtk3_dep = dependency('gtk+-3.0', version: '>=' + gtk3_min_version) -- cgit v1.2.1