nixpkgs/pkgs/development/interpreters/python/wrapper.nix
Shea Levy 06fe4d9904 Partial revert of b09f8110db
Didn't mean to commit this change

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-11-19 09:04:32 -05:00

29 lines
817 B
Nix

{ stdenv, python, buildEnv, makeWrapper, recursivePthLoader, extraLibs ? [], postBuild ? ""
, stdLibs ? stdenv.lib.attrValues python.modules
}:
# Create a python executable that knows about additional packages.
(buildEnv {
name = "python-${python.version}-wrapper";
paths = stdenv.lib.filter (x : x ? pythonPath) (stdenv.lib.closePropagation extraLibs) ++ stdLibs ++ [ python recursivePthLoader ];
ignoreCollisions = false;
postBuild = ''
. "${makeWrapper}/nix-support/setup-hook"
if [ -L "$out/bin" ]; then
unlink "$out/bin"
fi
mkdir -p "$out/bin"
cd "${python}/bin"
for prg in *; do
rm -f "$out/bin/$prg"
makeWrapper "${python}/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
done
'' + postBuild;
}) // {
inherit python;
inherit (python) meta;
}