From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C4E46569B for ; Thu, 20 Sep 2018 15:19:09 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 040FA307D913; Thu, 20 Sep 2018 13:19:09 +0000 (UTC) Received: from localhost (unknown [10.32.181.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2557B7E6BD; Thu, 20 Sep 2018 13:19:07 +0000 (UTC) Date: Thu, 20 Sep 2018 15:19:07 +0200 From: Timothy Redaelli To: Luca Boccassi Cc: dev@dpdk.org, bruce.richardson@intel.com Message-ID: <20180920151907.4fffa29b@redhat.com> In-Reply-To: <20180919134827.15801-1-bluca@debian.org> References: <20180911161322.20114-1-bruce.richardson@intel.com> <20180919134827.15801-1-bluca@debian.org> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 20 Sep 2018 13:19:09 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2] doc: support building HTML guides with meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 13:19:10 -0000 On Wed, 19 Sep 2018 14:48:27 +0100 Luca Boccassi wrote: > From: Bruce Richardson > > Signed-off-by: Bruce Richardson > Signed-off-by: Luca Boccassi > --- > 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. > > doc/api/meson.build | 5 ++--- > doc/guides/meson.build | 27 +++++++++++++++++++++++++++ > doc/meson.build | 11 +++++++++++ > 3 files changed, 40 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..24f5316c5c > --- /dev/null > +++ b/doc/guides/meson.build > @@ -0,0 +1,27 @@ > +# 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', '@INPUT@', meson.current_build_dir() + '/guides', > + '-d', meson.current_build_dir() + '/.doctrees'], This on RHEL 7.5 doesn't work, since old versions of sphinx (I have v1.1.3) need all options before the paths. I tried to move "'-d', meson.current_build_dir() + '/.doctrees'" before "'@INPUT@'" and it worked. > + 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/') This on RHEL 7.5 doesn't work. I had to append custom.css to DEST ($MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css) to make it work. > +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 > > +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)