summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2019-04-19 12:38:54 -0400
committerThibault Saunier <tsaunier@igalia.com>2019-05-13 19:06:28 -0400
commit8717cc710880199015ec6ba90ea9e0e77c2a8d20 (patch)
tree102e16fdd02cf1647be0cc98bb70592b2cb19a92
parentfbe0d07068d018a3c10db36a7c712b702cc92d77 (diff)
downloadgst-omx-8717cc710880199015ec6ba90ea9e0e77c2a8d20.tar.gz
doc: Build documentation of hotdoc
-rw-r--r--docs/gst_plugins_cache.json11
-rw-r--r--docs/index.md3
-rw-r--r--docs/meson.build62
-rw-r--r--docs/sitemap.txt1
-rw-r--r--meson.build1
-rw-r--r--meson_options.txt1
-rw-r--r--omx/meson.build2
7 files changed, 81 insertions, 0 deletions
diff --git a/docs/gst_plugins_cache.json b/docs/gst_plugins_cache.json
new file mode 100644
index 0000000..ce216d0
--- /dev/null
+++ b/docs/gst_plugins_cache.json
@@ -0,0 +1,11 @@
+{
+ "omx": {
+ "description": "GStreamer OpenMAX Plug-ins",
+ "elements": {},
+ "filename": "libgstomx.so",
+ "license": "LGPL",
+ "package": "GStreamer OpenMAX Plug-ins",
+ "source": "gst-omx",
+ "url": "Unknown package origin"
+ }
+} \ No newline at end of file
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..b5d574b
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,3 @@
+---
+short-description: GStreamer plugins from OpenMax
+... \ No newline at end of file
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..908b4cf
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,62 @@
+build_hotdoc = false
+
+if meson.is_cross_build()
+ if get_option('doc').enabled()
+ error('Documentation enabled but building the doc while cross building is not supported yet.')
+ endif
+
+ message('Documentation not built as building the docmentation while cross building is not supported yet.')
+ subdir_done()
+endif
+
+required_hotdoc_extensions = ['gst-extension']
+if gst_dep.type_name() == 'internal'
+ gst_proj = subproject('gstreamer')
+ plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
+else
+ required_hotdoc_extensions += ['gst-extension']
+ plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
+ required: false)
+endif
+
+plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
+if plugins_cache_generator.found()
+ plugins_doc_dep = custom_target('omx-plugins-doc-cache',
+ command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
+ input: plugins,
+ output: 'gst_plugins_cache.json',
+ )
+else
+ warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
+endif
+
+hotdoc_p = find_program('hotdoc', required: get_option('doc'))
+if not hotdoc_p.found()
+ message('Hotdoc not found, not building the documentation')
+ subdir_done()
+endif
+
+build_hotdoc = true
+hotdoc = import('hotdoc')
+if not hotdoc.has_extensions(required_hotdoc_extensions)
+ if get_option('doc').enabled()
+ error('Documentation enabled but gi-extension missing')
+ endif
+
+ message('@0@ extensions not found, not building documentation'.format(required_hotdoc_extensions))
+ subdir_done()
+endif
+
+message('Plugins: @0@'.format(plugins))
+libs_doc = []
+plugins_doc = [hotdoc.generate_doc('omx',
+ project_version: api_version,
+ sitemap: 'sitemap.txt',
+ index: 'index.md',
+ gst_index: 'index.md',
+ gst_smart_index: true,
+ gst_c_sources: ['../gst/*/*.[ch]',],
+ gst_cache_file: plugins_cache,
+ gst_plugin_name: 'omx',
+ dependencies: [gstomx],
+)]
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
new file mode 100644
index 0000000..058a271
--- /dev/null
+++ b/docs/sitemap.txt
@@ -0,0 +1 @@
+gst-index
diff --git a/meson.build b/meson.build
index 8528fda..1bd8a70 100644
--- a/meson.build
+++ b/meson.build
@@ -399,6 +399,7 @@ endif
if not get_option('tests').disabled() and gstcheck_dep.found()
subdir('tests')
endif
+subdir('docs')
python3 = find_program('python3')
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/meson_options.txt b/meson_options.txt
index 75985ce..e18beb2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,3 +11,4 @@ option('struct_packing', type : 'combo',
option('examples', type : 'feature', value : 'auto', yield : true)
option('tests', type : 'feature', value : 'auto', yield : true)
option('tools', type : 'feature', value : 'auto', yield : true)
+option('doc', type : 'feature', value : 'auto', yield : true)
diff --git a/omx/meson.build b/omx/meson.build
index 1bcebf5..becb72f 100644
--- a/omx/meson.build
+++ b/omx/meson.build
@@ -59,3 +59,5 @@ gstomx = library('gstomx',
install : true,
install_dir : plugins_install_dir,
)
+
+plugins = [gstomx] \ No newline at end of file