portfolio: 0.71.2 -> 0.72.2 (#360387)
[NixPkgs.git] / pkgs / by-name / me / meson / setup-hook.sh
blobb2061a12058ca3e50e22f9cc96d9ae4592dcca39
1 # shellcheck shell=bash disable=SC2206
3 mesonConfigurePhase() {
4 runHook preConfigure
6 : ${mesonBuildDir:=build}
8 local flagsArray=()
10 if [ -z "${dontAddPrefix-}" ]; then
11 flagsArray+=("--prefix=$prefix")
14 # See multiple-outputs.sh and meson’s coredata.py
15 flagsArray+=(
16 "--libdir=${!outputLib}/lib"
17 "--libexecdir=${!outputLib}/libexec"
18 "--bindir=${!outputBin}/bin"
19 "--sbindir=${!outputBin}/sbin"
20 "--includedir=${!outputInclude}/include"
21 "--mandir=${!outputMan}/share/man"
22 "--infodir=${!outputInfo}/share/info"
23 "--localedir=${!outputLib}/share/locale"
24 "-Dauto_features=${mesonAutoFeatures:-enabled}"
25 "-Dwrap_mode=${mesonWrapMode:-nodownload}"
26 "--buildtype=${mesonBuildType:-plain}"
29 concatTo flagsArray mesonFlags mesonFlagsArray
31 echoCmd 'mesonConfigurePhase flags' "${flagsArray[@]}"
33 meson setup "$mesonBuildDir" "${flagsArray[@]}"
34 cd "$mesonBuildDir" || { echoCmd 'mesonConfigurePhase' "could not cd to $mesonBuildDir"; exit 1; }
36 if ! [[ -v enableParallelBuilding ]]; then
37 enableParallelBuilding=1
38 echoCmd 'mesonConfigurePhase' "enabled parallel building"
41 if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase && -z $dontUseMesonCheck ]]; then
42 checkPhase=mesonCheckPhase
44 if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase && -z $dontUseMesonInstall ]]; then
45 installPhase=mesonInstallPhase
48 runHook postConfigure
51 mesonCheckPhase() {
52 runHook preCheck
54 local flagsArray=()
55 concatTo flagsArray mesonCheckFlags mesonCheckFlagsArray
57 if [ -z "${dontAddTimeoutMultiplier:-}" ]; then
58 flagsArray+=("--timeout-multiplier=0")
61 echoCmd 'mesonCheckPhase flags' "${flagsArray[@]}"
62 meson test --no-rebuild --print-errorlogs "${flagsArray[@]}"
64 runHook postCheck
67 mesonInstallPhase() {
68 runHook preInstall
70 local flagsArray=()
72 if [[ -n "$mesonInstallTags" ]]; then
73 flagsArray+=("--tags" "$(concatStringsSep "," mesonInstallTags)")
75 concatTo flagsArray mesonInstallFlags mesonInstallFlagsArray
77 echoCmd 'mesonInstallPhase flags' "${flagsArray[@]}"
78 meson install --no-rebuild "${flagsArray[@]}"
80 runHook postInstall
83 if [ -z "${dontUseMesonConfigure-}" ] && [ -z "${configurePhase-}" ]; then
84 # shellcheck disable=SC2034
85 setOutputFlags=
86 configurePhase=mesonConfigurePhase