2018-11-10 20:30:48 +00:00
|
|
|
wafConfigurePhase() {
|
|
|
|
runHook preConfigure
|
|
|
|
|
2019-03-28 17:30:07 +00:00
|
|
|
if ! [ -f "${wafPath:=./waf}" ]; then
|
|
|
|
echo "copying waf to $wafPath..."
|
2020-03-06 05:08:06 +00:00
|
|
|
cp @waf@/bin/waf "$wafPath"
|
2018-11-10 20:30:48 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-10 04:44:37 +01:00
|
|
|
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
|
|
|
|
wafConfigureFlags="${prefixKey:---prefix=}$prefix $wafConfigureFlags"
|
2018-11-10 20:30:48 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-10 04:44:37 +01:00
|
|
|
local flagsArray=(
|
2019-03-28 17:33:08 +00:00
|
|
|
"${flagsArray[@]}"
|
2019-04-10 04:44:37 +01:00
|
|
|
$wafConfigureFlags "${wafConfigureFlagsArray[@]}"
|
2018-11-10 20:30:48 +00:00
|
|
|
${configureTargets:-configure}
|
|
|
|
)
|
2020-02-09 06:53:46 +00:00
|
|
|
if [ -z "${dontAddWafCrossFlags:-}" ]; then
|
|
|
|
flagsArray+=(@crossFlags@)
|
|
|
|
fi
|
2018-11-10 20:30:48 +00:00
|
|
|
echoCmd 'configure flags' "${flagsArray[@]}"
|
2019-03-28 17:30:07 +00:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 20:30:48 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
}
|
|
|
|
|
2020-02-09 06:29:53 +00:00
|
|
|
if [ -z "${dontUseWafConfigure-}" -a -z "${configurePhase-}" ]; then
|
|
|
|
configurePhase=wafConfigurePhase
|
|
|
|
fi
|
|
|
|
|
2018-11-10 20:30:48 +00:00
|
|
|
wafBuildPhase () {
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
# set to empty if unset
|
|
|
|
: ${wafFlags=}
|
|
|
|
|
|
|
|
local flagsArray=(
|
|
|
|
${enableParallelBuilding:+-j ${NIX_BUILD_CORES}}
|
|
|
|
$wafFlags ${wafFlagsArray[@]}
|
|
|
|
$buildFlags ${buildFlagsArray[@]}
|
|
|
|
${buildTargets:-build}
|
|
|
|
)
|
|
|
|
|
|
|
|
echoCmd 'build flags' "${flagsArray[@]}"
|
2019-03-28 17:30:07 +00:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 20:30:48 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
}
|
|
|
|
|
2020-02-09 06:29:53 +00:00
|
|
|
if [ -z "${dontUseWafBuild-}" -a -z "${buildPhase-}" ]; then
|
|
|
|
buildPhase=wafBuildPhase
|
|
|
|
fi
|
|
|
|
|
2018-11-10 20:30:48 +00:00
|
|
|
wafInstallPhase() {
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
if [ -n "$prefix" ]; then
|
|
|
|
mkdir -p "$prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
local flagsArray=(
|
|
|
|
$wafFlags ${wafFlagsArray[@]}
|
|
|
|
$installFlags ${installFlagsArray[@]}
|
2020-02-09 07:13:43 +00:00
|
|
|
${installTargets:-install}
|
2018-11-10 20:30:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echoCmd 'install flags' "${flagsArray[@]}"
|
2019-03-28 17:30:07 +00:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 20:30:48 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
}
|
|
|
|
|
2020-02-09 06:29:53 +00:00
|
|
|
if [ -z "${dontUseWafInstall-}" -a -z "${installPhase-}" ]; then
|
|
|
|
installPhase=wafInstallPhase
|
|
|
|
fi
|