summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-08-11 16:25:41 +0000
committerLudovic Courtès <ludo@gnu.org>2009-08-11 16:25:41 +0000
commit4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1 (patch)
treeec979a2ae125de1295e8e204fa147159ef837c44 /pkgs
parent6344a8d3748bc3a95a2e489624bd10ba6e81e131 (diff)
downloadnixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar.gz
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar.bz2
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar.lz
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar.xz
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.tar.zst
nixpkgs-4a4f864c6f687e2ca73111ce0ccc86bd7f870ba1.zip
buildPythonPackage: Allow `checkPhase' and `postInstall' to be customized.
svn path=/nixpkgs/trunk/; revision=16675
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/generic/default.nix11
1 files 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 = ''