2019-01-12 15:21:21 +01:00
|
|
|
project(
|
|
|
|
'swayidle',
|
|
|
|
'c',
|
2022-12-04 15:18:01 +01:00
|
|
|
version: '1.8.0',
|
2019-01-12 15:21:21 +01:00
|
|
|
license: 'MIT',
|
2022-09-16 14:02:35 +02:00
|
|
|
meson_version: '>=0.59.0',
|
2019-01-12 15:21:21 +01:00
|
|
|
default_options: [
|
|
|
|
'c_std=c11',
|
|
|
|
'warning_level=2',
|
|
|
|
'werror=true',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2024-05-12 12:18:02 +02:00
|
|
|
add_project_arguments([
|
|
|
|
'-D_POSIX_C_SOURCE=200809L',
|
|
|
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-unused-result',
|
|
|
|
'-Wundef',
|
|
|
|
'-Wvla',
|
|
|
|
], language: 'c')
|
2019-01-12 15:21:21 +01:00
|
|
|
|
|
|
|
wayland_client = dependency('wayland-client')
|
2022-09-16 13:45:45 +02:00
|
|
|
wayland_protos = dependency('wayland-protocols', version: '>=1.27')
|
2019-01-12 15:21:21 +01:00
|
|
|
wayland_server = dependency('wayland-server')
|
2019-01-24 23:32:33 +01:00
|
|
|
logind = dependency('lib' + get_option('logind-provider'), required: get_option('logind'))
|
2019-01-24 22:30:45 +01:00
|
|
|
scdoc = find_program('scdoc', required: get_option('man-pages'))
|
2022-12-04 15:22:42 +01:00
|
|
|
wayland_scanner = dependency('wayland-scanner', native: true, version: '>=1.14.91')
|
|
|
|
wayland_scanner_prog = find_program(wayland_scanner.get_variable('wayland_scanner'), native: true)
|
2019-01-12 15:21:21 +01:00
|
|
|
|
2022-12-04 16:57:53 +01:00
|
|
|
wl_protocol_dir = wayland_protos.get_variable('pkgdatadir')
|
2019-01-12 15:21:21 +01:00
|
|
|
|
|
|
|
wayland_scanner_code = generator(
|
2022-12-04 15:22:42 +01:00
|
|
|
wayland_scanner_prog,
|
2019-01-12 15:21:21 +01:00
|
|
|
output: '@BASENAME@-protocol.c',
|
2022-12-04 15:22:42 +01:00
|
|
|
arguments: ['private-code', '@INPUT@', '@OUTPUT@'],
|
2019-01-12 15:21:21 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
wayland_scanner_client = generator(
|
2022-12-04 15:22:42 +01:00
|
|
|
wayland_scanner_prog,
|
2019-01-12 15:21:21 +01:00
|
|
|
output: '@BASENAME@-client-protocol.h',
|
|
|
|
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
|
2022-09-16 13:45:45 +02:00
|
|
|
protos = [
|
|
|
|
wl_protocol_dir / 'staging/ext-idle-notify/ext-idle-notify-v1.xml',
|
|
|
|
]
|
|
|
|
|
2022-12-04 17:02:00 +01:00
|
|
|
protos_src = []
|
2022-09-16 13:45:45 +02:00
|
|
|
foreach xml : protos
|
2022-12-04 17:02:00 +01:00
|
|
|
protos_src += wayland_scanner_code.process(xml)
|
|
|
|
protos_src += wayland_scanner_client.process(xml)
|
2022-09-16 13:45:45 +02:00
|
|
|
endforeach
|
2019-01-12 15:21:21 +01:00
|
|
|
|
2019-01-24 23:32:33 +01:00
|
|
|
conf_data = configuration_data()
|
2022-12-04 17:00:23 +01:00
|
|
|
conf_data.set_quoted('SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
|
2019-01-24 23:32:33 +01:00
|
|
|
conf_data.set10('HAVE_SYSTEMD', false)
|
|
|
|
conf_data.set10('HAVE_ELOGIND', false)
|
|
|
|
|
|
|
|
if logind.found()
|
|
|
|
conf_data.set10('HAVE_' + get_option('logind-provider').to_upper(), true)
|
2018-11-18 00:33:06 +01:00
|
|
|
endif
|
|
|
|
|
2022-12-04 17:05:24 +01:00
|
|
|
config_header = configure_file(output: 'config.h', configuration: conf_data)
|
2019-01-12 15:21:21 +01:00
|
|
|
|
2018-04-17 09:54:02 +02:00
|
|
|
executable(
|
|
|
|
'swayidle', [
|
|
|
|
'main.c',
|
2022-12-04 17:02:00 +01:00
|
|
|
protos_src,
|
2022-12-04 17:05:24 +01:00
|
|
|
config_header,
|
2018-04-17 09:54:02 +02:00
|
|
|
],
|
2022-12-04 16:59:03 +01:00
|
|
|
dependencies: [
|
|
|
|
wayland_client,
|
|
|
|
wayland_server,
|
|
|
|
logind,
|
|
|
|
],
|
2019-01-24 23:32:33 +01:00
|
|
|
install: true,
|
2018-04-17 09:54:02 +02:00
|
|
|
)
|
2019-01-12 15:21:21 +01:00
|
|
|
|
|
|
|
if scdoc.found()
|
|
|
|
mandir = get_option('mandir')
|
|
|
|
man_files = [
|
|
|
|
'swayidle.1.scd',
|
|
|
|
]
|
|
|
|
foreach filename : man_files
|
|
|
|
topic = filename.split('.')[-3].split('/')[-1]
|
|
|
|
section = filename.split('.')[-2]
|
|
|
|
output = '@0@.@1@'.format(topic, section)
|
|
|
|
|
|
|
|
custom_target(
|
|
|
|
output,
|
|
|
|
input: filename,
|
|
|
|
output: output,
|
2022-09-16 14:02:35 +02:00
|
|
|
command: scdoc,
|
|
|
|
feed: true,
|
|
|
|
capture: true,
|
2019-01-12 15:21:21 +01:00
|
|
|
install: true,
|
|
|
|
install_dir: '@0@/man@1@'.format(mandir, section)
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
endif
|
2019-01-12 15:39:41 +01:00
|
|
|
|
2022-12-04 17:03:32 +01:00
|
|
|
subdir('completions')
|