From 4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 11 Aug 2009 16:25:41 +0000 Subject: [PATCH] buildPythonPackage: Allow `checkPhase' and `postInstall' to be customized. svn path=/nixpkgs/trunk/; revision=16675 --- pkgs/development/python-modules/generic/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 33569fef29c..ce3c7d319d6 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -6,7 +6,9 @@ { python, setuptools, makeWrapper, lib }: { name, namePrefix ? "python-", src, meta, patches ? [] -, doCheck ? true, ... } @ attrs: +, doCheck ? true, checkPhase ? "python setup.py test" +, postInstall ? "" +, ... } @ attrs: let # Return the list of recursively propagated build inputs of PKG. @@ -27,7 +29,7 @@ python.stdenv.mkDerivation ( // (rec { - inherit src meta patches doCheck; + inherit src meta patches doCheck checkPhase; name = namePrefix + attrs.name; @@ -41,9 +43,6 @@ python.stdenv.mkDerivation ( buildPhase = "true"; - # Many packages, but not all, support this. - checkPhase = "python setup.py test"; - # XXX: Should we run `easy_install --always-unzip'? It doesn't seem # to have a noticeable impact on small scripts. installPhase = '' @@ -52,6 +51,8 @@ python.stdenv.mkDerivation ( echo "installing \`${name}' with \`easy_install'..." export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" easy_install --prefix="$out" . + + ${postInstall} ''; postFixup = ''