wafHook: let derivations use an existing waf in a non-standard location

this is necessary for talloc
This commit is contained in:
Symphorien Gibol 2019-03-28 18:30:07 +01:00
parent 07b42ccf2d
commit f075de5c25
2 changed files with 9 additions and 8 deletions

View File

@ -2751,9 +2751,9 @@ addEnvHooks "$hostOffset" myBashFunction
<listitem>
<para>
Overrides the configure, build, and install phases. This will run the
"waf" script used by many projects. If waf doesnt exist, it will copy
the version of waf available in Nixpkgs wafFlags can be used to pass
flags to the waf script.
"waf" script used by many projects. If wafPath (default ./waf) doesnt
exist, it will copy the version of waf available in Nixpkgs. wafFlags can
be used to pass flags to the waf script.
</para>
</listitem>
</varlistentry>

View File

@ -1,8 +1,9 @@
wafConfigurePhase() {
runHook preConfigure
if ! [ -f ./waf ]; then
cp @waf@ waf
if ! [ -f "${wafPath:=./waf}" ]; then
echo "copying waf to $wafPath..."
cp @waf@ "$wafPath"
fi
if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
@ -14,7 +15,7 @@ wafConfigurePhase() {
${configureTargets:-configure}
)
echoCmd 'configure flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postConfigure
}
@ -33,7 +34,7 @@ wafBuildPhase () {
)
echoCmd 'build flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postBuild
}
@ -52,7 +53,7 @@ wafInstallPhase() {
)
echoCmd 'install flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"
runHook postInstall
}