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";