From patchwork Wed Sep 19 13:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Boccassi X-Patchwork-Id: 44918 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7BE101B53; Wed, 19 Sep 2018 15:48:36 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 17014F04 for ; Wed, 19 Sep 2018 15:48:33 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id t25-v6so7033213wmi.3 for ; Wed, 19 Sep 2018 06:48:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HP4DaVLgpn57a1K+7ovhJ/mh239JJVqJWQbKViHZ2JU=; b=TJF44klpvaTTdsnPLHAOTUdfhIDuMLsM8raj//Tw3lljQmFRkIsKfpJQVpgYrcJMLz 7WXC6kbx/iqsTyzUQdEWN/Epd0d092HPCff3nBYhDgIudWIEW98iNiyR8/FcL3ON7Sjf l1i95AbG+ruMr2yjEQ1k5ioqKW3/x4gV5ylqC2Jmfzf9LjbXtF4Qzgpcw7NSW+SxA9K/ GEnyweTJe2zJCWNuucQau/9g9rSQtVoYHy/kFcukXtj+i1XcST/DzQ/lrtcCUQ8UUAXo vO43h2eLX0YG4AXpc9gj8W7CRrJODiE6SBQPbEC6maIF8VwayF/ohR2mF8HipkjevPKV IVrQ== X-Gm-Message-State: APzg51C5ANEv03xisQekpccO7eQrIxX8V+022MV8qDbQtr4lsaPxm2yA 4ZUpWu4Wq2NnJ+PBvDpFKnoFOUj9xsw= X-Google-Smtp-Source: ANB0VdbVuPR48qWar0jgQIR5iwKTsc+3eRIZL/Mq5wIORuNke0oNOCeVXxCVQjy0c5DQ70dQ/aIcYg== X-Received: by 2002:a1c:610b:: with SMTP id v11-v6mr21115695wmb.20.1537364912033; Wed, 19 Sep 2018 06:48:32 -0700 (PDT) Received: from localhost ([2001:1be0:110d:fcfe:489f:80a9:5d59:c6bd]) by smtp.gmail.com with ESMTPSA id c8sm2796490wrx.92.2018.09.19.06.48.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Sep 2018 06:48:30 -0700 (PDT) From: Luca Boccassi To: dev@dpdk.org Cc: bruce.richardson@intel.com, Luca Boccassi Date: Wed, 19 Sep 2018 14:48:27 +0100 Message-Id: <20180919134827.15801-1-bluca@debian.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911161322.20114-1-bruce.richardson@intel.com> References: <20180911161322.20114-1-bruce.richardson@intel.com> Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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'], + 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/') +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)