Skip to content

Commit

Permalink
Merge pull request #834 from peti/new-python-wrapper
Browse files Browse the repository at this point in the history
Re-implement python-wrapper with buildEnv.
  • Loading branch information
peti committed Oct 3, 2013
2 parents be67ab5 + 742d659 commit bee1d07
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pkgs/development/interpreters/python/wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Create a python that knows about additional python packages via
# PYTHONPATH
{ stdenv, python, buildEnv, makeWrapper, recursivePthLoader, extraLibs ? [] }:

{ stdenv, python, makeWrapper, recursivePthLoader, extraLibs ? [] }:
# Create a python executable that knows about additional packages.

stdenv.mkDerivation {
(buildEnv {
name = "python-${python.version}-wrapper";
paths = extraLibs ++ [ python makeWrapper recursivePthLoader ];
ignoreCollisions = false;

propagatedBuildInputs = extraLibs ++ [ python makeWrapper recursivePthLoader ];

unpackPhase = "true";
installPhase = ''
postBuild = ''
. "${makeWrapper}/nix-support/setup-hook"
mkdir -p "$out/bin"
for prg in 2to3 idle pdb pdb${python.majorVersion} pydoc python python-config python${python.majorVersion} python${python.majorVersion}-config smtpd.py; do
makeWrapper "$python/bin/$prg" "$out/bin/$prg" --suffix PYTHONPATH : "$PYTHONPATH"
cd "${python}/bin"
for prg in *; do
echo "$prg --> $out/bin/$prg"
rm -f "$out/bin/$prg"
makeWrapper "${python}/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
done
ensureDir "$out/share"
ln -s "$python/share/man" "$out/share/man"
'';

}) // {
inherit python;
inherit (python) meta;
}

0 comments on commit bee1d07

Please sign in to comment.