File: meson.build

package info (click to toggle)
libvirt 11.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 208,540 kB
  • sloc: ansic: 534,712; xml: 319,206; python: 11,974; perl: 2,629; sh: 2,185; makefile: 448; javascript: 126; cpp: 22
file content (134 lines) | stat: -rw-r--r-- 3,316 bytes parent folder | download | duplicates (3)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
docs_html_gen = []
docs_html_dep = []

index_api_gen = custom_target(
  'index-api',
  input: [
    newapi_xsl,
    docs_api_xml,
  ],
  output: [
    'libvirt-libvirt-common.html',
    'libvirt-libvirt-domain.html',
    'libvirt-libvirt-domain-checkpoint.html',
    'libvirt-libvirt-domain-snapshot.html',
    'libvirt-libvirt-event.html',
    'libvirt-libvirt-host.html',
    'libvirt-libvirt-interface.html',
    'libvirt-libvirt-network.html',
    'libvirt-libvirt-nodedev.html',
    'libvirt-libvirt-nwfilter.html',
    'libvirt-libvirt-secret.html',
    'libvirt-libvirt-storage.html',
    'libvirt-libvirt-stream.html',
    'libvirt-virterror.html',
  ],
  command: [
    xsltproc_prog, '--nonet', '-o', docs_builddir,
    '--stringparam', 'builddir', meson.project_build_root(),
    '--stringparam', 'timestamp', docs_timestamp,
    '--stringparam', 'href_base', '../',
    '@INPUT@',
  ],
  install: true,
  install_dir: docs_html_dir / 'html',
  depend_files: [
    page_xsl,
  ],
)

docs_html_gen += index_api_gen.to_list()
docs_html_dep += index_api_gen

foreach name : [ 'admin', 'lxc', 'qemu' ]
  index_api_gen = custom_target(
    'index-@0@-api'.format(name),
    input: [
      newapi_xsl,
      get_variable('docs_@0@_api_xml'.format(name)),
    ],
    output: [
      'libvirt-libvirt-@0@.html'.format(name),
    ],
    command: [
      xsltproc_prog, '--nonet', '-o', docs_builddir,
      '--stringparam', 'builddir', meson.project_build_root(),
      '--stringparam', 'timestamp', docs_timestamp,
      '--stringparam', 'href_base', '../',
      '@INPUT@',
    ],
    install: true,
    install_dir: docs_html_dir / 'html',
    depend_files: [
      page_xsl,
    ],
  )

  docs_html_gen += index_api_gen.to_list()
  docs_html_dep += index_api_gen
endforeach

docs_html_paths = []

install_web_deps += docs_html_dep

foreach file : docs_html_gen
  docs_html_paths += file.full_path()
  install_web_files += '@0@:@1@'.format(file.full_path(), docs_html_dir / 'html')
endforeach

html_xslt_gen_install_dir = docs_html_dir / 'html'
html_xslt_gen = []

html_xslt_gen += {
  'name': 'index',
  'file': docs_rst2html5_gen.process('index.rst'),
  'source': 'docs' / 'html' / 'index.rst',
  'href_base': '../',
  }

# --- begin of XSLT processing ---

foreach data : html_xslt_gen
  html_filename = data['name'] + '.html'

  html_file = custom_target(
    html_filename,
    input: data.get('file', data['name'] + '.html.in'),
    output: html_filename,
    command: [
      xsltproc_prog,
      '--stringparam', 'pagesrc', data.get('source', ''),
      '--stringparam', 'builddir', meson.project_build_root(),
      '--stringparam', 'timestamp', docs_timestamp,
      '--stringparam', 'href_base', data.get('href_base', ''),
      '--nonet',
      site_xsl,
      '@INPUT@',
    ],
    depends: data.get('depends', []),
    depend_files: [ page_xsl ],
    capture: true,
    install: true,
    install_dir: html_xslt_gen_install_dir,
  )

  install_web_deps += html_file
  install_web_files += html_file.full_path() + ':' + html_xslt_gen_install_dir
endforeach

html_xslt_gen = []

# --- end of XSLT processing ---

if tests_enabled[0]
  test(
    'check-html',
    xmllint_prog,
    args: [
      '--nonet', '--noout', docs_html_paths,
    ],
    depends: docs_html_dep,
    suite: 'script'
  )
endif