From patchwork Fri Aug 15 14:39:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24149 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 90F1EBDCC1 for ; Fri, 15 Aug 2025 14:39:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 473BD69259; Fri, 15 Aug 2025 16:39:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S6BKx6JC"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 979D661443 for ; Fri, 15 Aug 2025 16:39:09 +0200 (CEST) Received: from pb-laptop.local (185.221.141.188.nat.pool.zt.hu [185.221.141.188]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A0DE56D; Fri, 15 Aug 2025 16:38:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755268694; bh=oME7AnFq5Cke6Mhjv4sHYfP57Bjkum5WRco8oifXkys=; h=From:To:Cc:Subject:Date:From; b=S6BKx6JCXu3nKtoVh4PPqH3/J0/ZjaQ4d5VqfOPq0iTqWueFOpakfTOdXMU5tRSuZ cQxC+5KDVyIILMS6vpJd+lrOB4AkaIho+sjERe71Fush/I+5S5tUmpYjLxFzzmlYmj Fik3F3PZIa7ZIzuRnRklcD/c8slbfizkZq7OlicY= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [RFC PATCH v2] Documentation: Fix documentation generation when subproject Date: Fri, 15 Aug 2025 16:39:05 +0200 Message-ID: <20250815143905.2247112-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The paths of the doxygen tag files for sphinxcontrib-doxygen must be absolute or relative the the current working directory. However, when libcamera is built as a subproject, the current working directory is the top-level build directory. Thus the paths for the tag files will not be correct. Fix that by using `configure_file()` to generate the final sphinx configuration with the appropriate paths queried from meson. Fixes: 0382d215d ("Documentation: Use Sphinx doxylink to generate links to doxygen") Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- changes in v2: * variables in alphabetical order * import 'fs' module explicitly v1: https://patchwork.libcamera.org/patch/24044/ --- Documentation/{conf.py => conf.py.in} | 6 +++--- Documentation/meson.build | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 5 deletions(-) rename Documentation/{conf.py => conf.py.in} (95%) -- 2.50.1 diff --git a/Documentation/conf.py b/Documentation/conf.py.in similarity index 95% rename from Documentation/conf.py rename to Documentation/conf.py.in index f50be60a1..097e579b5 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py.in @@ -74,11 +74,11 @@ pygments_style = None doxylink = { 'doxy-pub': ( - 'Documentation/api-html/tagfile.xml', + '@TOP_BUILDDIR@/Documentation/api-html/tagfile.xml', '../api-html/', ), 'doxy-int': ( - 'Documentation/internal-api-html/tagfile.xml', + '@TOP_BUILDDIR@/Documentation/internal-api-html/tagfile.xml', '../internal-api-html/', ), } @@ -89,7 +89,7 @@ doxylink = { # a list of builtin themes. # html_theme = 'theme' -html_theme_path = ['.'] +html_theme_path = ['@THEME_DIR@'] # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/Documentation/meson.build b/Documentation/meson.build index b898ba3a0..10aaf613e 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -142,11 +142,21 @@ if sphinx.found() .format(mod, version, min_version)) endif + sphinx_conf = configure_file(input : 'conf.py.in', + output : 'conf.py', + configuration : { + 'THEME_DIR': meson.current_source_dir(), + 'TOP_BUILDDIR': meson.project_build_root(), + }) + + fs = import('fs') + sphinx_conf_dir = fs.parent(sphinx_conf) + docs_sources = [ 'camera-sensor-model.rst', 'code-of-conduct.rst', 'coding-style.rst', - 'conf.py', + sphinx_conf, 'contributing.rst', 'design/ae.rst', 'documentation-contents.rst', @@ -171,6 +181,7 @@ if sphinx.found() custom_target('documentation', command : [sphinx, '-D', release, '-q', '-W', '-b', 'html', + '-c', sphinx_conf_dir, meson.current_source_dir(), '@OUTPUT@'], input : docs_sources, output : 'html', @@ -184,7 +195,9 @@ if sphinx.found() install_tag : 'doc') custom_target('documentation-linkcheck', - command : [sphinx, '-W', '-b', 'linkcheck', meson.current_source_dir(), '@OUTPUT@'], + command : [sphinx, '-W', '-b', 'linkcheck', + '-c', sphinx_conf_dir, + meson.current_source_dir(), '@OUTPUT@'], build_always_stale : true, input : docs_sources, output : 'linkcheck')