Commit c56e685e authored by Canek Peláez's avatar Canek Peláez
Browse files

Improve meson man page generation. It still sucks.

parent 1ecf7f4c
Loading
Loading
Loading
Loading
+22 −34
Changes for man/meson.build: 22 added lines, 34 removed lines.
Original line number Diff line number Diff line
customman = join_paths(meson.current_source_dir(), 'custom-man.xsl')
customhtml = join_paths(meson.current_source_dir(), 'custom-html.xsl')

xsltproc_flags = [
man1dir = join_paths(get_option('mandir'), 'man1')

commonargs = [
  xsltproc,
  '--nonet',
  '--xinclude',
  '--stringparam', 'man.output.quietly', '1',
  '--stringparam', 'man.authors.section.enabled', '0',
  '--stringparam',  'man.copyright.section.enabled', '0',
  '--stringparam', 'mlm.version', meson.project_version(),
  '--path', meson.current_source_dir()
]

input_files = [
  'mlm-tags.xml'
]

output_man_files = [
  'mlm-tags.1'
]

output_html_files = [
  'mlm-tags.html'
  '--path', meson.current_source_dir(),
  '-o', '@OUTPUT@'
]

man_pages = custom_target('man-pages',
                          output: output_man_files,
                          input: input_files,
                          command: [ xsltproc,
                                     xsltproc_flags,
                                     '-o', '@OUTPUT@',
                                     customman, '@INPUT@'],
                          install: true,
                          install_dir: join_paths(get_option('mandir'), 'man1')
                         )
genman1 = [ commonargs, customman, '@INPUT@' ]

html_pages = custom_target('html-pages',
                           output: output_html_files,
                           input: input_files,
                           command: [ xsltproc,
                                      xsltproc_flags,
                                      '-o', '@OUTPUT@',
                                      customhtml, '@INPUT@'],
                           install: false,
                           install_dir: join_paths(get_option('mandir'), 'man1')
                          )
name = 'analyze'
custom_target('mlm-' + name + '.1',
              output: 'mlm-' + name + '.1',
              input: 'mlm-' + name + '.xml',
              command: genman1, install: true, install_dir: man1dir)
name = 'copy-tags'
custom_target('mlm-' + name + '.1',
              output: 'mlm-' + name + '.1',
              input: 'mlm-' + name + '.xml',
              command: genman1, install: true, install_dir: man1dir)
name = 'tags'
custom_target('mlm-' + name + '.1',
              output: 'mlm-' + name + '.1',
              input: 'mlm-' + name + '.xml',
              command: genman1, install: true, install_dir: man1dir)