From fa1c8fef2ff3a887ce6f89691a80dce200122009 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Fri, 23 Nov 2012 15:54:55 +0100 Subject: [PATCH] move pth rename and site.py removal to buildPhase This leaves the installCommand to be only easy_install and makes it easy again to overwrite this. --- .../python-modules/generic/default.nix | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 6e8794103bc2..4989bd447734 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -20,20 +20,6 @@ , installCommand ? '' easy_install --prefix="$out" . - - # A pth file might have been generated to load the package from - # within its own site-packages, rename this package not to - # collide with others. - eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth - if [ -e "$eapth" ]; then - # move colliding easy_install.pth to specifically named one - mv "$eapth" $(dirname "$eapth")/${name}.pth - fi - - # Remove any site.py files generated by easy_install as these - # cause collisions. If pth files are to be processed a - # corresponding site.py needs to be included in the PYTHONPATH. - rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py* '' , buildPhase ? "true" @@ -72,6 +58,20 @@ python.stdenv.mkDerivation (attrs // { export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH" ${installCommand} + # A pth file might have been generated to load the package from + # within its own site-packages, rename this package not to + # collide with others. + eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth + if [ -e "$eapth" ]; then + # move colliding easy_install.pth to specifically named one + mv "$eapth" $(dirname "$eapth")/${name}.pth + fi + + # Remove any site.py files generated by easy_install as these + # cause collisions. If pth files are to be processed a + # corresponding site.py needs to be included in the PYTHONPATH. + rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py* + ${postInstall} '';