2018-11-10 21:30:48 +01:00
|
|
|
wafConfigurePhase() {
|
|
|
|
runHook preConfigure
|
|
|
|
|
2019-03-28 18:30:07 +01:00
|
|
|
if ! [ -f "${wafPath:=./waf}" ]; then
|
|
|
|
echo "copying waf to $wafPath..."
|
|
|
|
cp @waf@ "$wafPath"
|
2018-11-10 21:30:48 +01:00
|
|
|
fi
|
|
|
|
|
2019-04-10 05:44:37 +02:00
|
|
|
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
|
|
|
|
wafConfigureFlags="${prefixKey:---prefix=}$prefix $wafConfigureFlags"
|
2018-11-10 21:30:48 +01:00
|
|
|
fi
|
|
|
|
|
2019-04-10 05:44:37 +02:00
|
|
|
local flagsArray=(
|
|
|
|
@crossFlags@
|
2019-03-28 18:33:08 +01:00
|
|
|
"${flagsArray[@]}"
|
2019-04-10 05:44:37 +02:00
|
|
|
$wafConfigureFlags "${wafConfigureFlagsArray[@]}"
|
2018-11-10 21:30:48 +01:00
|
|
|
${configureTargets:-configure}
|
|
|
|
)
|
|
|
|
echoCmd 'configure flags' "${flagsArray[@]}"
|
2019-03-28 18:30:07 +01:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 21:30:48 +01:00
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
}
|
|
|
|
|
|
|
|
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 18:30:07 +01:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 21:30:48 +01:00
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
}
|
|
|
|
|
|
|
|
wafInstallPhase() {
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
if [ -n "$prefix" ]; then
|
|
|
|
mkdir -p "$prefix"
|
|
|
|
fi
|
|
|
|
|
|
|
|
local flagsArray=(
|
|
|
|
$wafFlags ${wafFlagsArray[@]}
|
|
|
|
$installFlags ${installFlagsArray[@]}
|
|
|
|
${installTargets:-install}
|
|
|
|
)
|
|
|
|
|
|
|
|
echoCmd 'install flags' "${flagsArray[@]}"
|
2019-03-28 18:30:07 +01:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 21:30:48 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
}
|
|
|
|
|
|
|
|
configurePhase=wafConfigurePhase
|
|
|
|
buildPhase=wafBuildPhase
|
|
|
|
installPhase=wafInstallPhase
|