From 6c6b5d77d696c160a8f65719058dba2faf783b3e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 29 Jan 2021 15:18:12 -0500 Subject: add_install_script: add skip_if_destdir kwarg It is common, at least in GNOME projects, to have scripts that must be run only in the final destination, to update system icon cache, etc. Skipping them from Meson ensures we can properly log that they have not been run instead of relying on such scripts to to it (they don't always). --- docs/markdown/Reference-manual.md | 4 ++++ docs/markdown/snippets/destdir.md | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 docs/markdown/snippets/destdir.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 72199df..fa6321a 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1851,6 +1851,10 @@ the following methods. `MESON_BUILD_ROOT`, `MESON_INSTALL_PREFIX`, `MESON_INSTALL_DESTDIR_PREFIX`, and `MESONINTROSPECT` set. All positional arguments are passed as parameters. + *since 0.57.0* `skip_if_destdir` boolean keyword argument (defaults to `false`) + can be specified. If `true` the script will not be run if DESTDIR is set during + installation. This is useful in the case the script updates system wide + cache that is only needed when copying files into final destination. *(since 0.54.0)* If `meson install` is called with the `--quiet` option, the environment variable `MESON_INSTALL_QUIET` will be set. diff --git a/docs/markdown/snippets/destdir.md b/docs/markdown/snippets/destdir.md new file mode 100644 index 0000000..d8cf55d --- /dev/null +++ b/docs/markdown/snippets/destdir.md @@ -0,0 +1,11 @@ +## Specify DESTDIR on command line + +`meson install` command now has `--destdir` argument that overrides DESTDIR +from environment. + +## Skip install scripts if DESTDIR is set + +`meson.add_install_script()` now has `skip_if_destdir` keyword argument. If set +to `true` the script won't be run if DESTDIR is set during installation. This is +useful in the case the script updates system wide cache that is only needed when +copying files into final destination. -- cgit v1.1