Refine installation instructions
[jack_mixer.git] / docs / meson.build
blobb1c4d691e5e3a40c81842f7b4ffad6e02b11bcdd
1 if get_option('gui').enabled()
2     fs = import('fs')
4     jack_mixer_man = 'jack_mixer.1'
6     rst2man = find_program('rst2man', 'rst2man.py', required: false)
8     if fs.exists(jack_mixer_man)
9         install_man(jack_mixer_man)
10     elif rst2man.found()
11         jack_mixer_man_rst_in = 'jack_mixer.1.rst.in'
13         jack_mixer_man_rst = configure_file(
14             input: jack_mixer_man_rst_in,
15             output: 'jack_mixer.1.rst',
16             configuration: {
17                 'VERSION': meson.project_version()
18             }
19         )
21         jack_mixer_troff = custom_target(
22             'jack_mixer_rst2man',
23             output: jack_mixer_man,
24             input: jack_mixer_man_rst,
25             command: [rst2man, '@INPUT@', '@OUTPUT@'],
26             install: true,
27             install_dir: join_paths(get_option('mandir'), 'man1')
28         )
29     else
30         error('Pre-generated file \'jack_mixer.1\' and \'rst2man\' not found.\n' +
31               'Please install \'docutils\' from https://pypi.org/project/docutils.')
32     endif
34     meson.add_dist_script('meson_dist_rst2man.py', jack_mixer_man)
35 endif