summaryrefslogtreecommitdiffstats
path: root/doc/meson.build
blob: ad6a0f9a947012414380d988043a3ec2128481c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# documentation
# SPDX-License-Identifier: GPL-3.0-or-later

# man page
man_config = configuration_data()
man_config.set('version', meson.project_version())
man_config.set('date', run_command('../scripts/lib/get-date.sh', check: true).stdout())

man_config.set('man_seealso_systemd', '')
if systemd_legacy_units == 'enabled'
  man_config.set('man_seealso_systemd', '\\fIkresd.systemd(7)\\fR, ')
endif

man_kresd = configure_file(
  input: 'kresd.8.in',
  output: 'kresd.8',
  configuration: man_config,
)
install_man(man_kresd)

man_kresctl = configure_file(
  input: 'kresctl.8.in',
  output: 'kresctl.8',
  configuration: man_config,
)
install_man(man_kresctl)

# html and info documentation
if get_option('doc') == 'enabled'
  message('--- doc dependencies ---')
  doxygen = find_program('doxygen')
  sphinx_build = find_program('sphinx-build-3', required: false)
  if not sphinx_build.found()
    sphinx_build = find_program('sphinx-build')
  endif

  # python dependencies: breathe, sphinx_rtd_theme
  python_breathe = run_command('python3', '-c', 'import breathe', check: false)
  if python_breathe.returncode() != 0
    python_breathe = run_command('python2', '-c', 'import breathe', check: false)
    if python_breathe.returncode() != 0
      error('missing doc dependency: python breathe')
    endif
    python = 'python2'
  else
    python = 'python3'
  endif

  python_sphinx_rtd_theme = run_command(python, '-c', 'import sphinx_rtd_theme', check: false)
  if python_sphinx_rtd_theme.returncode() != 0
    error('missing doc dependency: python sphinx_rtd_theme')
  endif

  python_sphinx_tabs = run_command(python, '-c', 'import sphinx_tabs', check: false)
  if python_sphinx_tabs.returncode() != 0
    error('missing doc dependency: python python-sphinx-tabs')
  endif

  jsonschemaforhumans = run_command(python, '-c', 'import json_schema_for_humans', check: false)
  if jsonschemaforhumans.returncode() != 0
    error('missing doc dependency: python json-schema-for-humans')
  endif

  message('------------------------')

  # install html docs
  install_subdir(
    meson.current_source_dir() / 'html',
    install_dir: doc_dir,
  )

endif


make_doc = find_program('../scripts/meson/make-doc.sh')
run_target(
  'doc',
  command: make_doc
)


run_target(
  'doc-strict',
  command: [make_doc, '-W']
)