-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #834 from peti/new-python-wrapper
Re-implement python-wrapper with buildEnv.
- Loading branch information
Showing
1 changed file
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |