[gvfs] build: Enable elogind support in meson



commit 1e9d338fe10f501cd9a6c9cdb2192755ba2b9bd9
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Wed Oct 25 12:47:08 2017 +0200

    build: Enable elogind support in meson
    
    This patch adds support for elogind in meson, which is systemd-login
    extracted as a standalone package.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788707

 meson.build                        |   13 +++++++++----
 meson_options.txt                  |    2 +-
 monitor/udisks2/gvfsudisks2utils.c |    2 +-
 monitor/udisks2/meson.build        |    4 ++--
 4 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1782838..b3e52ea 100644
--- a/meson.build
+++ b/meson.build
@@ -362,11 +362,16 @@ if enable_udisks2
 endif
 
 # *** Check for libsystemd-login ***
-enable_libsystemd_login = get_option('enable-libsystemd-login')
-if enable_libsystemd_login
-  libsystemd_login_dep = dependency('libsystemd')
+enable_logind = get_option('enable-logind')
+if enable_logind
+  logind_dep = dependency('libsystemd', required: false)
+  if not logind_dep.found()
+    logind_dep = dependency('libelogind', version: '>= 229', required: false)
+  endif
+
+  assert(logind_dep.found(), 'logind requested but libsystemd nor libelogind not found')
 endif
-config_h.set('HAVE_LIBSYSTEMD_LOGIN', enable_libsystemd_login)
+config_h.set('HAVE_LOGIND', enable_logind)
 
 # *** Check if we should build with AFC backend ***
 enable_afc = get_option('enable-afc')
diff --git a/meson_options.txt b/meson_options.txt
index 38b62df..3b2d755 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -24,7 +24,7 @@ option('enable-fuse', type: 'boolean', value: true, description: 'build with fus
 option('enable-gcr', type: 'boolean', value: true, description: 'build with gcr certificate support')
 option('enable-gudev', type: 'boolean', value: true, description: 'build with gudev device support')
 option('enable-keyring', type: 'boolean', value: true, description: 'build with keyring support')
-option('enable-libsystemd-login', type: 'boolean', value: true, description: 'build with logind support')
+option('enable-logind', type: 'boolean', value: true, description: 'build with logind support')
 option('enable-libusb', type: 'boolean', value: true, description: 'build with libusb interruption support')
 option('enable-udev', type: 'boolean', value: true, description: 'build with libudev device support')
 
diff --git a/monitor/udisks2/gvfsudisks2utils.c b/monitor/udisks2/gvfsudisks2utils.c
index 26d76b9..07be695 100644
--- a/monitor/udisks2/gvfsudisks2utils.c
+++ b/monitor/udisks2/gvfsudisks2utils.c
@@ -530,7 +530,7 @@ gvfs_udisks2_utils_spawn_finish (GAsyncResult   *res,
 
 /* ---------------------------------------------------------------------------------------------------- */
 
-#if defined(HAVE_LIBSYSTEMD_LOGIN)
+#if defined(HAVE_LOGIND)
 #include <systemd/sd-login.h>
 
 static const gchar *
diff --git a/monitor/udisks2/meson.build b/monitor/udisks2/meson.build
index 995b300..50c928a 100644
--- a/monitor/udisks2/meson.build
+++ b/monitor/udisks2/meson.build
@@ -44,8 +44,8 @@ deps = glib_deps + [
   libgvfsproxyvolumemonitordaemon_noin_dep
 ]
 
-if enable_libsystemd_login
-  deps += libsystemd_login_dep
+if enable_logind
+  deps += logind_dep
 endif
 
 if enable_keyring


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