buildPythonPackage: Allow checkPhase' and
postInstall' to be customized.
svn path=/nixpkgs/trunk/; revision=16675
This commit is contained in:
parent
6344a8d374
commit
4a4f864c6f
@ -6,7 +6,9 @@
|
|||||||
{ python, setuptools, makeWrapper, lib }:
|
{ python, setuptools, makeWrapper, lib }:
|
||||||
|
|
||||||
{ name, namePrefix ? "python-", src, meta, patches ? []
|
{ name, namePrefix ? "python-", src, meta, patches ? []
|
||||||
, doCheck ? true, ... } @ attrs:
|
, doCheck ? true, checkPhase ? "python setup.py test"
|
||||||
|
, postInstall ? ""
|
||||||
|
, ... } @ attrs:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Return the list of recursively propagated build inputs of PKG.
|
# Return the list of recursively propagated build inputs of PKG.
|
||||||
@ -27,7 +29,7 @@ python.stdenv.mkDerivation (
|
|||||||
//
|
//
|
||||||
|
|
||||||
(rec {
|
(rec {
|
||||||
inherit src meta patches doCheck;
|
inherit src meta patches doCheck checkPhase;
|
||||||
|
|
||||||
name = namePrefix + attrs.name;
|
name = namePrefix + attrs.name;
|
||||||
|
|
||||||
@ -41,9 +43,6 @@ python.stdenv.mkDerivation (
|
|||||||
|
|
||||||
buildPhase = "true";
|
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
|
# XXX: Should we run `easy_install --always-unzip'? It doesn't seem
|
||||||
# to have a noticeable impact on small scripts.
|
# to have a noticeable impact on small scripts.
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
@ -52,6 +51,8 @@ python.stdenv.mkDerivation (
|
|||||||
echo "installing \`${name}' with \`easy_install'..."
|
echo "installing \`${name}' with \`easy_install'..."
|
||||||
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
||||||
easy_install --prefix="$out" .
|
easy_install --prefix="$out" .
|
||||||
|
|
||||||
|
${postInstall}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user