diff --git a/doc/hooks/meson.section.md b/doc/hooks/meson.section.md index 93e7019c311b..dc261271326a 100644 --- a/doc/hooks/meson.section.md +++ b/doc/hooks/meson.section.md @@ -43,3 +43,12 @@ Disables using Meson’s `checkPhase`. ### `dontUseMesonInstall` {#dontusemesoninstall} Disables using Meson’s `installPhase`. + +### `mesonInstallFlags` {#mesoninstallflags} + +Controls the flags passed to meson install. + +### `mesonInstallTags` (#mesoninstalltags) + +Tags specified here will be passed to Meson as via `--tags` during +installation and controls which components will be installed. diff --git a/pkgs/development/tools/build-managers/meson/setup-hook.sh b/pkgs/development/tools/build-managers/meson/setup-hook.sh index 21faac529c6d..dc7780b2fd3d 100644 --- a/pkgs/development/tools/build-managers/meson/setup-hook.sh +++ b/pkgs/development/tools/build-managers/meson/setup-hook.sh @@ -55,6 +55,10 @@ mesonInstallPhase() { # shellcheck disable=SC2086 local flagsArray=($mesonInstallFlags "${mesonInstallFlagsArray[@]}") + if [[ -n "$mesonInstallTags" ]]; then + flagsArray+=("--tags" "${mesonInstallTags// /,}") + fi + echoCmd 'install flags' "${flagsArray[@]}" meson install --no-rebuild "${flagsArray[@]}"