diff options
-rw-r--r-- | meson.build | 42 | ||||
-rw-r--r-- | meson_options.txt | 8 | ||||
-rw-r--r-- | sway/meson.build | 3 | ||||
-rw-r--r-- | swaybar/meson.build | 5 | ||||
-rw-r--r-- | swaybg/meson.build | 1 | ||||
-rw-r--r-- | swaymsg/meson.build | 13 | ||||
-rw-r--r-- | swaynag/meson.build | 1 |
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') | |||
45 | cairo = dependency('cairo') | 46 | cairo = dependency('cairo') |
46 | pango = dependency('pango') | 47 | pango = dependency('pango') |
47 | pangocairo = dependency('pangocairo') | 48 | pangocairo = dependency('pangocairo') |
48 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: false) | 49 | gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf')) |
49 | pixman = dependency('pixman-1') | 50 | pixman = dependency('pixman-1') |
50 | libevdev = dependency('libevdev') | 51 | libevdev = dependency('libevdev') |
51 | libinput = dependency('libinput', version: '>=1.6.0') | 52 | libinput = dependency('libinput', version: '>=1.6.0') |
52 | libpam = cc.find_library('pam', required: false) | ||
53 | crypt = cc.find_library('crypt', required: false) | ||
54 | systemd = dependency('libsystemd', required: false) | 53 | systemd = dependency('libsystemd', required: false) |
55 | elogind = dependency('libelogind', required: false) | 54 | elogind = dependency('libelogind', required: false) |
55 | xcb = dependency('xcb', required: get_option('xwayland')) | ||
56 | math = cc.find_library('m') | 56 | math = cc.find_library('m') |
57 | rt = cc.find_library('rt') | 57 | rt = cc.find_library('rt') |
58 | git = find_program('git', required: false) | 58 | git = find_program('git', required: false) |
59 | 59 | ||
60 | conf_data = configuration_data() | 60 | have_xwayland = xcb.found() |
61 | 61 | ||
62 | conf_data.set10('HAVE_XWAYLAND', get_option('enable-xwayland')) | 62 | tray_deps_found = systemd.found() or elogind.found() |
63 | if get_option('enable-xwayland') | 63 | if 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') |
65 | endif | 65 | endif |
66 | have_tray = (not get_option('tray').disabled()) and tray_deps_found | ||
67 | |||
68 | conf_data = configuration_data() | ||
66 | 69 | ||
70 | conf_data.set10('HAVE_XWAYLAND', have_xwayland) | ||
67 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) | 71 | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found()) |
68 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) | 72 | conf_data.set10('HAVE_SYSTEMD', systemd.found()) |
69 | conf_data.set10('HAVE_ELOGIND', elogind.found()) | 73 | conf_data.set10('HAVE_ELOGIND', elogind.found()) |
70 | conf_data.set10('HAVE_TRAY', get_option('enable-tray') and (systemd.found() or elogind.found())) | 74 | conf_data.set10('HAVE_TRAY', have_tray) |
71 | 75 | ||
72 | if not systemd.found() and not elogind.found() | 76 | if 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') |
75 | endif | 79 | endif |
76 | 80 | ||
77 | scdoc = find_program('scdoc', required: false) | 81 | scdoc = find_program('scdoc', required: get_option('man-pages')) |
78 | |||
79 | if scdoc.found() | 82 | if 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 | |||
123 | endif | 126 | endif |
124 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') | 127 | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') |
125 | 128 | ||
126 | if 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 | ||
133 | else | ||
134 | rpathdir = '' | ||
135 | endif | ||
136 | |||
137 | sway_inc = include_directories('include') | 129 | sway_inc = include_directories('include') |
138 | 130 | ||
139 | subdir('include') | 131 | subdir('include') |
@@ -180,7 +172,7 @@ install_data( | |||
180 | install_dir: datadir + '/wayland-sessions' | 172 | install_dir: datadir + '/wayland-sessions' |
181 | ) | 173 | ) |
182 | 174 | ||
183 | if (get_option('default-wallpaper')) | 175 | if 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) |
197 | endif | 189 | endif |
198 | 190 | ||
199 | if (get_option('zsh-completions')) | 191 | if 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) |
207 | endif | 199 | endif |
208 | 200 | ||
209 | if (get_option('bash-completions')) | 201 | if 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) |
218 | endif | 210 | endif |
219 | 211 | ||
220 | if (get_option('fish-completions')) | 212 | if 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 @@ | |||
1 | option('sway-version', type : 'string', description: 'The version string reported in `sway --version`.') | 1 | option('sway-version', type : 'string', description: 'The version string reported in `sway --version`.') |
2 | option('use_rpath', type: 'boolean', value: false, description: 'install binaries with rpath set') | ||
3 | option('custom_rpath', type: 'string', value: '', description: 'override rpath with a custom one') | ||
4 | option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') | 2 | option('default-wallpaper', type: 'boolean', value: true, description: 'Install the default wallpaper.') |
5 | option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') | 3 | option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') |
6 | option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') | 4 | option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') |
7 | option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') | 5 | option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.') |
8 | option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support for X11 applications') | 6 | option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') |
9 | option('enable-tray', type: 'boolean', value: false, description: 'Enable support for swaybar tray') | 7 | option('tray', type: 'feature', value: 'auto', description: 'Enable support for swaybar tray') |
8 | option('gdk-pixbuf', type: 'feature', value: 'auto', description: 'Enable support for more image formats in swaybg') | ||
9 | option('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 | ||
197 | if get_option('enable-xwayland') | 197 | if have_xwayland |
198 | sway_sources += 'desktop/xwayland.c' | 198 | sway_sources += 'desktop/xwayland.c' |
199 | sway_deps += xcb | 199 | sway_deps += xcb |
200 | endif | 200 | endif |
@@ -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 @@ | |||
1 | tray_files = get_option('enable-tray') ? [ | 1 | tray_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 | ] |
22 | if get_option('enable-tray') | 22 | if 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 @@ | |||
1 | executable( | 1 | executable( |
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 | ) |