aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-08-24 05:22:49 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-08-24 05:23:34 +0200
commit9fb90607ad6888b23b3ec578620a9d5b9cbb6221 (patch)
treef09c670432ae70f43b5aa291ba72a907f00b135e /meson.build
parentdd09af34b791def2ef370232922d968f5176d1e1 (diff)
downloadfiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.tar.gz
fiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.tar.xz
fiv-9fb90607ad6888b23b3ec578620a9d5b9cbb6221.zip
Add a traditional manual page for fiv
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build31
1 files changed, 28 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 4591a67..6f6d156 100644
--- a/meson.build
+++ b/meson.build
@@ -16,6 +16,8 @@ add_project_arguments(
# add_project_link_arguments(flags, language : ['c'])
#endif
+win32 = host_machine.system() == 'windows'
+
# The likelihood of this being installed is nearly zero. Enable the wrap.
libjpegqs = dependency('libjpegqs', required : get_option('libjpegqs'),
allow_fallback : true)
@@ -77,7 +79,7 @@ conf.set_quoted('PROJECT_NAME', meson.project_name())
conf.set_quoted('PROJECT_VERSION', '@VCS_TAG@')
conf.set_quoted('PROJECT_NS', application_ns)
conf.set_quoted('PROJECT_DOCDIR', get_option('prefix') / docdir)
-if host_machine.system() == 'windows'
+if win32
conf.set_quoted('PROJECT_DOCDIR', docdir)
endif
@@ -98,7 +100,7 @@ config = vcs_tag(
)
rc = []
-if host_machine.system() == 'windows'
+if win32
windows = import('windows')
rsvg_convert = find_program('rsvg-convert')
icotool = find_program('icotool')
@@ -211,7 +213,30 @@ install_data('fiv.svg',
install_subdir('docs',
install_dir : docdir, strip_directory : true)
-if host_machine.system() != 'windows'
+if not win32
+ asciidoctor = find_program('asciidoctor', required : false)
+ a2x = find_program('a2x', required : false)
+ if not asciidoctor.found() and not a2x.found()
+ error('Neither asciidoctor nor a2x were found')
+ endif
+ foreach page : [meson.project_name()]
+ if asciidoctor.found()
+ command = [asciidoctor, '-b', 'manpage',
+ '-a', 'release-version=' + meson.project_version(),
+ '-o', '@OUTPUT@', '@INPUT@']
+ elif a2x.found()
+ command = [a2x, '--doctype', 'manpage', '--format', 'manpage',
+ '-a', 'release-version=' + meson.project_version(),
+ '-D', '@OUTDIR@', '@INPUT@']
+ endif
+ custom_target('manpage for ' + page,
+ input : 'docs' / page + '.adoc',
+ output : page + '.1',
+ command : command,
+ install : true,
+ install_dir : get_option('mandir') / 'man1')
+ endforeach
+
foreach desktop : desktops
install_data(desktop,
rename : application_ns + desktop,