summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-28 12:18:54 +0200
committerDrew DeVault <sir@cmpwn.com>2018-09-28 13:53:01 +0200
commit64259db8d6049e19ea8a5fee7f7baeeeacdde517 (patch)
tree52ba50631bf8e6e2c05e39c572dd4407976fa308 /meson.build
parent1ba79a159e1808630dcd2541fee4772e525725ed (diff)
Add support for building swaylock without PAM
This involves setuid'ing swaylock, which then forks and drops perms on the parent process. The child process remains root and listens on a pipe for requests to validate passwords against /etc/shadow.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build50
1 files changed, 31 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index 675b8c6..6c87d17 100644
--- a/meson.build
+++ b/meson.build
@@ -1,25 +1,37 @@
sysconfdir = get_option('sysconfdir')
-executable(
- 'swaylock', [
- 'main.c',
- 'password.c',
- 'render.c',
- 'seat.c'
- ],
+dependencies = [
+ cairo,
+ client_protos,
+ gdk_pixbuf,
+ math,
+ pango,
+ pangocairo,
+ xkbcommon,
+ wayland_client,
+ wlroots,
+]
+
+sources = [
+ 'main.c',
+ 'password.c',
+ 'render.c',
+ 'seat.c'
+]
+
+if libpam.found()
+ sources += ['pam.c']
+ dependencies += [libpam]
+else
+ warning('The swaylock binary must be setuid when compiled without libpam')
+ warning('You must do this manually post-install: chmod a+s /path/to/swaylock')
+ sources += ['shadow.c']
+endif
+
+executable('swaylock',
+ sources,
include_directories: [sway_inc],
- dependencies: [
- cairo,
- client_protos,
- gdk_pixbuf,
- libpam,
- math,
- pango,
- pangocairo,
- xkbcommon,
- wayland_client,
- wlroots,
- ],
+ dependencies: dependencies,
link_with: [lib_sway_common, lib_sway_client],
install: true
)