tests: mark elements_srtp.test_play test as flaky
[platform/upstream/gstreamer.git] / subprojects / gst-editing-services / docs / meson.build
1 build_hotdoc = false
2
3 if meson.is_cross_build()
4     if get_option('doc').enabled()
5         error('Documentation enabled but building the doc while cross building is not supported yet.')
6     endif
7
8     message('Documentation not built as building it while cross building is not supported yet.')
9     subdir_done()
10 endif
11
12 if static_build
13     if get_option('doc').enabled()
14         error('Documentation enabled but not supported when building statically.')
15     endif
16
17     message('Building statically, can\'t build the documentation')
18     subdir_done()
19 endif
20
21 if not build_gir
22     if get_option('doc').enabled()
23         error('Documentation enabled but introspection not built.')
24     endif
25
26     message('Introspection not built, won\'t build documentation requiring it')
27     subdir_done()
28 endif
29
30 required_hotdoc_extensions = ['gi-extension', 'gst-extension']
31 if gst_dep.type_name() == 'internal'
32     gst_proj = subproject('gstreamer')
33     plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
34 else
35     plugins_cache_generator = find_program(join_paths(gst_dep.get_variable('libexecdir'), 'gstreamer-' + apiversion, 'gst-plugins-doc-cache-generator'), required: false)
36 endif
37
38 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
39
40 if plugins_cache_generator.found()
41     gst_plugins_doc_dep = custom_target('editing-services-doc-cache',
42         command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
43         input: plugins,
44         output: 'gst_plugins_cache.json',
45         build_always_stale: true,
46     )
47 else
48     warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
49 endif
50
51 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
52 if not hotdoc_p.found()
53     message('Hotdoc not found, not building the documentation')
54     subdir_done()
55 endif
56
57 hotdoc_req = '>= 0.11.0'
58 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
59 if not hotdoc_version.version_compare(hotdoc_req)
60     if get_option('doc').enabled()
61         error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
62     else
63         message('Hotdoc version @0@ not found, got @1@, not building documentation'.format(hotdoc_req, hotdoc_version))
64         subdir_done()
65     endif
66 endif
67
68 hotdoc = import('hotdoc')
69 foreach extension: required_hotdoc_extensions
70     if not hotdoc.has_extensions(extension)
71         if get_option('doc').enabled()
72             error('Documentation enabled but gi-extension missing')
73         endif
74
75         message('@0@ extensions not found, not building documentation requiring it'.format(extension))
76     endif
77 endforeach
78
79 build_hotdoc = true
80 ges_excludes = []
81 foreach f: ['gesmarshal.*',
82             'ges-internal.*',
83             'ges-auto-transition.*',
84             'ges-structured-interface.*',
85             'ges-structure-parser.*',
86             'ges-version.h',
87             'ges-smart-*',
88             'ges-command-line-formatter.*',
89             'ges-base-xml-formatter.h',
90             'gstframepositioner.*',
91             'lex.priv_ges_parse_yy.c',
92             'ges-parse-lex.[c]']
93     ges_excludes += [join_paths(meson.current_source_dir(), '..', '..', 'ges', f)]
94 endforeach
95
96 hotdoc = import('hotdoc')
97 libs_doc = [hotdoc.generate_doc('gst-editing-services',
98     project_version: apiversion,
99     extra_assets: [join_paths(meson.current_source_dir(), 'images')],
100     gi_c_sources: ges_sources + ges_headers,
101     gi_c_source_roots: [join_paths(meson.current_source_dir(), '../ges/')],
102     gi_sources: [ges_gir[0].full_path()],
103     gi_c_source_filters: ges_excludes,
104     sitemap: 'sitemap.txt',
105     index: 'index.md',
106     gi_index: 'index.md',
107     gi_smart_index: true,
108     gi_order_generated_subpages: true,
109     dependencies: [ges_dep],
110     disable_incremental_build: true,
111     depends: ges_gir[0],
112 )]
113
114 plugins_doc = []
115 list_plugin_res = run_command(python3, '-c',
116 '''
117 import sys
118 import json
119
120 with open("@0@") as f:
121     print(':'.join(json.load(f).keys()), end='')
122 '''.format(plugins_cache),
123   check: true)
124 foreach plugin_name: list_plugin_res.stdout().split(':')
125     plugins_doc += [hotdoc.generate_doc(plugin_name,
126         project_version: apiversion,
127         sitemap: 'plugins/sitemap.txt',
128         index: 'plugins/index.md',
129         gst_index: 'plugins/index.md',
130         gst_smart_index: true,
131         gst_c_sources: ['../plugins/*/*.[ch]',],
132         dependencies: [gst_dep],
133         gst_order_generated_subpages: true,
134         gst_cache_file: plugins_cache,
135         gst_plugin_name: plugin_name,
136     )]
137 endforeach