3 [Meson](https://mesonbuild.com/) is an open source meta build system meant to be
4 fast and user-friendly.
6 In Nixpkgs, meson comes with a setup hook that overrides the configure, check,
9 Being a meta build system, meson needs an accompanying backend. In the context
10 of Nixpkgs, the typical companion backend is [Ninja](#ninja), that provides a
11 setup hook registering ninja-based build and install phases.
13 ## Variables controlling Meson {#meson-variables-controlling}
15 ### Meson Exclusive Variables {#meson-exclusive-variables}
17 #### `mesonFlags` {#meson-flags}
19 Controls the flags passed to `meson setup` during configure phase.
21 #### `mesonBuildDir` {#meson-build-dir}
23 Directory where Meson will put intermediate files.
25 Setting this can be useful for debugging multiple Meson builds while in the same source directory, for example, when building for different platforms.
26 Different values for each build will prevent build artefacts from interefering with each other.
27 This setting has no tangible effect when running the build in a sandboxed derivation.
29 The default value is `build`.
31 #### `mesonWrapMode` {#meson-wrap-mode}
33 Which value is passed as
34 [`-Dwrap_mode=`](https://mesonbuild.com/Builtin-options.html#core-options)
35 to. In Nixpkgs the default value is `nodownload`, so that no subproject will be
36 downloaded (since network access is already disabled during deployment in
39 Note: Meson allows pre-population of subprojects that would otherwise be
42 #### `mesonBuildType` {#meson-build-type}
44 Which value is passed as
45 [`--buildtype`](https://mesonbuild.com/Builtin-options.html#core-options) to
46 `meson setup` during configure phase. In Nixpkgs the default value is `plain`.
48 #### `mesonAutoFeatures` {#meson-auto-features}
50 Which value is passed as
51 [`-Dauto_features=`](https://mesonbuild.com/Builtin-options.html#core-options)
52 to `meson setup` during configure phase. In Nixpkgs the default value is
53 `enabled`, meaning that every feature declared as "auto" by the meson scripts
56 #### `mesonCheckFlags` {#meson-check-flags}
58 Controls the flags passed to `meson test` during check phase.
60 #### `mesonInstallFlags` {#meson-install-flags}
62 Controls the flags passed to `meson install` during install phase.
64 #### `mesonInstallTags` {#meson-install-tags}
66 A list of installation tags passed to Meson's commandline option
67 [`--tags`](https://mesonbuild.com/Installing.html#installation-tags) during
70 Note: `mesonInstallTags` should be a list of strings, that will be converted to
71 a comma-separated string that is recognized to `--tags`.
72 Example: `mesonInstallTags = [ "emulator" "assembler" ];` will be converted to
73 `--tags emulator,assembler`.
75 #### `dontUseMesonConfigure` {#dont-use-meson-configure}
77 When set to true, don't use the predefined `mesonConfigurePhase`.
79 #### `dontUseMesonCheck` {#dont-use-meson-check}
81 When set to true, don't use the predefined `mesonCheckPhase`.
83 #### `dontUseMesonInstall` {#dont-use-meson-install}
85 When set to true, don't use the predefined `mesonInstallPhase`.
87 ### Honored variables {#meson-honored-variables}
89 The following variables commonly used by `stdenv.mkDerivation` are honored by
93 - `enableParallelBuilding`