From a4362f150204daa65715a876bd196f1cb955c501 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 3 Sep 2020 16:26:58 +0100 Subject: [PATCH] doc: build without using make When building the DPDK guide documents, the DPDK version information was pulled using "make showversion", which meant there was a dependency on the DPDK make-based build system. Change this to have the version info passed in from meson itself. Signed-off-by: Bruce Richardson --- buildtools/call-sphinx-build.py | 5 ++++- doc/guides/conf.py | 7 +------ doc/guides/meson.build | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py index 85c9e01563..fa6f26b376 100755 --- a/buildtools/call-sphinx-build.py +++ b/buildtools/call-sphinx-build.py @@ -9,7 +9,10 @@ from os.path import join from subprocess import run, PIPE, STDOUT from distutils.version import StrictVersion -(sphinx, src, dst) = sys.argv[1:] # assign parameters to variables +(sphinx, version, src, dst) = sys.argv[1:] # assign parameters to variables + +# set the version in environment for sphinx to pick up +os.environ['DPDK_VERSION'] = version # for sphinx version >= 1.7 add parallelism using "-j auto" ver = run([sphinx, '--version'], stdout=PIPE, diff --git a/doc/guides/conf.py b/doc/guides/conf.py index d8fe5cccd7..9ebc26ed3f 100644 --- a/doc/guides/conf.py +++ b/doc/guides/conf.py @@ -2,7 +2,6 @@ # Copyright(c) 2010-2015 Intel Corporation from __future__ import print_function -import subprocess from docutils import nodes from distutils.version import LooseVersion from sphinx import __version__ as sphinx_version @@ -38,11 +37,7 @@ html_add_permalinks = "" html_show_copyright = False highlight_language = 'none' -# If MAKEFLAGS is exported by the user, garbage text might end up in version -version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion'], - env=dict(environ, MAKEFLAGS="")) -version = version.decode('utf-8').rstrip() -release = version +release = environ['DPDK_VERSION'] master_doc = 'index' diff --git a/doc/guides/meson.build b/doc/guides/meson.build index 732e7ad3a9..daab139c4e 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -11,7 +11,8 @@ htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk') html_guides = custom_target('html_guides', input: files('index.rst'), output: 'html', - command: [sphinx_wrapper, sphinx, meson.current_source_dir(), meson.current_build_dir()], + command: [sphinx_wrapper, sphinx, meson.project_version(), + meson.current_source_dir(), meson.current_build_dir()], depfile: '.html.d', build_by_default: get_option('enable_docs'), install: get_option('enable_docs'), -- 2.20.1