From 1d2e06e068521f3f42ae100241d1ef206f0a14e1 Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Sun, 26 Feb 2012 17:23:42 +0000 Subject: [PATCH] pysite support for pythonXYFull wrapper svn path=/nixpkgs/branches/stdenv-updates/; revision=32593 --- .../interpreters/python/wrapper-builder.sh | 13 +++++++++++++ pkgs/development/interpreters/python/wrapper.nix | 1 + 2 files changed, 14 insertions(+) create mode 100644 pkgs/development/interpreters/python/wrapper-builder.sh diff --git a/pkgs/development/interpreters/python/wrapper-builder.sh b/pkgs/development/interpreters/python/wrapper-builder.sh new file mode 100644 index 000000000000..f3353c32ef10 --- /dev/null +++ b/pkgs/development/interpreters/python/wrapper-builder.sh @@ -0,0 +1,13 @@ +source $stdenv/setup + +preConfigure() { + PYTHONPATH='$( + # activate site if installed + bindir=$(dirname "$0") + pysite="$bindir/pysite" + relpath=$(test -x "$pysite" && "$pysite" path) + echo -n ${relpath:+"$relpath":} +)'"$PYTHONPATH" +} + +genericBuild diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index 0522a47d17b3..f1d2471c942e 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -7,6 +7,7 @@ stdenv.mkDerivation { name = "python-${python.version}-wrapper"; buildInputs = [ makeWrapper ]; + builder = ./wrapper-builder.sh; propagatedBuildInputs = [ python ] ++ extraLibs; unpackPhase = "true";