* Add an installCheckPhase.

svn path=/nixpkgs/branches/stdenv-updates/; revision=33967
This commit is contained in:
Eelco Dolstra 2012-05-01 21:00:30 +00:00
parent 661d16d3fe
commit be901fa8be
2 changed files with 19 additions and 5 deletions

View file

@ -767,6 +767,19 @@ fixupPhase() {
}
installCheckPhase() {
runHook preInstallCheck
echo "installcheck flags: $makeFlags ${makeFlagsArray[@]} $installCheckFlags ${installCheckFlagsArray[@]}"
make ${makefile:+-f $makefile} \
${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
$makeFlags "${makeFlagsArray[@]}" \
$installCheckFlags "${installCheckFlagsArray[@]}" ${installCheckTarget:-installcheck}
runHook postInstallCheck
}
distPhase() {
runHook preDist
@ -795,6 +808,7 @@ showPhaseHeader() {
checkPhase) header "running tests";;
installPhase) header "installing";;
fixupPhase) header "post-installation fixup";;
installCheckPhase) header "running install tests";;
*) header "$phase";;
esac
}
@ -811,7 +825,7 @@ genericBuild() {
if [ -z "$phases" ]; then
phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
configurePhase $preBuildPhases buildPhase checkPhase \
$preInstallPhases installPhase fixupPhase \
$preInstallPhases installPhase fixupPhase installCheckPhase \
$preDistPhases distPhase $postPhases";
fi
@ -820,6 +834,7 @@ genericBuild() {
if [ "$curPhase" = checkPhase -a -z "$doCheck" ]; then continue; fi
if [ "$curPhase" = installPhase -a -n "$dontInstall" ]; then continue; fi
if [ "$curPhase" = fixupPhase -a -n "$dontFixup" ]; then continue; fi
if [ "$curPhase" = installCheckPhase -a -z "$doInstallCheck" ]; then continue; fi
if [ "$curPhase" = distPhase -a -z "$doDist" ]; then continue; fi
if [ -n "$tracePhases" ]; then

View file

@ -34,6 +34,8 @@ stdenv.mkDerivation rec {
CFLAGS=-O3 CXXFLAGS=-O3
'';
doInstallCheck = true;
crossAttrs = {
postUnpack =
'' export CPATH="${bzip2.hostDrv}/include"
@ -51,14 +53,11 @@ stdenv.mkDerivation rec {
'' + stdenv.lib.optionalString (
stdenv.cross ? nix && stdenv.cross.nix ? system
) ''--with-system=${stdenv.cross.nix.system}'';
doCheck = false;
postInstall = ":";
doInstallCheck = false;
};
enableParallelBuilding = true;
postInstall = "make installcheck";
meta = {
description = "The Nix Deployment System";
homepage = http://nixos.org/;