DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, tredaelli@redhat.com,
	Luca Boccassi <bluca@debian.org>
Subject: [dpdk-dev] [PATCH v3] doc: support building HTML guides with meson
Date: Thu, 20 Sep 2018 14:22:08 +0100	[thread overview]
Message-ID: <20180920132208.14583-1-bluca@debian.org> (raw)
In-Reply-To: <20180911161322.20114-1-bruce.richardson@intel.com>

From: Bruce Richardson <bruce.richardson@intel.com>

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Luca Boccassi <bluca@debian.org>
---
v2: send on behalf of Bruce on request.
    - tell sphinx to create .doctrees working files in the
      parent of the target directory so that they don't get
      installed
    - change the output directory so that it matches the legacy
      makefiles directory structure (on install)
    - add install_dir to fix ninja install
    - add post-install calls to delete .buildinfo sphinx
      temporary file and to install custom.css as the makefiles
      do
The installed directory has been verified to be bit-by-bit
identical to the legacy makefiles with diffoscope.

v3: re-arranged sphinx parameters to make it work on older
    versions  (RHEL 7), and specify DEST filename on the
    install call, to make it work on older version (RHEL 7)

 doc/api/meson.build    |  5 ++---
 doc/guides/meson.build | 28 ++++++++++++++++++++++++++++
 doc/meson.build        | 11 +++++++++++
 3 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 doc/guides/meson.build

diff --git a/doc/api/meson.build b/doc/api/meson.build
index 13fcbb8cd7..30bdc573b5 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -50,7 +50,6 @@ if doxygen.found()
 		install_dir: htmldir,
 		build_by_default: false)
 
-	run_target('doc', command: 'true', depends: doxy_build)
-else
-	run_target('doc', command: ['echo', 'doxygen', 'not', 'found'])
+	doc_targets += doxy_build
+	doc_target_names += 'Doxygen_API'
 endif
diff --git a/doc/guides/meson.build b/doc/guides/meson.build
new file mode 100644
index 0000000000..06f14882bb
--- /dev/null
+++ b/doc/guides/meson.build
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Intel Corporation
+
+sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
+
+if sphinx.found()
+	htmldir = join_paths('share', 'doc', 'dpdk')
+	html_guides_build = custom_target('html_guides_build',
+		input: meson.current_source_dir(),
+		output: 'guides',
+		command: [sphinx, '-b', 'html',
+			'-d', meson.current_build_dir() + '/.doctrees',
+			'@INPUT@', meson.current_build_dir() + '/guides'],
+		build_by_default: false,
+		install: get_option('enable_docs'),
+		install_dir: htmldir)
+
+	doc_targets += html_guides_build
+	doc_target_names += 'HTML_Guides'
+
+	# sphinx leaves a .buildinfo in the target directory, which we don't
+	# want to install. Note that sh -c has to be used, otherwise the
+	# env var does not get expanded if calling rm/install directly.
+	meson.add_install_script('sh', '-c',
+		'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo')
+	meson.add_install_script('sh', '-c',
+		'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css')
+endif
diff --git a/doc/meson.build b/doc/meson.build
index afca2e7133..c5410d85d6 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -1,4 +1,15 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+doc_targets = []
+doc_target_names = []
 subdir('api')
+subdir('guides')
+
+if doc_targets.length() == 0
+	message = 'No docs targets found'
+else
+	message = 'Building docs:'
+endif
+run_target('doc', command: ['echo', message, doc_target_names],
+	depends: doc_targets)
-- 
2.18.0

  parent reply	other threads:[~2018-09-20 13:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 16:13 [dpdk-dev] [PATCH] " Bruce Richardson
2018-09-11 20:36 ` Luca Boccassi
2018-09-11 21:47   ` Luca Boccassi
2018-09-12  9:36     ` Bruce Richardson
2018-09-12  9:48       ` Luca Boccassi
2018-09-12 10:13         ` Bruce Richardson
2018-09-12 12:08           ` Luca Boccassi
2018-09-19 13:48 ` [dpdk-dev] [PATCH v2] " Luca Boccassi
2018-09-20 13:19   ` Timothy Redaelli
2018-09-20 13:22 ` Luca Boccassi [this message]
2018-09-20 13:51   ` [dpdk-dev] [PATCH v3] " Timothy Redaelli
2018-10-27 21:54     ` Thomas Monjalon
2018-10-29 10:01       ` Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920132208.14583-1-bluca@debian.org \
    --to=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=tredaelli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).