2023-11-16 04:20:00 +00:00
|
|
|
|
# shellcheck shell=bash disable=SC2206
|
|
|
|
|
|
|
|
|
|
mesonConfigurePhase() {
|
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
|
|
local flagsArray=()
|
|
|
|
|
|
|
|
|
|
if [ -z "${dontAddPrefix-}" ]; then
|
|
|
|
|
flagsArray+=("--prefix=$prefix")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# See multiple-outputs.sh and meson’s coredata.py
|
|
|
|
|
flagsArray+=(
|
|
|
|
|
"--libdir=${!outputLib}/lib"
|
|
|
|
|
"--libexecdir=${!outputLib}/libexec"
|
|
|
|
|
"--bindir=${!outputBin}/bin"
|
|
|
|
|
"--sbindir=${!outputBin}/sbin"
|
|
|
|
|
"--includedir=${!outputInclude}/include"
|
|
|
|
|
"--mandir=${!outputMan}/share/man"
|
|
|
|
|
"--infodir=${!outputInfo}/share/info"
|
|
|
|
|
"--localedir=${!outputLib}/share/locale"
|
|
|
|
|
"-Dauto_features=${mesonAutoFeatures:-enabled}"
|
|
|
|
|
"-Dwrap_mode=${mesonWrapMode:-nodownload}"
|
|
|
|
|
"--buildtype=${mesonBuildType:-plain}"
|
|
|
|
|
)
|
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
concatTo flagsArray mesonFlags mesonFlagsArray
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
|
|
echoCmd 'mesonConfigurePhase flags' "${flagsArray[@]}"
|
|
|
|
|
|
|
|
|
|
meson setup build "${flagsArray[@]}"
|
|
|
|
|
cd build || { echoCmd 'mesonConfigurePhase' "could not cd to build"; exit 1; }
|
|
|
|
|
|
|
|
|
|
if ! [[ -v enableParallelBuilding ]]; then
|
|
|
|
|
enableParallelBuilding=1
|
|
|
|
|
echoCmd 'mesonConfigurePhase' "enabled parallel building"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase && -z $dontUseMesonCheck ]]; then
|
|
|
|
|
checkPhase=mesonCheckPhase
|
|
|
|
|
fi
|
|
|
|
|
if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase && -z $dontUseMesonInstall ]]; then
|
|
|
|
|
installPhase=mesonInstallPhase
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mesonCheckPhase() {
|
|
|
|
|
runHook preCheck
|
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
|
local flagsArray=()
|
|
|
|
|
concatTo flagsArray mesonCheckFlags mesonCheckFlagsArray
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
|
|
echoCmd 'mesonCheckPhase flags' "${flagsArray[@]}"
|
2024-06-20 14:57:18 +00:00
|
|
|
|
meson test --no-rebuild --print-errorlogs "${flagsArray[@]}"
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mesonInstallPhase() {
|
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
|
|
local flagsArray=()
|
|
|
|
|
|
|
|
|
|
if [[ -n "$mesonInstallTags" ]]; then
|
2024-09-19 14:19:46 +00:00
|
|
|
|
flagsArray+=("--tags" "$(concatStringsSep "," mesonInstallTags)")
|
2023-11-16 04:20:00 +00:00
|
|
|
|
fi
|
2024-09-19 14:19:46 +00:00
|
|
|
|
concatTo flagsArray mesonInstallFlags mesonInstallFlagsArray
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
|
|
echoCmd 'mesonInstallPhase flags' "${flagsArray[@]}"
|
|
|
|
|
meson install --no-rebuild "${flagsArray[@]}"
|
|
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if [ -z "${dontUseMesonConfigure-}" ] && [ -z "${configurePhase-}" ]; then
|
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
|
setOutputFlags=
|
|
|
|
|
configurePhase=mesonConfigurePhase
|
|
|
|
|
fi
|