Blame man/meson.build

Packit Service 103f6b
# Copyright © 2017-2018 Intel Corporation
Packit Service 103f6b
Packit Service 103f6b
# Permission is hereby granted, free of charge, to any person obtaining a copy
Packit Service 103f6b
# of this software and associated documentation files (the "Software"), to deal
Packit Service 103f6b
# in the Software without restriction, including without limitation the rights
Packit Service 103f6b
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Packit Service 103f6b
# copies of the Software, and to permit persons to whom the Software is
Packit Service 103f6b
# furnished to do so, subject to the following conditions:
Packit Service 103f6b
Packit Service 103f6b
# The above copyright notice and this permission notice shall be included in
Packit Service 103f6b
# all copies or substantial portions of the Software.
Packit Service 103f6b
Packit Service 103f6b
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit Service 103f6b
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit Service 103f6b
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Packit Service 103f6b
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit Service 103f6b
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Packit Service 103f6b
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit Service 103f6b
# SOFTWARE.
Packit Service 103f6b
Packit Service 103f6b
xsltproc_args = [
Packit Service 103f6b
  '--stringparam', 'man.authors.section.enabled', '0',
Packit Service 103f6b
  '--stringparam', 'man.copyright.section.enabled', '0',
Packit Service 103f6b
  '--stringparam', 'funcsynopsis.style', 'ansi',
Packit Service 103f6b
  '--stringparam', 'man.output.quietly', '1',
Packit Service 103f6b
  '--nonet', manpage_style,
Packit Service 103f6b
]
Packit Service 103f6b
Packit Service 103f6b
xmls = [
Packit Service 103f6b
  ['drm', '7'], ['drm-kms', '7'], ['drm-memory', '7'], ['drmAvailable', '3'],
Packit Service 103f6b
  ['drmHandleEvent', '3'], ['drmModeGetResources', '3']
Packit Service 103f6b
]
Packit Service 103f6b
foreach x : xmls
Packit Service 103f6b
  m = x[0]
Packit Service 103f6b
  s = x[1]
Packit Service 103f6b
  custom_target(
Packit Service 103f6b
    m,
Packit Service 103f6b
    input : files('@0@.xml'.format(m)),
Packit Service 103f6b
    output : '@0@.@1@'.format(m, s),
Packit Service 103f6b
    command : [prog_xslt, '-o', '@OUTPUT@', xsltproc_args, '@INPUT0@'],
Packit Service 103f6b
    install : true,
Packit Service 103f6b
    install_dir : join_paths(get_option('mandir'), 'man@0@'.format(s)),
Packit Service 103f6b
    build_by_default : true,
Packit Service 103f6b
  )
Packit Service 103f6b
endforeach
Packit Service 103f6b
Packit Service 103f6b
foreach x : ['drm-mm', 'drm-gem', 'drm-ttm']
Packit Service 103f6b
  gen = custom_target(
Packit Service 103f6b
    'gen-@0@'.format(x),
Packit Service 103f6b
    input : 'drm-memory.xml',
Packit Service 103f6b
    output : '@0@.xml'.format(x),
Packit Service 103f6b
    command : [
Packit Service 103f6b
      prog_sed, '-e', 's@^\.so \([a-z_]\+\)\.\([0-9]\)$$@\.so man\2\/\1\.\2@',
Packit Service 103f6b
      '@INPUT@',
Packit Service 103f6b
    ],
Packit Service 103f6b
    capture : true,
Packit Service 103f6b
  )
Packit Service 103f6b
  custom_target(
Packit Service 103f6b
    '@0@.7'.format(x),
Packit Service 103f6b
    input : gen,
Packit Service 103f6b
    output : '@0@.7'.format(x, '7'),
Packit Service 103f6b
    command : [prog_xslt, '-o', '@OUTPUT@', xsltproc_args, '@INPUT@'],
Packit Service 103f6b
    install : true,
Packit Service 103f6b
    install_dir : join_paths(get_option('mandir'), 'man7'),
Packit Service 103f6b
    build_by_default : true,
Packit Service 103f6b
  )
Packit Service 103f6b
endforeach