# SPDX-FileCopyrightText: 2026 Dr. Tobias Quathamer # # SPDX-License-Identifier: GPL-3.0-or-later fs = import('fs') # Create English manpage custom_target( 'build-manpage', input: 'isoquery.adoc', output: 'isoquery.1', command: [asciidoctor, '-b', 'manpage', '@INPUT@', '-o', '@OUTPUT@'], install: true, install_dir: get_option('mandir') / 'man1', ) # Create asciidoc files for all translations. # Note that translations below the threshold of 80 % # do not get an output, so those need to be disabled # here. Otherwise, the build fails. langs = [ 'de', 'es', 'et', 'fr', 'it', 'nb', 'pt', 'ro', 'sv', 'ta', 'tr', ] # Get the relative path to the source directory. # This is needed for po4a, because it does not # accept an absolute path. rel_path_to_source = fs.relative_to( meson.current_source_dir(), fs.parent(meson.current_build_dir()), ) foreach lang : langs conf_data = configuration_data() conf_data.set('sourcedir', rel_path_to_source) conf_data.set('builddir', meson.current_build_dir()) conf_data.set('lang', lang) cfg = configure_file( input: 'po4a.cfg.in', output: 'po4a-@0@.cfg'.format(lang), configuration: conf_data, ) translated_adoc = custom_target( 'build-asciidoc-@0@'.format(lang), input: ['isoquery.adoc', cfg, lang + '.po'], output: 'isoquery.@0@.adoc'.format(lang), command: [po4a, '--no-update', cfg], ) custom_target( 'build-manpage-@0@'.format(lang), input: translated_adoc, output: 'isoquery.1', build_subdir: 'man-@0@'.format(lang), command: [asciidoctor, '-b', 'manpage', '@INPUT@', '-o', '@OUTPUT@'], install: true, install_dir: get_option('mandir') / lang / 'man1', ) endforeach