# Create a python that knows about additional python packages via
# PYTHONPATH

{stdenv, python, makeWrapper, extraLibs ? []}:

stdenv.mkDerivation {
  name = "python-${python.version}-wrapper";

  buildInputs = [ makeWrapper ];
  propagatedBuildInputs = [ python ] ++ extraLibs;

  unpackPhase = "true";
  installPhase = ''
    mkdir -p "$out/bin"
    for prg in 2to3 idle pydoc python python-config python${python.majorVersion} python${python.majorVersion}-config smtpd.py; do
      makeWrapper "$python/bin/$prg" "$out/bin/$prg" --suffix PYTHONPATH : "$PYTHONPATH"
    done
    ensureDir "$out/share"
    ln "$python/share/man" "$out/share/man" -s
  '';

  inherit python;
  inherit (python) meta;
}

# Create a python that knows about additional python packages via
# PYTHONPATH

{stdenv, python, makeWrapper, extraLibs ? []}:

stdenv.mkDerivation {
  name = "python-${python.version}-wrapper";

  propagatedBuildInputs = [python makeWrapper] ++ extraLibs;

  unpackPhase = "true";
  installPhase = ''
    mkdir -p "$out/bin"
    for prg in 2to3 idle pydoc python python-config python${python.majorVersion} python${python.majorVersion}-config smtpd.py; do
      makeWrapper "$python/bin/$prg" "$out/bin/$prg" --suffix PYTHONPATH : "$PYTHONPATH"
    done
    ensureDir "$out/share"
    ln "$python/share/man" "$out/share/man" -s
  '';

  inherit python;
  inherit (python) meta;
}

Revert "do not propagate makeWrapper via pythonXYFull"
Revert "do not propagate makeWrapper via pythonXYFull"

This reverts commit 3ee2667e4c60c2ed850da8538cf135fe7f716f30.

svn path=/nixpkgs/branches/stdenv-updates/; revision=32656
