Skip to content

Commit

Permalink
wafHook: let derivations use an existing waf in a non-standard location
Browse files Browse the repository at this point in the history
this is necessary for talloc
  • Loading branch information
symphorien committed Mar 28, 2019
1 parent 07b42cc commit f075de5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions doc/stdenv.xml
Expand Up @@ -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 doesn’t 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) doesn’t
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>
Expand Down
11 changes: 6 additions & 5 deletions pkgs/development/tools/build-managers/waf/setup-hook.sh
@@ -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
Expand All @@ -14,7 +15,7 @@ wafConfigurePhase() {
${configureTargets:-configure}
)
echoCmd 'configure flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"

runHook postConfigure
}
Expand All @@ -33,7 +34,7 @@ wafBuildPhase () {
)

echoCmd 'build flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"

runHook postBuild
}
Expand All @@ -52,7 +53,7 @@ wafInstallPhase() {
)

echoCmd 'install flags' "${flagsArray[@]}"
python waf "${flagsArray[@]}"
python "$wafPath" "${flagsArray[@]}"

runHook postInstall
}
Expand Down

0 comments on commit f075de5

Please sign in to comment.