build(meson): generate and install scdoc manpages

pull/245/head
Andrea Pappacoda 2022-08-21 22:19:19 +02:00
parent 74e782bc47
commit 930d9067ce
Signed by untrusted user: tachi
GPG Key ID: 4A9208A2455077A7
2 changed files with 30 additions and 5 deletions

22
man/meson.build Normal file
View File

@ -0,0 +1,22 @@
manpages = {
'pc': 5,
'pkgconf': 1
}
foreach page, section : manpages
name = '@0@.@1@'.format(page, section)
input = name + '.scd'
tgt = custom_target(
input,
input: files(input),
output: name,
capture: true,
feed: true,
command: scdoc,
install: true,
install_dir: get_option('mandir') / 'man@0@'.format(section),
)
endforeach
install_man('pkg.m4.7')
install_man('pkgconf-personality.5')

View File

@ -1,7 +1,7 @@
project('pkgconf', 'c',
version : '1.9.3',
license : 'ISC',
meson_version : '>=0.49',
meson_version : '>=0.59',
default_options : ['c_std=c99'],
)
@ -124,10 +124,13 @@ kyuafile = configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configurat
test('kyua', kyua_exe, args : ['--config=none', 'test', '--kyuafile', kyuafile, '--build-root', meson.current_build_dir()])
subdir('tests')
install_man('man/pkgconf.1')
install_man('man/pkg.m4.7')
install_man('man/pc.5')
install_man('man/pkgconf-personality.5')
# https://github.com/mesonbuild/meson/issues/1550
# https://github.com/mesonbuild/meson/pull/9342
scdoc = find_program('scdoc', required: false)
if scdoc.found()
subdir('man')
endif
install_data('pkg.m4', install_dir: 'share/aclocal')
install_data('AUTHORS', install_dir: 'share/doc/pkgconf')
install_data('README.md', install_dir: 'share/doc/pkgconf')