From 930d9067cea0d2f92a34786bf82d034147ff5e7f Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Sun, 21 Aug 2022 22:19:19 +0200 Subject: [PATCH] build(meson): generate and install scdoc manpages --- man/meson.build | 22 ++++++++++++++++++++++ meson.build | 13 ++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 man/meson.build diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 0000000..3584157 --- /dev/null +++ b/man/meson.build @@ -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') diff --git a/meson.build b/meson.build index 0d42d42..83cbcb1 100644 --- a/meson.build +++ b/meson.build @@ -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')