From da1a5568a13145b107a4d1ba3919d32277943c25 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 10 Mar 2024 22:25:42 +0200 Subject: [PATCH] doc: add options to change what /usr and /etc paths are shown Add options to change the 'prefix' and 'sysconfdir' values shown in documentation, e.g. on config file man pages. Update CI to set them, so that its produced output doesn't show /builds/pipewire/... on man pages --- .gitlab-ci.yml | 2 ++ doc/meson.build | 25 ++++++++++++++++++++++--- meson_options.txt | 8 ++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcea8f3db..21b3e7e1a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -265,6 +265,8 @@ build_on_fedora: variables: MESON_OPTIONS: >- -Ddocs=enabled + -Ddoc-prefix-value=/usr + -Ddoc-sysconfdir-value=/etc -Dinstalled_tests=enabled -Dsystemd-system-service=enabled -Dbluez5-backend-hsphfpd=enabled diff --git a/doc/meson.build b/doc/meson.build index 87d967032..d00d3cde3 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -7,14 +7,33 @@ doxyfile_conf.set('top_srcdir', meson.project_source_root()) doxyfile_conf.set('top_builddir', meson.project_build_root()) doxyfile_conf.set('output_directory', meson.current_build_dir()) +doc_prefix_value = get_option('doc-prefix-value') +doc_sysconfdir_value = get_option('doc-sysconfdir-value') + +if doc_prefix_value == '' and doc_sysconfdir_value == '' + doc_spa_plugindir = spa_plugindir + doc_pipewire_configdir = pipewire_configdir + doc_pipewire_confdatadir = pipewire_confdatadir +else + if doc_prefix_value == '' + doc_prefix_value = get_option('prefix') + endif + if doc_sysconfdir_value == '' + doc_sysconfdir_value = get_option('sysconfdir') + endif + doc_spa_plugindir = doc_prefix_value / get_option('libdir') / spa_name + doc_pipewire_configdir = doc_prefix_value / doc_sysconfdir_value / 'pipewire' + doc_pipewire_confdatadir = doc_prefix_value / get_option('datadir') / 'pipewire' +endif + doxygen_env = environment() doxygen_env.set('PACKAGE_NAME', meson.project_name()) doxygen_env.set('PACKAGE_VERSION', meson.project_version()) doxygen_env.set('PACKAGE_URL', 'https://pipewire.org') doxygen_env.set('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/pipewire/pipewire/issues') -doxygen_env.set('PIPEWIRE_CONFIG_DIR', pipewire_configdir) -doxygen_env.set('PIPEWIRE_CONFDATADIR', pipewire_confdatadir) -doxygen_env.set('SPA_PLUGINDIR', spa_plugindir) +doxygen_env.set('PIPEWIRE_CONFIG_DIR', doc_pipewire_configdir) +doxygen_env.set('PIPEWIRE_CONFDATADIR', doc_pipewire_confdatadir) +doxygen_env.set('SPA_PLUGINDIR', doc_spa_plugindir) doxygen_env.set('BUILD_DIR', meson.current_build_dir()) dot_found = find_program('dot', required: false).found() diff --git a/meson_options.txt b/meson_options.txt index 781fc10e9..be334ff5d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -350,3 +350,11 @@ option('snap', description : 'Enable Snap permissions support.', type : 'feature', value : 'auto') +option('doc-prefix-value', + description : 'Installation prefix to show in documentation instead of the actual value.', + type : 'string', + value : '') +option('doc-sysconfdir-value', + description : 'Sysconf data directory to show in documentation instead of the actual value.', + type : 'string', + value : '')