When using hotdoc, one can build the documentation for a single
subproject (eg. the GL plugins). In that case, hotdoc will look
up links in devhelp indexes available in standard locations.
To make sure this case works, we thus need to add the path to
our devhelp index to XDG_DATA_DIRS. This also means when running
devhelp from inside the environment, the devhelp books produced
by hotdoc will now show up.
# Add meson/ into PYTHONPATH if we are using a local meson
prepend_env_var(env, 'PYTHONPATH', mesonpath)
+ # For devhelp books
+ if not 'XDG_DATA_DIRS' in env or not env['XDG_DATA_DIRS']:
+ # Preserve default paths when empty
+ prepend_env_var(env, 'XDG_DATA_DIRS', '/usr/local/share/:/usr/share/')
+
+ prepend_env_var (env, 'XDG_DATA_DIRS', os.path.join(options.builddir,
+ 'subprojects',
+ 'gst-docs',
+ 'GStreamer-doc'))
+
return env
def get_windows_shell():