diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2021-08-31 21:31:30 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2021-08-31 21:50:28 +0200 |
commit | 0adb58e29389544331a747f60d9038e58a6d87ac (patch) | |
tree | a657ee230b8ed3665628cbf1a99185e2826831c6 /docs | |
parent | e01295df4071de8e91cef94fe1a2a7003ec50180 (diff) | |
download | tracker-0adb58e29389544331a747f60d9038e58a6d87ac.tar.gz |
build: Ship devhelp docs in tarballwip/carlosg/dist-docs
Use a dist script to generate those docs and include them in the
tarball, the meson build definition has been changed to also account
for this shortcut if building from tarballs.
This avoids the hotdoc dependency and its dependencies (e.g. npm
modules) when building from tarballs.
Tarball size increased ~400KB, which stands on the acceptable size
since the tarball is still less than 2MB.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/meson.build | 1 | ||||
-rw-r--r-- | docs/reference/libtracker-sparql/dist-docs.sh | 23 | ||||
-rw-r--r-- | docs/reference/libtracker-sparql/meson.build | 12 |
3 files changed, 35 insertions, 1 deletions
diff --git a/docs/meson.build b/docs/meson.build index a57c8eb04..e43b12a8b 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -2,7 +2,6 @@ if get_option('man') subdir('manpages') endif if get_option('docs') - hotdoc = import('hotdoc') subdir('tools') subdir('reference') endif diff --git a/docs/reference/libtracker-sparql/dist-docs.sh b/docs/reference/libtracker-sparql/dist-docs.sh new file mode 100644 index 000000000..a95dd7373 --- /dev/null +++ b/docs/reference/libtracker-sparql/dist-docs.sh @@ -0,0 +1,23 @@ +#!/bin/sh +docs_name=$1 + +pushd $MESON_BUILD_ROOT + +# Ensure the build tree is compiled, we need generated files +ninja + +# Run hotdoc manually +pushd docs/reference/libtracker-sparql +hotdoc run --conf-file ${docs_name}-doc.json + +# Generate fixed .devhelp2 file +${MESON_SOURCE_ROOT}/docs/reference/libtracker-sparql/generate-devhelp.sh $1 + +# And copy the resulting devhelp documentation into the dist location +mv ${docs_name}-doc/devhelp/ ${MESON_DIST_ROOT}/docs/reference/libtracker-sparql/ + +# Delete the remaining docs +rm -rf ${docs_name}-doc/ + +popd +popd diff --git a/docs/reference/libtracker-sparql/meson.build b/docs/reference/libtracker-sparql/meson.build index c02469989..64254ddf3 100644 --- a/docs/reference/libtracker-sparql/meson.build +++ b/docs/reference/libtracker-sparql/meson.build @@ -1,3 +1,14 @@ +fs = import('fs') + +if fs.exists('devhelp') + # Special case for tarballs, install the pre-generated docs + install_subdir('devhelp/books', + install_dir: join_paths(datadir, 'devhelp')) + subdir_done() +endif + +hotdoc = import('hotdoc') + documents_with_examples = [ [ 'examples.md.in', 'examples.md' ], ] @@ -85,3 +96,4 @@ hotdoc.generate_doc(docs_name, ) meson.add_install_script('install-devhelp.sh', docs_name) +meson.add_dist_script('dist-docs.sh', docs_name) |