meson: Make man page build and install conditional

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
This commit is contained in:
Arnaud Rebillout 2018-11-05 12:03:03 +07:00 committed by Arun Raghavan
parent 8d241d62c5
commit 6826c60da5
3 changed files with 11 additions and 8 deletions

View file

@ -20,17 +20,14 @@ manpages = [
# FIXME: Add esdcompat if HAVE_ESOUND # FIXME: Add esdcompat if HAVE_ESOUND
#manpages += ['esdcompat', '1'], #manpages += ['esdcompat', '1'],
# FIXME: This should be conditional
want_man = true
man_data = configuration_data() man_data = configuration_data()
man_data.set('PACKAGE_URL', 'http://pulseaudio.org/') man_data.set('PACKAGE_URL', 'http://pulseaudio.org/')
man_data.set('PACKAGE_BUGREPORT', 'pulseaudio-discuss (at) lists (dot) freedesktop (dot) org') man_data.set('PACKAGE_BUGREPORT', 'pulseaudio-discuss (at) lists (dot) freedesktop (dot) org')
man_data.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR')) man_data.set('PA_DEFAULT_CONFIG_DIR', cdata.get_unquoted('PA_DEFAULT_CONFIG_DIR'))
perl = find_program('perl', required: want_man == true) perl = find_program('perl', required: true)
xmltoman_cmd = [perl, join_paths(meson.current_source_dir(), 'xmltoman')] xmltoman_cmd = [perl, join_paths(meson.current_source_dir(), 'xmltoman')]
xmllint = find_program('xmllint', required: want_man == true) xmllint = find_program('xmllint', required: false)
foreach tuple : manpages foreach tuple : manpages
stem = tuple[0] stem = tuple[0]
@ -55,7 +52,7 @@ foreach tuple : manpages
output : man, output : man,
capture : true, capture : true,
command : xmltoman_cmd + ['@INPUT@'], command : xmltoman_cmd + ['@INPUT@'],
install : want_man, install : true,
install_dir : mandirn, install_dir : mandirn,
) )
@ -64,7 +61,7 @@ foreach tuple : manpages
alias, alias,
output : alias, output : alias,
command : ['ln', '-fs', man, '@OUTPUT@'], command : ['ln', '-fs', man, '@OUTPUT@'],
install : want_man, install : true,
install_dir : mandirn, install_dir : mandirn,
) )
endforeach endforeach

View file

@ -434,7 +434,9 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te
# Now generate config.h from everything above # Now generate config.h from everything above
configure_file(output : 'config.h', configuration : cdata) configure_file(output : 'config.h', configuration : cdata)
subdir('man') if get_option('man')
subdir('man')
endif
subdir('shell-completion/bash') subdir('shell-completion/bash')
subdir('shell-completion/zsh') subdir('shell-completion/zsh')
subdir('src') subdir('src')
@ -500,6 +502,7 @@ summary = [
'Enable SoXR (resampler): @0@'.format(soxr_dep.found()), 'Enable SoXR (resampler): @0@'.format(soxr_dep.found()),
'Enable WebRTC echo canceller: @0@'.format(webrtc_dep.found()), 'Enable WebRTC echo canceller: @0@'.format(webrtc_dep.found()),
# 'Enable gcov coverage: @0@'.format(${ENABLE_GCOV}), # 'Enable gcov coverage: @0@'.format(${ENABLE_GCOV}),
'Enable man pages: @0@'.format(get_option('man')),
'Enable unit tests: @0@'.format(get_option('tests')), 'Enable unit tests: @0@'.format(get_option('tests')),
'', '',
'Database: @0@'.format(get_option('database')), 'Database: @0@'.format(get_option('database')),

View file

@ -1,3 +1,6 @@
option('man',
type : 'boolean',
description : 'Enable building and installation of man pages')
option('tests', option('tests',
type : 'boolean', type : 'boolean',
description : 'Enable unit tests') description : 'Enable unit tests')