summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÍñigo Huguet <ihuguet@redhat.com>2024-03-25 16:03:33 +0100
committerÍñigo Huguet <ihuguet@redhat.com>2024-04-04 08:16:25 +0200
commit723ad4c0adadc59e9bf80b1fe8a97839c34166bd (patch)
treec11b6bab5e7a585f0b31c4f937c37408fdcab17f
parent632c4c260b33b796452bf89d36ade76536670e8a (diff)
meson: exclude intermediate files of docs generation from tarball
We want to distribute the generated documentation when we generate the tarball because we normally do it when we do a release, but `meson dist` only includes files that are commited to the repository, so a script meson-dist-data.sh was added with meson.add_dist_script in commit 1c41066a40d9 ('build: include documentation in meson dist'). This script was copying the whole documentation folders, including some intermediate files that are not useful for users that wants to read the docs. Get rid of them and copy only the files that are useful for users: the generated html pages in docs/api and docs/libnm and the final man pages. Also, including these intermediate files caused at least one build failure, although quite difficult to reproduce: - Generate tarball with meson - Untar the generated tarball - Using the sources from the tarball, configure the project with autotools, but building to an out-of-tree folder, not building in the source dir (i.e. using a 'build' subfolder). This is called a "VPATH build" by autotools and Make. See: - https://www.gnu.org/software/make/manual/html_node/General-Search.html - https://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html - Build In that scenario, we get an error trying to generate any file under man/ because the man/ subdirectory has not been created. The reason of this was that the man/ subdirectory is created by the Makefile when generating the file man/common.ent. However, this file was present in the source directory because it has been included in the tarball, so Make detects it and doesn't run the rules to generate it. The result is that out-of-tree-dir/man folder is not created. Not including the intermediate files solves this problem. Fixes: 1c41066a40d9 ('build: include documentation in meson dist')
-rwxr-xr-xtools/meson-dist-data.sh11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/meson-dist-data.sh b/tools/meson-dist-data.sh
index 1b5d3b03f2..15ba120a63 100755
--- a/tools/meson-dist-data.sh
+++ b/tools/meson-dist-data.sh
@@ -13,10 +13,6 @@ ensure_var_path() {
fi
}
-copy_from_build() {
- cp -Tr "$MESON_BUILD_ROOT/$1" "$MESON_DIST_ROOT/$1"
-}
-
if [ "$MESON_BUILD_ROOT" = "" ]; then
if [ "$1" = "--build-root" ]; then
MESON_BUILD_ROOT="$2"
@@ -29,7 +25,6 @@ ensure_var_path "MESON_SOURCE_ROOT"
ninja -C "$MESON_BUILD_ROOT" all libnm-doc NetworkManager-doc
-mkdir -p "$MESON_DIST_ROOT/docs/"
-copy_from_build /docs/api/
-copy_from_build /docs/libnm/
-copy_from_build /man/
+cp -Tr "$MESON_BUILD_ROOT/docs/api/html" "$MESON_DIST_ROOT/docs/api/html"
+cp -Tr "$MESON_BUILD_ROOT/docs/libnm/html" "$MESON_DIST_ROOT/docs/libnm/html"
+cp "$MESON_BUILD_ROOT/man/"*.[1-8] "$MESON_DIST_ROOT/man"