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..."
|
|
|
|
cp @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=(
|
|
|
|
@crossFlags@
|
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}
|
|
|
|
)
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
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 17:30:07 +00:00
|
|
|
python "$wafPath" "${flagsArray[@]}"
|
2018-11-10 20:30:48 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
}
|
|
|
|
|
|
|
|
configurePhase=wafConfigurePhase
|
|
|
|
buildPhase=wafBuildPhase
|
|
|
|
installPhase=wafInstallPhase
|