[v1,2/2] Documentation: Add tuning guide from external source
diff mbox series

Message ID 20240814084215.61857-3-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Documentation: include tuning-guide via external repo
Related show

Commit Message

Stefan Klug Aug. 14, 2024, 8:41 a.m. UTC
Add the external tuning guide as meson subproject. Symlink it into the
Documentation/guides directory, so that sphinx can pick it up.

This setup feels a bit cumbersome, therefore I try to explain the
reasoning (and maybe someone comes up with a better solution):

The main reason is that we don't want to have large binary files (aka
images) in the main libcamera repository. Especially if they change a
lot the repository size increases tremendously. In a meson based
project, meson subprojects are the way to go. This however has the
following side effects:

- The subprojects needs to contain a meson.build (That's why
  libcamera-tuning-guide is also meson based)

- We can't reference ../subproject/libcamera-tuning-guide/tuning.rst
  from within the main meson build, as that violates the meson sandbox

- Referencing ../subproject/libcamera-tuning-guide/tuning.rst via a
  sphinx include directive doesn't work either as sphinx then tries to
  resolve images relative to the outer document.

- Symlinking ../subprojects/libcameta-tuning-guide into
  Documentation/guides works wuite well, but fails as soon as
libcamera-tuning-guide contains an additional rst file (like index.rst)
which is not referenced from the libcamera documentation.

The solution is to move the actual content into
../subproject/libcamera-tuning-guide/content/ and to symlink that
directory into Documentation/guides.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 Documentation/conf.py                   | 4 ++--
 Documentation/guides/tuning             | 1 +
 Documentation/index.rst                 | 1 +
 Documentation/meson.build               | 2 ++
 subprojects/libcamera-tuning-guide.wrap | 7 +++++++
 5 files changed, 13 insertions(+), 2 deletions(-)
 create mode 120000 Documentation/guides/tuning
 create mode 100644 subprojects/libcamera-tuning-guide.wrap

Patch
diff mbox series

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 022e698efac4..7675efb6682a 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -21,8 +21,8 @@ 
 # -- Project information -----------------------------------------------------
 
 project = 'libcamera'
-copyright = '2018-2019, The libcamera documentation authors'
-author = u'Kieran Bingham, Jacopo Mondi, Laurent Pinchart, Niklas Söderlund'
+copyright = '2018-2024, The libcamera documentation authors'
+author = u'Kieran Bingham, Jacopo Mondi, Laurent Pinchart, Niklas Söderlund, Stefan Klug'
 
 # Version information is provided by the build environment, through the
 # sphinx command line.
diff --git a/Documentation/guides/tuning b/Documentation/guides/tuning
new file mode 120000
index 000000000000..3e62b7b660d0
--- /dev/null
+++ b/Documentation/guides/tuning
@@ -0,0 +1 @@ 
+../../subprojects/libcamera-tuning-guide/content/
\ No newline at end of file
diff --git a/Documentation/index.rst b/Documentation/index.rst
index 5442ae75dde7..991dcf2b66fb 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -16,6 +16,7 @@ 
 
    Developer Guide <guides/introduction>
    Application Writer's Guide <guides/application-developer>
+   Sensor Tuning Guide <guides/tuning/tuning>
    Pipeline Handler Writer's Guide <guides/pipeline-handler>
    IPA Writer's guide <guides/ipa>
    Tracing guide <guides/tracing>
diff --git a/Documentation/meson.build b/Documentation/meson.build
index 1ba40fdf67ac..58c656a54150 100644
--- a/Documentation/meson.build
+++ b/Documentation/meson.build
@@ -143,6 +143,8 @@  if sphinx.found()
        '../README.rst',
     ]
 
+    subproject('libcamera-tuning-guide', required : true)
+
     release = 'release=v' + libcamera_git_version
 
     custom_target('documentation',
diff --git a/subprojects/libcamera-tuning-guide.wrap b/subprojects/libcamera-tuning-guide.wrap
new file mode 100644
index 000000000000..d8e172471fa6
--- /dev/null
+++ b/subprojects/libcamera-tuning-guide.wrap
@@ -0,0 +1,7 @@ 
+# SPDX-License-Identifier: CC0-1.0
+
+[wrap-git]
+directory = libcamera-tuning-guide
+url = https://git.uk.ideasonboard.com/sklug/libcamera-tuning-guide.git
+# tags/0.2.5
+revision = head