1 project('GStreamer manuals and tutorials', 'c',
3 meson_version : '>= 0.54')
5 hotdoc_p = find_program('hotdoc')
6 if not hotdoc_p.found()
7 message('Hotdoc not found, not building the documentation')
11 hotdoc_req = '>= 0.12.2'
12 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
13 if not hotdoc_version.version_compare(hotdoc_req)
14 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
17 hotdoc = import('hotdoc')
18 hotdoc_subprojects = []
21 if host_machine.system() == 'windows'
27 python3 = import('python').find_installation()
29 built_subprojects = get_option('built_subprojects')
30 if built_subprojects != ''
31 message('Have subprojects list from options')
33 read_file_contents = '''
37 assert len(sys.argv) >= 2
40 with open(fname, 'r') as f:
45 # gst-build will generate this file for us to consume so that subproject
46 # changes can still work
47 fname = join_paths(meson.build_root(), 'GstDocumentedSubprojects')
50 '-c', read_file_contents,
53 if cmdres.returncode() == 0
54 built_subprojects = cmdres.stdout().strip()
55 message('Have subprojects from file: @0@'.format(fname))
63 if built_subprojects != ''
64 foreach project_name: built_subprojects.split(',')
65 sub = subproject(project_name)
66 if sub.get_variable('build_hotdoc')
67 message('Building @0@ documentation'.format(project_name))
69 foreach lib: sub.get_variable('libs_doc')
70 hotdoc_subprojects += [lib]
71 libs += lib.full_path() + pathsep
75 foreach plugin_doc: sub.get_variable('plugins_doc')
76 plugins_doc += plugin_doc.full_path() + pathsep
77 hotdoc_subprojects += [plugin_doc]
81 message('@0@ did not build hotdoc documentation, can\'t build API doc'.format(project_name))
85 deps += [dependency('gstreamer-' + apiversion, fallback: ['gstreamer', 'gst_dep'])]
87 if get_option('use_portal_index')
88 index = 'markdown/index.md'
90 index = 'markdown/simple-index.md'
92 sitemap_gen = find_program('scripts/generate_sitemap.py')
93 sitemap = configure_file(command: [sitemap_gen, '@INPUT@', '@OUTPUT@',
94 'gi-index', libs, plugins_doc],
96 output: 'sitemap.txt')
98 html_theme = 'https://github.com/hotdoc/hotdoc_lumen_theme/releases/download/0.13.2/hotdoc_lumen_theme-0.13.2.tar.xz?sha256=5721189b7e985f27381ee20137f4a9003049a70a75ab1221a69fd04d27e752bc'
100 gstreamer_doc = hotdoc.generate_doc('GStreamer',
101 project_version: apiversion,
106 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
107 syntax_highlighting_activate: true,
108 html_theme: html_theme,
110 meson.current_source_dir() / 'examples',
111 meson.current_source_dir() / 'markdown' / 'tutorials' / 'basic',
112 meson.current_source_dir() / 'markdown' / 'templates',
113 meson.current_source_dir() / 'markdown' / 'tutorials' / 'playback',
115 html_extra_theme: join_paths(meson.current_source_dir(), 'theme/extra'),
117 subprojects: hotdoc_subprojects,
118 disable_incremental_build: true,
119 gst_list_plugins_page: 'gst-index',
120 gst_index: join_paths(meson.current_source_dir(), 'markdown/plugins_doc.md'),
121 devhelp_activate: true,
122 devhelp_online: 'https://gstreamer.freedesktop.org/documentation/',
123 build_always_stale: true,
124 edit_on_github_repository: 'https://gitlab.freedesktop.org/gstreamer/gst-docs/',
125 previous_symbol_index: join_paths(meson.current_source_dir(), 'symbols', 'symbol_index.json'),
128 cdata = configuration_data()
129 cdata.set('GST_API_VERSION', apiversion)
130 readme = configure_file(input: 'scripts/RELEASE_README.md',
132 configuration : cdata)
134 run_target('release',
135 command: [find_program('scripts/release.py'),
136 gstreamer_doc.full_path(),
137 meson.project_version(),
138 meson.current_build_dir()],
139 depends: [gstreamer_doc]