mirror of
https://github.com/emersion/kanshi
synced 2024-09-19 10:21:35 +02:00
Generate man pages
This commit is contained in:
parent
4b16771942
commit
689c989b92
@ -11,6 +11,11 @@ Join the IRC channel: ##emersion on Freenode.
|
||||
|
||||
## Building
|
||||
|
||||
Dependencies:
|
||||
|
||||
* wayland-client
|
||||
* scdoc (optional, for man pages)
|
||||
|
||||
```sh
|
||||
meson build
|
||||
ninja -C build
|
||||
|
32
meson.build
32
meson.build
@ -48,3 +48,35 @@ executable(
|
||||
dependencies: [wayland_client, client_protos],
|
||||
install: true,
|
||||
)
|
||||
|
||||
scdoc = dependency(
|
||||
'scdoc',
|
||||
version: '>=1.9.2',
|
||||
native: true,
|
||||
required: get_option('man-pages'),
|
||||
)
|
||||
if scdoc.found()
|
||||
scdoc_prog = find_program(scdoc.get_pkgconfig_variable('scdoc'), native: true)
|
||||
sh = find_program('sh', native: true)
|
||||
mandir = get_option('mandir')
|
||||
man_files = [
|
||||
'kanshi.1.scd',
|
||||
'kanshi.5.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,
|
||||
command: [
|
||||
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc_prog.path(), output)
|
||||
],
|
||||
install: true,
|
||||
install_dir: join_paths(mandir, section),
|
||||
)
|
||||
endforeach
|
||||
endif
|
||||
|
1
meson_options.txt
Normal file
1
meson_options.txt
Normal file
@ -0,0 +1 @@
|
||||
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
|
Loading…
Reference in New Issue
Block a user