From fbf7caad32998ebaf1b84fb33ebe5c4a34fa7a5e Mon Sep 17 00:00:00 2001
From: Treeve Jelbert <treeve@sourcemage.org>
Date: Sat, 26 Jun 2021 14:41:59 +0200
Subject: [PATCH 1/2] support elogind instead of systemd

---
 libweston/launcher-logind.c | 2 +-
 libweston/meson.build       | 6 +++---
 libweston/weston-launch.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
index 3fca1dff..c930adbe 100644
--- a/libweston/launcher-logind.c
+++ b/libweston/launcher-logind.c
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
-#include <systemd/sd-login.h>
+#include <elogind/sd-login.h>
 #include <unistd.h>
 
 #include <libweston/libweston.h>
diff --git a/libweston/meson.build b/libweston/meson.build
index 257d6950..029ada45 100644
--- a/libweston/meson.build
+++ b/libweston/meson.build
@@ -156,13 +156,13 @@ endif
 
 systemd_dep = dependency('', required: false)
 if get_option('launcher-logind')
-	systemd_dep = dependency('libsystemd', version: '>= 209', required: false)
+	systemd_dep = dependency('libelogind', version: '>= 209', required: false)
 	if systemd_dep.found()
 		config_h.set('HAVE_SYSTEMD_LOGIN_209', '1')
 	else
-		systemd_dep = dependency('libsystemd-login', version: '>= 198', required: false)
+#		systemd_dep = dependency('libsystemd-login', version: '>= 198', required: false)
 		if not systemd_dep.found()
-			error('logind support requires libsystemd or libsystemd-login but neither was found. Or, you can use \'-Dlauncher-logind=false\'')
+			error('logind support requires elogind but it was found. Or, you can use \'-Dlauncher-logind=false\'')
 		endif
 	endif
 
diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index c43ed7b2..db389318 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -54,7 +54,7 @@
 #include <security/pam_appl.h>
 
 #ifdef HAVE_SYSTEMD_LOGIN
-#include <systemd/sd-login.h>
+#include <elogind/sd-login.h>
 #endif
 
 #include "weston-launch.h"
-- 
2.35.1

