generic/setup.sh: remove duplication: - add generic showCommand function which prints a command before running it - add runMake which is using that function passing the makefile if set
make all make invokations use runMake svn path=/nixpkgs/branches/stdenv-updates/; revision=22282
This commit is contained in:
parent
d84ce122f9
commit
4f1075c40b
@ -73,6 +73,15 @@ addToSearchPath() {
|
|||||||
addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
|
addToSearchPathWithCustomDelimiter "${PATH_DELIMITER}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd(){
|
||||||
|
echo "cmd: $@"
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
runMake(){
|
||||||
|
cmd make ${makefile:+-f $makefile} "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Initialisation.
|
# Initialisation.
|
||||||
@ -601,9 +610,7 @@ buildPhase() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "make flags: $makeFlags ${makeFlagsArray[@]} $buildFlags ${buildFlagsArray[@]}"
|
runMake $makeFlags "${makeFlagsArray[@]}" \
|
||||||
make ${makefile:+-f $makefile} \
|
|
||||||
$makeFlags "${makeFlagsArray[@]}" \
|
|
||||||
$buildFlags "${buildFlagsArray[@]}"
|
$buildFlags "${buildFlagsArray[@]}"
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
@ -613,9 +620,7 @@ buildPhase() {
|
|||||||
checkPhase() {
|
checkPhase() {
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
|
|
||||||
echo "check flags: $makeFlags ${makeFlagsArray[@]} $checkFlags ${checkFlagsArray[@]}"
|
runMake $makeFlags "${makeFlagsArray[@]}" \
|
||||||
make ${makefile:+-f $makefile} \
|
|
||||||
$makeFlags "${makeFlagsArray[@]}" \
|
|
||||||
$checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
|
$checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
|
||||||
|
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
@ -663,8 +668,7 @@ installPhase() {
|
|||||||
ensureDir "$prefix"
|
ensureDir "$prefix"
|
||||||
|
|
||||||
installTargets=${installTargets:-install}
|
installTargets=${installTargets:-install}
|
||||||
echo "install flags: $installTargets $makeFlags ${makeFlagsArray[@]} $installFlags ${installFlagsArray[@]}"
|
runMake $installTargets \
|
||||||
make ${makefile:+-f $makefile} $installTargets \
|
|
||||||
$makeFlags "${makeFlagsArray[@]}" \
|
$makeFlags "${makeFlagsArray[@]}" \
|
||||||
$installFlags "${installFlagsArray[@]}"
|
$installFlags "${installFlagsArray[@]}"
|
||||||
|
|
||||||
@ -740,8 +744,7 @@ fixupPhase() {
|
|||||||
distPhase() {
|
distPhase() {
|
||||||
runHook preDist
|
runHook preDist
|
||||||
|
|
||||||
echo "dist flags: $distFlags ${distFlagsArray[@]}"
|
runMake $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
|
||||||
make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist}
|
|
||||||
|
|
||||||
if test "$dontCopyDist" != 1; then
|
if test "$dontCopyDist" != 1; then
|
||||||
ensureDir "$out/tarballs"
|
ensureDir "$out/tarballs"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user