summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meson.build42
-rw-r--r--meson_options.txt8
-rw-r--r--sway/meson.build3
-rw-r--r--swaybar/meson.build5
-rw-r--r--swaybg/meson.build1
-rw-r--r--swaymsg/meson.build13
-rw-r--r--swaynag/meson.build1
7 files changed, 30 insertions, 43 deletions
diff --git a/meson.build b/meson.build
index 2285cbdf..bb1c4ddf 100644
--- a/meson.build
+++ b/meson.build
@@ -2,6 +2,7 @@ project(
2 'sway', 2 'sway',
3 'c', 3 'c',
4 license: 'MIT', 4 license: 'MIT',
5 meson_version: '>=0.48.0',
5 default_options: [ 6 default_options: [
6 'c_std=c11', 7 'c_std=c11',
7 'warning_level=2', 8 'warning_level=2',
@@ -45,37 +46,39 @@ xkbcommon = dependency('xkbcommon')
45cairo = dependency('cairo') 46cairo = dependency('cairo')
46pango = dependency('pango') 47pango = dependency('pango')
47pangocairo = dependency('pangocairo') 48pangocairo = dependency('pangocairo')
48gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) 49gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
49pixman = dependency('pixman-1') 50pixman = dependency('pixman-1')
50libevdev = dependency('libevdev') 51libevdev = dependency('libevdev')
51libinput = dependency('libinput', version: '>=1.6.0') 52libinput = dependency('libinput', version: '>=1.6.0')
52libpam = cc.find_library('pam', required: false)
53crypt = cc.find_library('crypt', required: false)
54systemd = dependency('libsystemd', required: false) 53systemd = dependency('libsystemd', required: false)
55elogind = dependency('libelogind', required: false) 54elogind = dependency('libelogind', required: false)
55xcb = dependency('xcb', required: get_option('xwayland'))
56math = cc.find_library('m') 56math = cc.find_library('m')
57rt = cc.find_library('rt') 57rt = cc.find_library('rt')
58git = find_program('git', required: false) 58git = find_program('git', required: false)
59 59
60conf_data = configuration_data() 60have_xwayland = xcb.found()
61 61
62conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) 62tray_deps_found = systemd.found() or elogind.found()
63if get_option('enable-xwayland') 63if get_option('tray').enabled() and not tray_deps_found
64 xcb = dependency('xcb') 64 error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found')
65endif 65endif
66have_tray = (not get_option('tray').disabled()) and tray_deps_found
67
68conf_data = configuration_data()
66 69
70conf_data.set10('HAVE_XWAYLAND', have_xwayland)
67conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) 71conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
68conf_data.set10('HAVE_SYSTEMD', systemd.found()) 72conf_data.set10('HAVE_SYSTEMD', systemd.found())
69conf_data.set10('HAVE_ELOGIND', elogind.found()) 73conf_data.set10('HAVE_ELOGIND', elogind.found())
70conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) 74conf_data.set10('HAVE_TRAY', have_tray)
71 75
72if not systemd.found() and not elogind.found() 76if not systemd.found() and not elogind.found()
73 warning('The sway binary must be setuid when compiled without (e)logind') 77 warning('The sway binary must be setuid when compiled without (e)logind')
74 warning('You must do this manually post-install: chmod a+s /path/to/sway') 78 warning('You must do this manually post-install: chmod a+s /path/to/sway')
75endif 79endif
76 80
77scdoc = find_program('scdoc', required: false) 81scdoc = find_program('scdoc', required: get_option('man-pages'))
78
79if scdoc.found() 82if scdoc.found()
80 sh = find_program('sh') 83 sh = find_program('sh')
81 mandir = get_option('mandir') 84 mandir = get_option('mandir')
@@ -123,17 +126,6 @@ else
123endif 126endif
124add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 127add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
125 128
126if get_option('use_rpath')
127 if get_option('custom_rpath') == ''
128 # default to platform specific libdir, one level up from the binary
129 rpathdir = join_paths('$ORIGIN', '..', '$LIB')
130 else
131 rpathdir = get_option('custom_rpath')
132 endif
133else
134 rpathdir = ''
135endif
136
137sway_inc = include_directories('include') 129sway_inc = include_directories('include')
138 130
139subdir('include') 131subdir('include')
@@ -180,7 +172,7 @@ install_data(
180 install_dir: datadir + '/wayland-sessions' 172 install_dir: datadir + '/wayland-sessions'
181) 173)
182 174
183if (get_option('default-wallpaper')) 175if get_option('default-wallpaper')
184 wallpaper_files = files( 176 wallpaper_files = files(
185 'assets/Sway_Wallpaper_Blue_768x1024.png', 177 'assets/Sway_Wallpaper_Blue_768x1024.png',
186 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png', 178 'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png',
@@ -196,7 +188,7 @@ if (get_option('default-wallpaper'))
196 install_data(wallpaper_files, install_dir: wallpaper_install_dir) 188 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
197endif 189endif
198 190
199if (get_option('zsh-completions')) 191if get_option('zsh-completions')
200 zsh_files = files( 192 zsh_files = files(
201 'completions/zsh/_sway', 193 'completions/zsh/_sway',
202 'completions/zsh/_swaymsg', 194 'completions/zsh/_swaymsg',
@@ -206,7 +198,7 @@ if (get_option('zsh-completions'))
206 install_data(zsh_files, install_dir: zsh_install_dir) 198 install_data(zsh_files, install_dir: zsh_install_dir)
207endif 199endif
208 200
209if (get_option('bash-completions')) 201if get_option('bash-completions')
210 bash_files = files( 202 bash_files = files(
211 'completions/bash/sway', 203 'completions/bash/sway',
212 'completions/bash/swaybar', 204 'completions/bash/swaybar',
@@ -217,7 +209,7 @@ if (get_option('bash-completions'))
217 install_data(bash_files, install_dir: bash_install_dir) 209 install_data(bash_files, install_dir: bash_install_dir)
218endif 210endif
219 211
220if (get_option('fish-completions')) 212if get_option('fish-completions')
221 fish_files = files( 213 fish_files = files(
222 'completions/fish/sway.fish', 214 'completions/fish/sway.fish',
223 'completions/fish/swaymsg.fish', 215 'completions/fish/swaymsg.fish',
diff --git a/meson_options.txt b/meson_options.txt
index 4640618e..04b29e17 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,9 +1,9 @@
1option('sway-version', type : 'string', description: 'The version string reported in `sway --version`.') 1option('sway-version', type : 'string', description: 'The version string reported in `sway --version`.')
2option('use_rpath', type: 'boolean', value: false, description: 'install binaries with rpath set')
3option('custom_rpath', type: 'string', value: '', description: 'override rpath with a custom one')
4option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') 2option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.')
5option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') 3option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.')
6option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') 4option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.')
7option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') 5option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.')
8option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications') 6option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
9option('enable-tray', type: 'boolean', value: false, description: 'Enable support for swaybar tray') 7option('tray', type: 'feature', value: 'auto', description: 'Enable support for swaybar tray')
8option('gdk-pixbuf', type: 'feature', value: 'auto', description: 'Enable support for more image formats in swaybg')
9option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
diff --git a/sway/meson.build b/sway/meson.build
index 0a08ee74..94d5abdb 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -194,7 +194,7 @@ sway_deps = [
194 xkbcommon, 194 xkbcommon,
195] 195]
196 196
197if get_option('enable-xwayland') 197if have_xwayland
198 sway_sources += 'desktop/xwayland.c' 198 sway_sources += 'desktop/xwayland.c'
199 sway_deps += xcb 199 sway_deps += xcb
200endif 200endif
@@ -205,6 +205,5 @@ executable(
205 include_directories: [sway_inc], 205 include_directories: [sway_inc],
206 dependencies: sway_deps, 206 dependencies: sway_deps,
207 link_with: [lib_sway_common], 207 link_with: [lib_sway_common],
208 install_rpath : rpathdir,
209 install: true 208 install: true
210) 209)
diff --git a/swaybar/meson.build b/swaybar/meson.build
index 312ca97b..b35f8169 100644
--- a/swaybar/meson.build
+++ b/swaybar/meson.build
@@ -1,4 +1,4 @@
1tray_files = get_option('enable-tray') ? [ 1tray_files = have_tray ? [
2 'tray/host.c', 2 'tray/host.c',
3 'tray/icon.c', 3 'tray/icon.c',
4 'tray/item.c', 4 'tray/item.c',
@@ -19,7 +19,7 @@ swaybar_deps = [
19 wayland_cursor, 19 wayland_cursor,
20 wlroots, 20 wlroots,
21] 21]
22if get_option('enable-tray') 22if have_tray
23 if systemd.found() 23 if systemd.found()
24 swaybar_deps += systemd 24 swaybar_deps += systemd
25 elif elogind.found() 25 elif elogind.found()
@@ -42,6 +42,5 @@ executable(
42 include_directories: [sway_inc], 42 include_directories: [sway_inc],
43 dependencies: swaybar_deps, 43 dependencies: swaybar_deps,
44 link_with: [lib_sway_common, lib_sway_client], 44 link_with: [lib_sway_common, lib_sway_client],
45 install_rpath : rpathdir,
46 install: true 45 install: true
47) 46)
diff --git a/swaybg/meson.build b/swaybg/meson.build
index 095c5488..8704de6d 100644
--- a/swaybg/meson.build
+++ b/swaybg/meson.build
@@ -14,6 +14,5 @@ executable(
14 wlroots, 14 wlroots,
15 ], 15 ],
16 link_with: [lib_sway_common, lib_sway_client], 16 link_with: [lib_sway_common, lib_sway_client],
17 install_rpath : rpathdir,
18 install: true 17 install: true
19) 18)
diff --git a/swaymsg/meson.build b/swaymsg/meson.build
index 7318349d..b78e6cb0 100644
--- a/swaymsg/meson.build
+++ b/swaymsg/meson.build
@@ -1,9 +1,8 @@
1executable( 1executable(
2 'swaymsg', 2 'swaymsg',
3 'main.c', 3 'main.c',
4 include_directories: [sway_inc], 4 include_directories: [sway_inc],
5 dependencies: [jsonc, wlroots], 5 dependencies: [jsonc, wlroots],
6 link_with: [lib_sway_common], 6 link_with: [lib_sway_common],
7 install_rpath : rpathdir, 7 install: true
8 install: true
9) 8)
diff --git a/swaynag/meson.build b/swaynag/meson.build
index 223a0bc7..2ba3ed95 100644
--- a/swaynag/meson.build
+++ b/swaynag/meson.build
@@ -19,6 +19,5 @@ executable(
19 wlroots, 19 wlroots,
20 ], 20 ],
21 link_with: [lib_sway_common, lib_sway_client], 21 link_with: [lib_sway_common, lib_sway_client],
22 install_rpath : rpathdir,
23 install: true 22 install: true
24) 23)