[tracker/wip/carlosg/portal: 1/16] build: restore dbus/systemd options



commit 54cb80111cdbb07792abc0b7ff09edd682be43bd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 5 12:58:26 2020 +0100

    build: restore dbus/systemd options
    
    These options were cleaned up but will be good to have again for
    the portal service. While at it, split the systemd setting into
    a boolean to enable or disable the feature, and a string option
    to specify the user units path.

 meson.build       | 28 ++++++++++++++++++++++++++++
 meson_options.txt |  6 ++++++
 2 files changed, 34 insertions(+)
---
diff --git a/meson.build b/meson.build
index 2226fb930..2435cd2ea 100644
--- a/meson.build
+++ b/meson.build
@@ -174,6 +174,34 @@ if unicode_library_name == ''
   endif
 endif
 
+####################################################################
+# D-Bus service files
+####################################################################
+
+if get_option('dbus_services') == ''
+  dbus_services_dir = dbus.get_pkgconfig_variable('session_bus_services_dir',
+                                                  define_variable: [ 'datadir', datadir ])
+else
+  dbus_services_dir = get_option('dbus_services')
+endif
+
+####################################################################
+# systemd user services
+####################################################################
+
+install_systemd_user_services = get_option('systemd')
+if install_systemd_user_services
+  systemd = dependency('systemd', required: true)
+
+  if get_option('systemd_user_services_dir') == ''
+    # FIXME: this would ideally use the systemduserunitdir pkgconfig variable, but
+    # it does not depend on variables we can override to install within prefix.
+    systemd_user_services_dir = join_paths(libdir, 'systemd', 'user')
+  else
+    systemd_user_services_dir = get_option('systemd_user_services_dir')
+  endif
+endif
+
 ####################################################################
 # bash-completion
 ####################################################################
diff --git a/meson_options.txt b/meson_options.txt
index e29aaaa84..a45eb05f8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -18,6 +18,12 @@ option('bash_completion', type: 'boolean', value: true,
        description: 'Whether to install Bash completion files')
 option('bash_completion_dir', type: 'string',
        description: 'Directory to install Bash completion files')
+option('dbus_services_dir', type: 'string', value: '',
+       description: 'Directory to install D-Bus .service files (or empty to use default)')
+option('systemd', type: 'boolean', value: 'true',
+       description: 'Whether to install systemd unit files')
+option('systemd_user_services_dir', type: 'string', value: '',
+       description: 'Directory to install systemd user unit files (or empty to use default)')
 option('test_utils', type: 'boolean', value: true,
        description: 'Whether to install the trackertestutils Python package')
 option('test_utils_dir', type: 'string', value: '',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]