| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | project(
 | 
					
						
							|  |  |  | 	'sway',
 | 
					
						
							|  |  |  | 	'c',
 | 
					
						
							| 
									
										
										
										
											2020-07-16 13:31:13 +02:00
										 |  |  | 	version: '1.5', #release_version
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | 	license: 'MIT',
 | 
					
						
							| 
									
										
										
										
											2020-04-30 17:12:28 +02:00
										 |  |  | 	meson_version: '>=0.53.0',
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | 	default_options: [
 | 
					
						
							|  |  |  | 		'c_std=c11',
 | 
					
						
							|  |  |  | 		'warning_level=2',
 | 
					
						
							|  |  |  | 		'werror=true',
 | 
					
						
							|  |  |  | 	],
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-12 22:23:06 +01:00
										 |  |  | add_project_arguments(
 | 
					
						
							|  |  |  | 	[
 | 
					
						
							|  |  |  | 		'-DWLR_USE_UNSTABLE',
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		'-Wno-unused-parameter',
 | 
					
						
							|  |  |  | 		'-Wno-unused-result',
 | 
					
						
							| 
									
										
										
										
											2019-11-17 17:16:13 +01:00
										 |  |  | 		'-Wno-missing-braces',
 | 
					
						
							| 
									
										
										
										
											2018-11-12 22:23:06 +01:00
										 |  |  | 		'-Wundef',
 | 
					
						
							| 
									
										
										
										
											2019-01-16 01:57:53 +00:00
										 |  |  | 		'-Wvla',
 | 
					
						
							| 
									
										
										
										
											2018-11-12 22:23:06 +01:00
										 |  |  | 	],
 | 
					
						
							|  |  |  | 	language: 'c',
 | 
					
						
							|  |  |  | )
 | 
					
						
							| 
									
										
										
										
											2017-12-01 05:42:12 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | cc = meson.get_compiler('c')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | is_freebsd = host_machine.system().startswith('freebsd')
 | 
					
						
							|  |  |  | datadir = get_option('datadir')
 | 
					
						
							|  |  |  | sysconfdir = get_option('sysconfdir')
 | 
					
						
							|  |  |  | prefix = get_option('prefix')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-26 20:05:45 +02:00
										 |  |  | if is_freebsd
 | 
					
						
							|  |  |  | 	add_project_arguments('-D_C11_SOURCE', language: 'c')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 15:43:40 +00:00
										 |  |  | jsonc          = dependency('json-c', version: '>=0.13')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 03:41:51 -05:00
										 |  |  | pcre           = dependency('libpcre')
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | wayland_server = dependency('wayland-server')
 | 
					
						
							|  |  |  | wayland_client = dependency('wayland-client')
 | 
					
						
							| 
									
										
										
										
											2018-03-30 21:38:28 -04:00
										 |  |  | wayland_cursor = dependency('wayland-cursor')
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | wayland_egl    = dependency('wayland-egl')
 | 
					
						
							| 
									
										
										
										
											2018-05-19 08:47:47 +10:00
										 |  |  | wayland_protos = dependency('wayland-protocols', version: '>=1.14')
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | xkbcommon      = dependency('xkbcommon')
 | 
					
						
							| 
									
										
										
										
											2018-03-27 15:25:25 -04:00
										 |  |  | cairo          = dependency('cairo')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 03:41:51 -05:00
										 |  |  | pango          = dependency('pango')
 | 
					
						
							| 
									
										
										
										
											2018-03-27 15:25:25 -04:00
										 |  |  | pangocairo     = dependency('pangocairo')
 | 
					
						
							| 
									
										
										
										
											2019-01-18 08:21:43 +01:00
										 |  |  | gdk_pixbuf     = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
 | 
					
						
							| 
									
										
										
										
											2017-11-30 03:41:51 -05:00
										 |  |  | pixman         = dependency('pixman-1')
 | 
					
						
							| 
									
										
										
										
											2019-11-13 11:23:36 -07:00
										 |  |  | glesv2         = dependency('glesv2')
 | 
					
						
							| 
									
										
										
										
											2018-12-23 10:54:54 -05:00
										 |  |  | libevdev       = dependency('libevdev')
 | 
					
						
							| 
									
										
										
										
											2018-04-08 00:34:12 +01:00
										 |  |  | libinput       = dependency('libinput', version: '>=1.6.0')
 | 
					
						
							| 
									
										
										
										
											2019-01-21 12:56:32 +01:00
										 |  |  | systemd        = dependency('libsystemd', version: '>=239', required: false)
 | 
					
						
							|  |  |  | elogind        = dependency('libelogind', version: '>=239', required: false)
 | 
					
						
							| 
									
										
										
										
											2019-01-17 18:02:25 +01:00
										 |  |  | xcb            = dependency('xcb', required: get_option('xwayland'))
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | bash_comp      = dependency('bash-completion', required: false)
 | 
					
						
							|  |  |  | fish_comp      = dependency('fish', required: false)
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | math           = cc.find_library('m')
 | 
					
						
							| 
									
										
										
										
											2018-03-28 23:04:20 -04:00
										 |  |  | rt             = cc.find_library('rt')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 23:32:10 +01:00
										 |  |  | # Try first to find wlroots as a subproject, then as a system dependency
 | 
					
						
							| 
									
										
										
										
											2020-11-08 15:15:15 +01:00
										 |  |  | wlroots_version = ['>=0.12.0', '<0.13.0']
 | 
					
						
							| 
									
										
										
										
											2019-02-16 11:57:41 +01:00
										 |  |  | wlroots_proj = subproject(
 | 
					
						
							|  |  |  | 	'wlroots',
 | 
					
						
							| 
									
										
										
										
											2019-10-02 18:22:02 -06:00
										 |  |  | 	default_options: ['examples=false'],
 | 
					
						
							| 
									
										
										
										
											2019-02-16 11:57:41 +01:00
										 |  |  | 	required: false,
 | 
					
						
							| 
									
										
										
										
											2019-02-27 21:13:16 +01:00
										 |  |  | 	version: wlroots_version,
 | 
					
						
							| 
									
										
										
										
											2019-02-16 11:57:41 +01:00
										 |  |  | )
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | wlroots_features = {
 | 
					
						
							|  |  |  | 	'xwayland': false,
 | 
					
						
							|  |  |  | 	'systemd': false,
 | 
					
						
							|  |  |  | 	'elogind': false,
 | 
					
						
							|  |  |  | 	'libseat': false,
 | 
					
						
							|  |  |  | }
 | 
					
						
							| 
									
										
										
										
											2019-01-18 23:32:10 +01:00
										 |  |  | if wlroots_proj.found()
 | 
					
						
							|  |  |  | 	wlroots = wlroots_proj.get_variable('wlroots')
 | 
					
						
							|  |  |  | 	wlroots_conf = wlroots_proj.get_variable('conf_data')
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | 	foreach name, _ : wlroots_features
 | 
					
						
							|  |  |  | 		has = wlroots_conf.get('WLR_HAS_' + name.to_upper()) == 1
 | 
					
						
							|  |  |  | 		wlroots_features += { name: has }
 | 
					
						
							|  |  |  | 	endforeach
 | 
					
						
							| 
									
										
										
										
											2019-01-18 23:32:10 +01:00
										 |  |  | else
 | 
					
						
							| 
									
										
										
										
											2019-02-27 21:13:16 +01:00
										 |  |  | 	wlroots = dependency('wlroots', version: wlroots_version)
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | 	foreach name, _ : wlroots_features
 | 
					
						
							|  |  |  | 		has = cc.get_define('WLR_HAS_' + name.to_upper(), prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
 | 
					
						
							|  |  |  | 		wlroots_features += { name: has }
 | 
					
						
							|  |  |  | 	endforeach
 | 
					
						
							| 
									
										
										
										
											2019-01-18 23:32:10 +01:00
										 |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | if get_option('xwayland').enabled() and not wlroots_features['xwayland']
 | 
					
						
							| 
									
										
										
										
											2019-01-18 23:32:10 +01:00
										 |  |  | 	error('Cannot enable Xwayland in sway: wlroots has been built without Xwayland support')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | have_xwayland = xcb.found() and wlroots_features['xwayland']
 | 
					
						
							| 
									
										
										
										
											2018-03-28 12:21:50 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-17 18:02:25 +01:00
										 |  |  | tray_deps_found = systemd.found() or elogind.found()
 | 
					
						
							|  |  |  | if get_option('tray').enabled() and not tray_deps_found
 | 
					
						
							|  |  |  | 	error('Building with -Dtray=enabled, but libsystemd and libelogind have not been not found')
 | 
					
						
							| 
									
										
										
										
											2018-07-24 22:16:06 +02:00
										 |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2019-01-17 18:02:25 +01:00
										 |  |  | have_tray = (not get_option('tray').disabled()) and tray_deps_found
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | conf_data = configuration_data()
 | 
					
						
							| 
									
										
										
										
											2018-07-24 22:16:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-17 18:02:25 +01:00
										 |  |  | conf_data.set10('HAVE_XWAYLAND', have_xwayland)
 | 
					
						
							| 
									
										
										
										
											2018-11-18 00:33:06 +01:00
										 |  |  | conf_data.set10('HAVE_GDK_PIXBUF', gdk_pixbuf.found())
 | 
					
						
							|  |  |  | conf_data.set10('HAVE_SYSTEMD', systemd.found())
 | 
					
						
							|  |  |  | conf_data.set10('HAVE_ELOGIND', elogind.found())
 | 
					
						
							| 
									
										
										
										
											2019-01-17 18:02:25 +01:00
										 |  |  | conf_data.set10('HAVE_TRAY', have_tray)
 | 
					
						
							| 
									
										
										
										
											2018-04-17 09:54:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-04 10:25:34 -05:00
										 |  |  | scdoc = dependency('scdoc', version: '>=1.9.2', native: true, required: get_option('man-pages'))
 | 
					
						
							| 
									
										
										
										
											2018-05-11 08:39:46 -04:00
										 |  |  | if scdoc.found()
 | 
					
						
							| 
									
										
										
										
											2019-03-10 22:59:15 +01:00
										 |  |  | 	scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
 | 
					
						
							|  |  |  | 	sh = find_program('sh', native: true)
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 	mandir = get_option('mandir')
 | 
					
						
							|  |  |  | 	man_files = [
 | 
					
						
							| 
									
										
										
										
											2018-05-11 08:39:46 -04:00
										 |  |  | 		'sway/sway.1.scd',
 | 
					
						
							| 
									
										
										
										
											2018-05-11 20:58:34 -04:00
										 |  |  | 		'sway/sway.5.scd',
 | 
					
						
							| 
									
										
										
										
											2018-05-11 21:13:43 -04:00
										 |  |  | 		'sway/sway-bar.5.scd',
 | 
					
						
							| 
									
										
										
										
											2018-05-11 21:25:05 -04:00
										 |  |  | 		'sway/sway-input.5.scd',
 | 
					
						
							| 
									
										
										
										
											2019-02-27 13:23:10 -05:00
										 |  |  | 		'sway/sway-ipc.7.scd',
 | 
					
						
							| 
									
										
										
										
											2018-10-14 10:48:51 -04:00
										 |  |  | 		'sway/sway-output.5.scd',
 | 
					
						
							| 
									
										
										
										
											2019-05-30 02:58:46 -04:00
										 |  |  | 		'swaybar/swaybar-protocol.7.scd',
 | 
					
						
							| 
									
										
										
										
											2018-05-11 21:39:47 -04:00
										 |  |  | 		'swaymsg/swaymsg.1.scd',
 | 
					
						
							| 
									
										
										
										
											2018-07-27 11:19:42 -04:00
										 |  |  | 		'swaynag/swaynag.1.scd',
 | 
					
						
							| 
									
										
										
										
											2018-07-28 09:34:25 -04:00
										 |  |  | 		'swaynag/swaynag.5.scd',
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 	]
 | 
					
						
							|  |  |  | 	foreach filename : man_files
 | 
					
						
							|  |  |  | 		topic = filename.split('.')[-3].split('/')[-1]
 | 
					
						
							|  |  |  | 		section = filename.split('.')[-2]
 | 
					
						
							| 
									
										
										
										
											2018-05-11 08:39:46 -04:00
										 |  |  | 		output = '@0@.@1@'.format(topic, section)
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		custom_target(
 | 
					
						
							| 
									
										
										
										
											2018-05-11 08:39:46 -04:00
										 |  |  | 			output,
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 			input: filename,
 | 
					
						
							| 
									
										
										
										
											2018-05-11 08:39:46 -04:00
										 |  |  | 			output: output,
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 			command: [
 | 
					
						
							| 
									
										
										
										
											2019-02-27 22:19:53 +01:00
										 |  |  | 				sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:34:44 -05:00
										 |  |  | 			],
 | 
					
						
							|  |  |  | 			install: true,
 | 
					
						
							|  |  |  | 			install_dir: '@0@/man@1@'.format(mandir, section)
 | 
					
						
							|  |  |  | 		)
 | 
					
						
							|  |  |  | 	endforeach
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-23 23:14:59 +01:00
										 |  |  | add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
 | 
					
						
							| 
									
										
										
										
											2017-12-05 10:40:55 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-12 23:13:24 +01:00
										 |  |  | version = '"@0@"'.format(meson.project_version())
 | 
					
						
							| 
									
										
										
										
											2019-10-14 15:03:28 +03:00
										 |  |  | git = find_program('git', native: true, required: false)
 | 
					
						
							| 
									
										
										
										
											2019-02-05 14:32:05 +01:00
										 |  |  | if git.found()
 | 
					
						
							| 
									
										
										
										
											2019-10-14 15:03:28 +03:00
										 |  |  | 	git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'])
 | 
					
						
							|  |  |  | 	git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'])
 | 
					
						
							|  |  |  | 	if git_commit.returncode() == 0 and git_branch.returncode() == 0
 | 
					
						
							|  |  |  | 		version = '"@0@-@1@ (" __DATE__ ", branch \'@2@\')"'.format(
 | 
					
						
							|  |  |  | 			meson.project_version(),
 | 
					
						
							|  |  |  | 			git_commit.stdout().strip(),
 | 
					
						
							|  |  |  | 			git_branch.stdout().strip(),
 | 
					
						
							|  |  |  | 		)
 | 
					
						
							| 
									
										
										
										
											2019-02-12 23:13:24 +01:00
										 |  |  | 	endif
 | 
					
						
							| 
									
										
										
										
											2017-11-30 04:48:08 -05:00
										 |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2017-11-30 04:29:32 -05:00
										 |  |  | add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-22 23:13:19 -04:00
										 |  |  | # Compute the relative path used by compiler invocations.
 | 
					
						
							|  |  |  | source_root = meson.current_source_dir().split('/')
 | 
					
						
							|  |  |  | build_root = meson.build_root().split('/')
 | 
					
						
							|  |  |  | relative_dir_parts = []
 | 
					
						
							|  |  |  | i = 0
 | 
					
						
							|  |  |  | in_prefix = true
 | 
					
						
							|  |  |  | foreach p : build_root
 | 
					
						
							|  |  |  | 	if i >= source_root.length() or not in_prefix or p != source_root[i]
 | 
					
						
							|  |  |  | 		in_prefix = false
 | 
					
						
							|  |  |  | 		relative_dir_parts += '..'
 | 
					
						
							|  |  |  | 	endif
 | 
					
						
							|  |  |  | 	i += 1
 | 
					
						
							|  |  |  | endforeach
 | 
					
						
							|  |  |  | i = 0
 | 
					
						
							|  |  |  | in_prefix = true
 | 
					
						
							|  |  |  | foreach p : source_root
 | 
					
						
							|  |  |  | 	if i >= build_root.length() or not in_prefix or build_root[i] != p
 | 
					
						
							|  |  |  | 		in_prefix = false
 | 
					
						
							|  |  |  | 		relative_dir_parts += p
 | 
					
						
							|  |  |  | 	endif
 | 
					
						
							|  |  |  | 	i += 1
 | 
					
						
							|  |  |  | endforeach
 | 
					
						
							|  |  |  | relative_dir = join_paths(relative_dir_parts) + '/'
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Strip relative path prefixes from the code if possible, otherwise hide them.
 | 
					
						
							|  |  |  | if cc.has_argument('-fmacro-prefix-map=/prefix/to/hide=')
 | 
					
						
							|  |  |  | 	add_project_arguments(
 | 
					
						
							|  |  |  | 		'-fmacro-prefix-map=@0@='.format(relative_dir),
 | 
					
						
							|  |  |  | 		language: 'c',
 | 
					
						
							|  |  |  | 	)
 | 
					
						
							|  |  |  | else
 | 
					
						
							|  |  |  | 	add_project_arguments(
 | 
					
						
							|  |  |  | 		'-DSWAY_REL_SRC_DIR="@0@"'.format(relative_dir),
 | 
					
						
							|  |  |  | 		language: 'c',
 | 
					
						
							|  |  |  | 	)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-29 09:03:12 -05:00
										 |  |  | sway_inc = include_directories('include')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-28 12:21:50 -04:00
										 |  |  | subdir('include')
 | 
					
						
							| 
									
										
										
										
											2018-03-27 13:35:34 -04:00
										 |  |  | subdir('protocols')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 03:39:27 -05:00
										 |  |  | subdir('common')
 | 
					
						
							|  |  |  | subdir('sway')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:40:49 -05:00
										 |  |  | subdir('swaymsg')
 | 
					
						
							| 
									
										
										
										
											2018-03-28 23:04:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-27 15:25:25 -04:00
										 |  |  | subdir('client')
 | 
					
						
							| 
									
										
										
										
											2018-03-28 23:04:20 -04:00
										 |  |  | subdir('swaybar')
 | 
					
						
							| 
									
										
										
										
											2018-07-27 11:19:42 -04:00
										 |  |  | subdir('swaynag')
 | 
					
						
							| 
									
										
										
										
											2018-09-20 19:31:09 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | config = configuration_data()
 | 
					
						
							|  |  |  | config.set('datadir', join_paths(prefix, datadir))
 | 
					
						
							|  |  |  | config.set('prefix', prefix)
 | 
					
						
							| 
									
										
										
										
											2018-11-23 23:14:59 +01:00
										 |  |  | config.set('sysconfdir', join_paths(prefix, sysconfdir))
 | 
					
						
							| 
									
										
										
										
											2018-10-17 15:06:55 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | configure_file(
 | 
					
						
							|  |  |  | 	configuration: config,
 | 
					
						
							|  |  |  | 	input: 'config.in',
 | 
					
						
							|  |  |  | 	output: '@BASENAME@',
 | 
					
						
							| 
									
										
										
										
											2020-01-22 11:30:57 -05:00
										 |  |  | 	install_dir: join_paths(sysconfdir, 'sway')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | install_data(
 | 
					
						
							|  |  |  | 	'sway.desktop',
 | 
					
						
							| 
									
										
										
										
											2020-01-22 11:30:57 -05:00
										 |  |  | 	install_dir: join_paths(datadir, 'wayland-sessions')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 08:44:02 +01:00
										 |  |  | if get_option('default-wallpaper')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | 	wallpaper_files = files(
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_768x1024.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_768x1024_Portrait.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_1136x640.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_1136x640_Portrait.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_1366x768.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_1920x1080.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_2048x1536.png',
 | 
					
						
							|  |  |  | 		'assets/Sway_Wallpaper_Blue_2048x1536_Portrait.png',
 | 
					
						
							|  |  |  | 	)
 | 
					
						
							| 
									
										
										
										
											2020-01-22 11:30:57 -05:00
										 |  |  | 	wallpaper_install_dir = join_paths(datadir, 'backgrounds', 'sway')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 08:31:13 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	install_data(wallpaper_files, install_dir: wallpaper_install_dir)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:51:58 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 08:44:02 +01:00
										 |  |  | if get_option('zsh-completions')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:51:58 -05:00
										 |  |  | 	zsh_files = files(
 | 
					
						
							|  |  |  | 		'completions/zsh/_sway',
 | 
					
						
							|  |  |  | 		'completions/zsh/_swaymsg',
 | 
					
						
							|  |  |  | 	)
 | 
					
						
							| 
									
										
										
										
											2020-01-22 11:30:57 -05:00
										 |  |  | 	zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:51:58 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	install_data(zsh_files, install_dir: zsh_install_dir)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2018-07-27 17:50:33 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 08:44:02 +01:00
										 |  |  | if get_option('bash-completions')
 | 
					
						
							| 
									
										
										
										
											2018-07-27 17:50:33 +01:00
										 |  |  | 	bash_files = files(
 | 
					
						
							|  |  |  | 		'completions/bash/sway',
 | 
					
						
							| 
									
										
										
										
											2018-12-31 13:17:05 -05:00
										 |  |  | 		'completions/bash/swaybar',
 | 
					
						
							| 
									
										
										
										
											2018-07-27 17:50:33 +01:00
										 |  |  | 		'completions/bash/swaymsg',
 | 
					
						
							|  |  |  | 	)
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | 	if bash_comp.found()
 | 
					
						
							| 
									
										
										
										
											2020-03-29 10:06:48 +02:00
										 |  |  | 		bash_install_dir = bash_comp.get_pkgconfig_variable(
 | 
					
						
							|  |  |  | 			'completionsdir',
 | 
					
						
							|  |  |  | 			define_variable: ['datadir', datadir]
 | 
					
						
							|  |  |  | 		)
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | 	else
 | 
					
						
							|  |  |  | 		bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
 | 
					
						
							|  |  |  | 	endif
 | 
					
						
							| 
									
										
										
										
											2018-07-27 17:50:33 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	install_data(bash_files, install_dir: bash_install_dir)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2018-08-26 19:27:18 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 08:44:02 +01:00
										 |  |  | if get_option('fish-completions')
 | 
					
						
							| 
									
										
										
										
											2018-08-26 19:27:18 +03:00
										 |  |  | 	fish_files = files(
 | 
					
						
							|  |  |  | 		'completions/fish/sway.fish',
 | 
					
						
							|  |  |  | 		'completions/fish/swaymsg.fish',
 | 
					
						
							| 
									
										
										
										
											2018-10-27 16:54:32 +02:00
										 |  |  | 		'completions/fish/swaynag.fish',
 | 
					
						
							| 
									
										
										
										
											2018-08-26 19:27:18 +03:00
										 |  |  | 	)
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | 	if fish_comp.found()
 | 
					
						
							| 
									
										
										
										
											2020-03-29 10:06:48 +02:00
										 |  |  | 		fish_install_dir = fish_comp.get_pkgconfig_variable(
 | 
					
						
							|  |  |  | 			'completionsdir',
 | 
					
						
							|  |  |  | 			define_variable: ['datadir', datadir]
 | 
					
						
							|  |  |  | 		)
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | 	else
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:05:43 -05:00
										 |  |  | 		fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
 | 
					
						
							| 
									
										
										
										
											2020-01-21 23:03:58 -05:00
										 |  |  | 	endif
 | 
					
						
							| 
									
										
										
										
											2018-08-26 19:27:18 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	install_data(fish_files, install_dir: fish_install_dir)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2019-02-27 21:26:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-30 17:12:28 +02:00
										 |  |  | summary({
 | 
					
						
							|  |  |  | 	'xwayland': have_xwayland,
 | 
					
						
							|  |  |  | 	'gdk-pixbuf': gdk_pixbuf.found(),
 | 
					
						
							|  |  |  | 	'systemd': systemd.found(),
 | 
					
						
							|  |  |  | 	'elogind': elogind.found(),
 | 
					
						
							|  |  |  | 	'tray': have_tray,
 | 
					
						
							|  |  |  | 	'man-pages': scdoc.found(),
 | 
					
						
							|  |  |  | }, bool_yn: true)
 | 
					
						
							| 
									
										
										
										
											2019-02-27 21:26:50 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-02 23:43:43 +01:00
										 |  |  | if not wlroots_features['systemd'] and not wlroots_features['elogind'] and not wlroots_features['libseat']
 | 
					
						
							|  |  |  | 	warning('The sway binary must be setuid when compiled without (e)logind or libseat')
 | 
					
						
							| 
									
										
										
										
											2019-02-27 21:26:50 +01:00
										 |  |  | 	warning('You must do this manually post-install: chmod a+s /path/to/sway')
 | 
					
						
							|  |  |  | endif
 |